Abstract:
A method for compiling code includes receiving a code section representation including a guard at a location, placing, at the guard, a triggering condition, and relocating the guard from the location to a second location in the code section representation. The method also includes transforming the guard into a control-split instruction. The control-split instruction includes a deoptimization branch and a continue execution branch. The method further includes placing, at the guard, a deoptimization instruction, and selecting a symbolic frame state linked to a side-effecting instruction. The side-effecting instruction is the last side-effecting instruction before the control-split instruction. The method also includes linking the deoptimization instruction with the symbolic frame state based on the symbolic frame state being linked to the side-effecting instruction, unlinking the symbolic frame state from the side-effecting instruction, and storing the code section representation.
Abstract:
A method for a compiler includes receiving, by the compiler and from an interpreter, a representation of a code section having a control path that changes the representation. The representation has profiling data, and the profiling data has a threshold. The method further includes performing, by the compiler and based on the threshold, a partial evaluation of the interpreter executing the representation, compiling, by the compiler, a machine code of the representation, with the control path replaced by a deoptimization point during the compilation of the machine code, triggering the deoptimization point during execution of the machine code, and returning execution to the interpreter based on the triggering.
Abstract:
A method for compiling code includes receiving a code section representation including a guard at a location, placing, at the guard, a triggering condition, and relocating the guard from the location to a second location in the code section representation. The method also includes transforming the guard into a control-split instruction. The control-split instruction includes a deoptimization branch and a continue execution branch. The method further includes placing, at the guard, a deoptimization instruction, and selecting a symbolic frame state linked to a side-effecting instruction. The side-effecting instruction is the last side-effecting instruction before the control-split instruction. The method also includes linking the deoptimization instruction with the symbolic frame state based on the symbolic frame state being linked to the side-effecting instruction, unlinking the symbolic frame state from the side-effecting instruction, and storing the code section representation.
Abstract:
A method for a compiler includes receiving, by the compiler and from an interpreter, a representation of a code section having a control path that changes the representation. The representation has profiling data, and the profiling data has a threshold. The method further includes performing, by the compiler and based on the threshold, a partial evaluation of the interpreter executing the representation, compiling, by the compiler, a machine code of the representation, with the control path replaced by a deoptimization point during the compilation of the machine code, triggering the deoptimization point during execution of the machine code, and returning execution to the interpreter based on the triggering.