Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kawa: Cannot compile values on branches #33

Closed
okuoku opened this issue Feb 10, 2016 · 4 comments
Closed

Kawa: Cannot compile values on branches #33

okuoku opened this issue Feb 10, 2016 · 4 comments

Comments

@okuoku
Copy link
Owner

okuoku commented Feb 10, 2016

(import (scheme base))

(define (ssplit-byte-class b)
  (cond ((= 20 b) 'SPACE)
        (else #f)))

(define (ssplit-parse-byte0-ORIG byte)
  (define (others cls)
    (values 'OTHERS #f))
  (let ((cls (ssplit-byte-class byte)))
   (case cls
     ((NONE) (values 'NONE #f))
     (else (others cls)))))

(define (ssplit-parse-byte0 byte)
  (define (others cls)
    (values 'OTHERS #f))
  (let ((cls (ssplit-byte-class byte)))
   (case cls
     ((NONE) (values 'NONE #f))
     (else (values 'OTHERS cls)))))

(ssplit-parse-byte0 0)

ssplit-parse-byte0 compiles well but ssplit-parse-byte0-ORIG fails as:

Exception in thread "main" java.lang.VerifyError: Bad return type
Exception Details:
  Location:
    atInteractiveLevel-9.ssplitParseByte0ORIG(Ljava/lang/Object;)Lgnu/mapping/Values; @81: areturn
  Reason:
    Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'gnu/mapping/Values' (from method signature)
  Current Frame:
    bci: @81
    flags: { }
    locals: { 'java/lang/Object', 'java/lang/Object' }
    stack: { 'java/lang/Object' }
  Bytecode:
    0x0000000: b200 102a b600 164c 2bb6 001a 123b a000
    0x0000010: 2da7 0003 2bb2 001e b800 2499 0020 05bd
    0x0000020: 000a 5903 b200 1e53 5904 b200 2853 b800
    0x0000030: 2eb2 0032 5fb6 0037 a700 1905 bd00 0a59
    0x0000040: 03b2 003a 5359 04b2 0028 53b8 002e a700
    0x0000050: 03b0
  Stackmap Table:
    full_frame(@12,{Object[#10],Object[#10]},{Integer})
    same_frame(@20)
    same_frame(@59)
    same_locals_1_stack_item_frame(@81,Object[#10])

        at java.lang.Class.getDeclaredFields0(Native Method)
        at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
        at java.lang.Class.getDeclaredField(Class.java:2068)
        at gnu.expr.ModuleContext.findInstance(ModuleContext.java:74)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:286)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:212)
        at kawa.Shell.run(Shell.java:291)
        at kawa.Shell.runFile(Shell.java:524)
        at kawa.standard.load.apply2(load.java:67)
        at kawa.standard.load.apply1(load.java:27)
        at gnu.mapping.Procedure.apply(Procedure.java:135)
        at gnu.mapping.Procedure.apply(Procedure.java:118)
        at gnu.mapping.CallContext.runUntilDone(CallContext.java:227)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:350)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:212)
        at kawa.Shell.run(Shell.java:291)
        at kawa.Shell.runFile(Shell.java:524)
        at kawa.Shell.runFileOrClass(Shell.java:447)
        at kawa.repl.processArgs(repl.java:302)
        at kawa.repl.main(repl.java:793)

kawa-2.1.jar

openjdk version "1.8.0_65"
OpenJDK Runtime Environment (build 1.8.0_65-b17)
OpenJDK 64-Bit Server VM (build 25.65-b01, mixed mode)
@okuoku
Copy link
Owner Author

okuoku commented Feb 11, 2016

Even reduced to:

(import (scheme base))

(define (ssplit-parse-byte0-ORIG byte)
  (case byte
    ((NONE) (values 'NONE #f))
    (else (values 'OTHERS #f))))

@okuoku okuoku changed the title Kawa: Cannot compile values on tail-call Kawa: Cannot compile values on branches Feb 11, 2016
@okuoku
Copy link
Owner Author

okuoku commented Feb 11, 2016

It seems we need --full-tailcalls to do this.

See also: http://www.gnu.org/software/kawa/internals/complications.html

@okuoku
Copy link
Owner Author

okuoku commented Feb 11, 2016

WARed: 2db2387

@okuoku
Copy link
Owner Author

okuoku commented Feb 12, 2016

Reported and the upstream fixed the issue. https://sourceware.org/ml/kawa/2016-q1/msg00012.html
No longer a blocker for Yuni as of r8704(kawa-2.1.1). CLOSE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant