Last updated August 20, 2009 02:57, by Thomas Wuerthinger
A target method is the result of a Java just-in-time compiler when compiling a Java method. It consists of the following data:
* ''Code:'' Byte array containing the X86 machine code instructions.
* ''Data:'' Byte array for data used in the code.
* ''References:'' Array of object references that are accessed by the code.
Additionally there it contains information about references from code positions to:
* ''Runtime Calls:'' The virtual machine needs to provide an implementation for runtime calls. The effect or result of the calls is determined by the Java virtual machine specification (e.g. monitor locking, resolving of a class, or allocating an object)
* ''Global Stub Calls:'' The compiler registers global stubs during initialization, which are target methods themselves. Compared to other target methods, they are callee saved methods and adhere to no specific calling convention.
* ''Data References:'' Offset into the data section.
* ''Object References:'' Offset into the reference array.
* ''Direct Calls:'' Records a call to another method that must be relocated by the virtual machine. Includes a stack reference map.
* ''Indirect Calls:'' Records a virtual method call that does not need relocation. Includes a stack reference map.
* ''Safepoints:'' Valid execution point for garbage collection. Includes a stack and a register reference map.
* ''Exception Handlers:'' Position where an exception can occur and the start of an exception handler. Also includes the exception class.
At safepoints there is also information about a mapping between the Java execution state (locals, expression stack and monitors) and machine level data locations (registers, stack).
The code can have multiple entry points (e.g. when a method is compiled with on-stack-replacement) and there is a specific calling convention for a target method.





