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]

Different results with eval and compileToFiles()


I have a very simple Perl program that I compiled to Kawa's IR:

It looks like this:

(#%module/1/ (
  Declaration[scalar_x/1/]
) (#%begin
(#%set! scalar_x (#%quote (#%Scalar "Hello
")))
(#%apply (#%quote #<primitive procedure int
                    gnu.perl.lang.Functions.print$V(java.lang.Object[])>)
          (#%ref/1/ scalar_x))))


When I call evalModule on the ModuleExp itself, the program works, and
prints "Hello\n".

However, when I compileToFiles() and then run "kaffe ClassName", the print$V
function gets a null pointer argument.

I did build the Declaration object by hand, and called the ModuleExpr's
add() to place it there.

I created the SetExp and ReferenceExp with that same Declaration object.

Can anyone tell me what I am missing?

I suspected that somehow the "scalar_x" variable was being set and used in
the Environment rather than in the Module itself, but I couldn't find a way
to easily figure that out.


BTW, has anyone found a good class decompiler that can decompile
Kawa-generated .class files easily?  It seems that would make debugging a
bit easier.


-- 
Bradley M. Kuhn  -  http://www.ebb.org/bkuhn

PGP signature


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