Abstract:
A method for analyzing a program may include generating an initial control flow graph (CFG) for the program, identifying merge blocks of the initial CFG, identifying predecessor-merge pairs based on identifying predecessor blocks for each merge block, simulating a duplication of each predecessor-merge pair, determining whether the duplication satisfies a precondition of each of a collection of optimizations, applying, in response to satisfying the precondition, the optimization to the duplication, and generating a simulation result for the predecessor-merge pair corresponding to the duplication. The simulation result may include the optimization and a benefit of applying the optimization to the duplication. The method may further include duplicating, in the initial CFG, a predecessor-merge pair based on the simulation result corresponding to the predecessor-merge pair.
Abstract:
A method for speculative object shapes comprises obtaining values for objects of a first and second shape, determining, by a processor and during runtime, a first speculative type for the first value and a second speculative type for the second value, generating, based on the first speculative type and the second speculative type, a shape tree comprising a first subtree for the first shape and a second subtree for the second shape, marking, by the processor, the first subtree as obsolete based on a determination that the first speculative type is incorrect and that the second shape is a super shape of the first shape, and transforming, in response to marking, the first object from the first shape to the second shape by: merging the first subtree into the second subtree.
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 tracing controller may utilize a binary execution trace mechanism to trace execution of compiled application machine code. The tracing controller may initiate hardware tracing to gather control-flow hardware traces of a method executing on a processor configured to generate hardware tracing information. The controller may generate a profile based on the hardware tracing information and initiate re-compiling or re-optimizing of the method in response to determining that the new profile differs from the previous profile. The controller may repeatedly profile and re-optimize a method until profiles for the method stabilize. Profiling and hardware tracing of an application may be selectively enabled or disabled allowing the controller to respond to later phase changes in application execution by re-optimizing, thereby potentially improving overall application performance.
Abstract:
A method for analyzing a program may include generating an initial control flow graph (CFG) for the program, identifying merge blocks of the initial CFG, identifying predecessor-merge pairs based on identifying predecessor blocks for each merge block, simulating a duplication of each predecessor-merge pair, determining whether the duplication satisfies a precondition of each of a collection of optimizations, applying, in response to satisfying the precondition, the optimization to the duplication, and generating a simulation result for the predecessor-merge pair corresponding to the duplication. The simulation result may include the optimization and a benefit of applying the optimization to the duplication. The method may further include duplicating, in the initial CFG, a predecessor-merge pair based on the simulation result corresponding to the predecessor-merge pair.
Abstract:
The invention relates to a method for generating executable code from application source code. The method steps include determining a programmatic expression using the application source code and determining a first value for the programmatic expression. The method steps further include compiling the programmatic expression into a first optimized code portion using the first value, an assumption, and an expression scope. The method steps further include executing the application source code. The method steps further include determining that the programmatic expression is modified outside of the expression scope, invalidating the assumption, and de-optimizing the first optimized code portion.
Abstract:
A method for optimizing code includes receiving, by a compiler and from an interpreter, a code section representation including an object allocation, compiling, by the compiler, the code section representation into machine code with a compact allocated object of the object allocation, and triggering a deoptimization returning execution to the interpreter in response to an attempted access of the compact allocated object. The method further includes setting, by the interpreter and within the code section representation, a flag indicating that a new compact allocated object is required at a location of the attempted access, receiving, by the compiler, the code section representation including the flag, compiling, by the compiler and according to the flag, the code section representation into new machine code including the new compact allocated object, and executing the new machine code with the new compact allocated object.
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 tracing controller may utilize a binary execution trace mechanism to trace execution of compiled application machine code. The tracing controller may initiate hardware tracing to gather control-flow hardware traces of a method executing on a processor configured to generate hardware tracing information. The controller may generate a profile based on the hardware tracing information and initiate re-compiling or re-optimizing of the method in response to determining that the new profile differs from the previous profile. The controller may repeatedly profile and re-optimize a method until profiles for the method stabilize. Profiling and hardware tracing of an application may be selectively enabled or disabled allowing the controller to respond to later phase changes in application execution by re-optimizing, thereby potentially improving overall application performance.
Abstract:
A tracing controller may utilize a binary execution trace mechanism to trace execution of compiled application machine code. The tracing controller may initiate hardware tracing to gather control-flow hardware traces of a method executing on a processor configured to generate hardware tracing information. The controller may generate a profile based on the hardware tracing information and initiate re-compiling or re-optimizing of the method in response to determining that the new profile differs from the previous profile. The controller may repeatedly profile and re-optimize a method until profiles for the method stabilize. Profiling and hardware tracing of an application may be selectively enabled or disabled allowing the controller to respond to later phase changes in application execution by re-optimizing, thereby potentially improving overall application performance.