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.