This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem with --full-tailcalls using CVS


Hi Per!

Found a problem with --full-tailcalls with the CVS version of Kawa:

(define (systime) (invoke-static <java.lang.System> 'currentTimeMillis))

Results in:

java.lang.Error: emitSwap: not allowed for long or double
at gnu.bytecode.CodeAttr.emitSwap(CodeAttr.java:251)
at gnu.expr.ConsumerTarget.compileFromStack(ConsumerTarget.java:77)
at gnu.expr.PrimProcedure.compile(PrimProcedure.java:367)
at gnu.expr.PrimProcedure.compile(PrimProcedure.java:354)
at gnu.expr.ApplyExp.compile(ApplyExp.java:155)
at gnu.expr.ApplyExp.compile(ApplyExp.java:105)
at gnu.expr.Expression.compileWithPosition(Expression.java:72)
at gnu.expr.LambdaExp.compileBody(LambdaExp.java:1333)
at gnu.expr.LambdaExp.compileAsMethod(LambdaExp.java:1307)
at gnu.expr.LambdaExp.compileSetField(LambdaExp.java:520)
at gnu.expr.SetExp.compile(SetExp.java:145)
at gnu.expr.Expression.compileNotePosition(Expression.java:82)
at gnu.expr.Expression.compileWithPosition(Expression.java:69)
at gnu.expr.LambdaExp.compileBody(LambdaExp.java:1333)
at gnu.expr.Compilation.addClass(Compilation.java:1472)
at gnu.expr.Compilation.compile(Compilation.java:758)
at gnu.expr.ModuleExp.evalToClass(ModuleExp.java:54)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:166)
at kawa.Shell.run(Shell.java:231)
at kawa.standard.load.loadSource(load.java:134)
at kawa.standard.load.loadSource(load.java:103)
at kawa.standard.load.apply(load.java:197)
at kawa.Shell.runFile(Shell.java:282)
at kawa.repl.main(repl.java:593)

Wrapping it in a lambda doesn't help, but putting it in a let does.

Works fine with the release 1.6.99 jar.

Been doing some benchmarking and there is a big speed improvement from the 1.6.99 release to the current CVS for normal code (computing Sterling numbers, lots of numeric computation and arrays). Huge hit from turning on --full-tailcalls (one-half to one-third the speed) either way though.

Kawa is cool. Thanks again for creating it!

jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]