'lock_method' action is used to lock the data associated with a method in VM.

Due to the fact that the same method can be compiled or recompiled in different threads, JIT uses per-method locks to protect methods data during modifications.

Examples of methods data: compiled version of the method, byte-code mapping information, unwind information, GC-map information, inline information.

Warning: No Java code must be executed when JIT holds a native lock. This means that the whole compilation can be locked only when lazy resolution mode is used. If you turn lazy resolution mode off, its preferable to move 'lock_method' action to the end of the compilation pipeline and place it before the emitter action. Note that in this configuration parallel compilation of the same method consumes more memory and CPU resources because of multiple versions of IR created.

Jitrino_OPT/lock_method (last edited 2009-09-20 21:55:06 by localhost)