[LLVMdev] Re: Newbie questions
tromey at redhat.com
Wed Apr 26 08:57:19 PDT 2006
>>>>> "Archie" == Archie Cobbs <archie at dellroad.org> writes:
Archie> In JCVM for example, there is a bit in type->flags that
Archie> determines whether the class is initialized or not. This bit
Archie> has to be checked before every static method invocation or
Archie> static field access. You could reserve an entire byte instead
Archie> of a bit, but I don't know if that would make it any easier to
Archie> do this optimization.
My plan for this in my JIT is to just recompile the bytecode for the
function after class initializations, constant pool resolutions, and
the like. This is somewhat crude, but seems like it should work fine.
The full plan is to have some kind of heuristic so we don't go around
recompiling functions that are rarely called.
Thoughts on that?
Archie> I.e., my question is the more general one:
Archie> how do optimizations that are specific to the front-end language get
Archie> done? How does the front-end "secret knowledge" get passed through
Archie> somehow so it can be used for optimization purposes?
I was thinking that I would write some extra JVM-specific LLVM passes
and add them to the pass manager I construct.
I haven't started this, so I have no idea how I would handle passing
the information back and forth.
More information about the llvm-dev