Method for JIT compiler to optimize repetitive synchronization
First Claim
1. In a just-in-time compiler of program code, the program code including a plurality of blocks of instructions and the program code, when executed, performing repetitive synchronization on a plurality of objects, a method of optimizing said repetitive synchronization, said method comprising the steps of:
- examining said program code to collect information about each block of said plurality of blocks to identify candidate locking operations and candidate unlocking operations in paths between an initial locking operation and a final unlocking operation, wherein said information includes a first subset, a second subset and a third subset of said plurality of blocks, where said first subset includes blocks that include a locking operation, said second subset includes blocks that include an unlocking operation, and said third subset includes blocks that succeed a given block;
analyzing said information to determine a set of synchronization operations to be removed, including;
selecting a given object of said plurality of objects, where said given object is repetitively synchronized;
selecting a given block, from said second subset, in which a unlocking operation on said given object is to be performed;
selecting a successor block, from an intersection of said first subset and said third subset, in which a locking operation on said given object is to be performed; and
adding said unlocking operation and said locking operation to said set of synchronization operations to be removed;
modifying the program code based on said set of synchronization operations to be removed, where said modifying includes inserting a new synchronization operation where necessitated by removing synchronization operations in said set.
0 Assignments
0 Petitions
Accused Products
Abstract
Repetitive synchronization in program code is optimized through lock coarsening that is performed subject to a number of constraints. Using a forward pass over the program code followed by a backward pass, region extent bits may be determined that identify the points in the program where object locking can be coarsened. The program code may then be modified to realize coarsened locking regions determined based on the region extent bits. Alternatively, previously determined value numbers may provide much of the information collected by the two passes. In such a case, a single pass over the program code may locate features that limit lock coarsening opportunities. A set of synchronization operations that can be removed may then be determined and used when modifying the program code to coarsen locking regions.
-
Citations
20 Claims
-
1. In a just-in-time compiler of program code, the program code including a plurality of blocks of instructions and the program code, when executed, performing repetitive synchronization on a plurality of objects, a method of optimizing said repetitive synchronization, said method comprising the steps of:
-
examining said program code to collect information about each block of said plurality of blocks to identify candidate locking operations and candidate unlocking operations in paths between an initial locking operation and a final unlocking operation, wherein said information includes a first subset, a second subset and a third subset of said plurality of blocks, where said first subset includes blocks that include a locking operation, said second subset includes blocks that include an unlocking operation, and said third subset includes blocks that succeed a given block; analyzing said information to determine a set of synchronization operations to be removed, including; selecting a given object of said plurality of objects, where said given object is repetitively synchronized; selecting a given block, from said second subset, in which a unlocking operation on said given object is to be performed; selecting a successor block, from an intersection of said first subset and said third subset, in which a locking operation on said given object is to be performed; and adding said unlocking operation and said locking operation to said set of synchronization operations to be removed; modifying the program code based on said set of synchronization operations to be removed, where said modifying includes inserting a new synchronization operation where necessitated by removing synchronization operations in said set. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A just-in-time compiler of program code stored on a computer readable tangible medium, said program code including a plurality of blocks of instructions and said program code, when executed, performing repetitive synchronization on a plurality of objects, said compiler configured to:
-
examine said program code to collect information about each block of said plurality of blocks to identify candidate locking operations and candidate unlocking operations in paths between an initial locking operation and a final unlocking operation, wherein said information includes a first subset, a second subset and a third subset of said plurality of blocks, where said first subset includes blocks that include a locking operation, said second subset includes blocks that include an unlocking operation, and said third subset includes blocks that succeed a given block; analyze said information to determine a set of synchronization operations to be removed by selecting a given object of said plurality of objects, where said given object is repetitively synchronized; selecting a given block, from said second subset, in which a unlocking operation on said given object is to be performed; selecting a successor block, from an intersection of said first subset and said third subset, in which a locking operation on said given object is to be performed; and adding said unlocking operation and said locking operation to said set of synchronization operations to be removed; modify said program code based on said set of synchronization operations to be removed, where said modifying includes inserting a new synchronization operation where necessitated by removing synchronization operations in said set.
-
-
20. A computer readable tangible medium containing computer-executable instructions which, when performed by a processor in a computer system, cause said computer system to:
-
examine a listing of program code, said program code including a plurality of blocks of instructions and said program code, when executed, performing repetitive synchronization on a plurality of objects, to collect information about each block of said plurality of blocks to identify candidate locking operations and candidate unlocking operations in paths between an initial locking operation and a final unlocking operation, wherein said information includes a first subset, a second subset and a third subset of said plurality of blocks, where said first subset includes blocks that include a locking operation, said second subset includes blocks that include an unlocking operation, and said third subset includes blocks that succeed a given block; analyze said information to determine a set of synchronization operations to be removed by selecting a given object of said plurality of objects, where said given object is repetitively synchronized; selecting a given block, from said second subset, in which a unlocking operation on said given object is to be performed; selecting a successor block, from an intersection of said first subset and said third subset, in which a locking operation on said given object is to be performed; and adding said unlocking operation and said locking operation to said set of synchronization operations to be removed; and modify said program code based on said set of synchronization operations to be removed, where said modifying includes inserting a new synchronization operation where necessitated by removing synchronization operations in said set.
-
Specification