Skip to main content

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

On 15 June 2018 at 20:45, Mark Stoodley <mstoodle@xxxxxxxxxx> wrote:
>
> 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).


Great - thank you. This make it clearer to me what is going on.

Regards
Dibyendu


Back to the top