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:
Optimizing program execution includes performing, to obtain an expanded call graph, an expansion of an initial call graph. The expanded call graph includes nodes. The initial call graph is defined for a program that includes a root method and a child method. The method may further include calculating a cost value and a benefit value for inlining the child method, calculating an inlining priority value as a function of the cost value and the benefit value, and inlining, based on analyzing the expanded call graph and comparing the inlining priority value to a dynamic threshold, the child method into the root method. The child method may correspond to a node in the expanded call graph.
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 and system of cross-language inlining that includes receiving source code of a multiple language program, the source code including a main language and a first access of a first foreign object in a first additional language; translating the main language to obtain a main language intermediate representation (IR); translating the first additional language to obtain a first IR snippet; composing, before performing a compilation, the main language IR and the first IR snippet to obtain a cross-language IR; and performing the compilation of the cross-language IR to obtain machine code corresponding to the multiple language program.
Abstract:
A method and system of cross-language inlining that includes receiving source code of a multiple language program, the source code including a main language and a first access of a first foreign object in a first additional language; translating the main language to obtain a main language intermediate representation (IR); translating the first additional language to obtain a first IR snippet; composing, before performing a compilation, the main language IR and the first IR snippet to obtain a cross-language IR; and performing the compilation of the cross-language IR to obtain machine code corresponding to the multiple language program.
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 executing a program in parallel includes creating a program replica, which includes a write operation on and an identifier of an object and is a copy of the program, for a thread. The identifier specifies whether the object is thread-local. The method includes modifying the write operation based on a speculation that the write operation uses only thread-local objects. The write operation executes in a transaction of the thread. The method includes determining, while executing the program replica and using the identifier, that the object used by the write operation is not thread-local, de-optimizing the write operation by adding instrumentation to implement a software transactional memory (STM) system for the write operation to obtain a de-optimized write operation, and performing the de-optimized write operation on the object to obtain a result and store the result in a redo log.
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.