Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [omr-dev] ResolvedMethod question

DefineFunction is used by JitBuilder to look up the target whenever you Call something. That can be anything with a native entry point.

The OMR compiler and JitBuilder do not, in and of themselves,"remember" targets that you have compiled before, though they can handle a self-recursive function call. The code is stored in the code cache, but the JIT "forgets" about the entry point. That's not 100% ideal, though. In order to support "freeing" a compiled code body, it probably should retain some meta-data about code regions in the code cache, but it currently doesn't.

To call something else, the OMR compiler requires a ResolvedMethod describing the target that's able to answer simple questions about it. The purpose of JitBuilder's DefineFunction API is to create such ResolvedMethods for the targets of calls needed by the MethodBuilder and to then hide the ResolvedMethods behind a name (C string) so Call can look them up also using the simple string.

The JIT compiler does not typically hang onto ResolvedMethods outside of a compilation. It's assumed there are other data structures already maintaining that info (along with lots of other stuff the JIT doesn't tend to care as much about). They are part of the compiler specific data structures that provide a layer of indirection across different language runtimes so that the JIT can compile code for different runtimes even though they don't all use the same underlying structure to represent "methods" (or functions or their equivalent concept in other languages).

Mark Stoodley 8200 Warden Avenue
Senior Software Developer Markham, L6G 1C7
IBM Runtime Technologies Canada
Phone:+1-905-413-5831 
e-mail:mstoodle@xxxxxxxxxx 

We cannot solve our problems with the same thinking we used when we created them - Albert Einstein
 
 






Back to the top