libjit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libjit] Converting stack machine bytecodes into JIT instructions


From: Guillaume Bort
Subject: [Libjit] Converting stack machine bytecodes into JIT instructions
Date: Thu, 19 Jun 2014 22:15:11 +0200

Hi everyone,

First of all, congrats to the maintainers for the wonderful work they have made with this library.

I'm exploring some ways to convert a stack based machine bytecode (Java bytecode) to LibJit instructions.

The page here https://www.gnu.org/software/libjit/doc/libjit_7.html#Values covers this topic and make a lot of sense at first. But when the stack behaviour depends of some runtime computations, it become less evident.

Take for example this Java byte code:

 0: iconst_1      
 1: istore_0      
 2: iload_0       
 3: ifeq          10
 6: iconst_1      
 7: goto          11
10: iconst_0      
11: ireturn 

The maximum runtime stack size is 1 (as indicated by the compiler in the class data).

But if I try to follow the method highlighted in the documentation page I ends with a stack of size 2. And of course the top element just before the return instruction is always a 0 value.

Did I missed something? What would be the proper way to achieve that?

Thanks a lot for any help or any indication.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]