Specializing write-barriers for objects in a garbage collected heap
First Claim
1. In a computer system, a method for controlling the execution of write-barrier program code when a mutator program calls a reference-modifying method of a receiver object via a class pointer field, the method comprising:
- A) including in the receiver object, both a first method version with first write-barrier code and a second method version with second write-barrier code that differs from the first write-barrier code;
B) before a predetermined condition is met, storing a first pointer in the class pointer field so that a subsequent call to the receiver object method follows the first pointer and executes the first method version; and
C) after the predetermined condition is met, storing a second pointer in the class pointer field so that a subsequent call to the receiver object method follows the second pointer and executes the second method version.
2 Assignments
0 Petitions
Accused Products
Abstract
A technique is provided for reducing the number of write barriers executed in mutator code without compromising garbage collector performance. Advantageously, a compiler generates two forms of a mutator code—a first version with write barriers and a second version substantially without write barriers. In operation, the first version of the code may be accessed by a vtable in a “mature” near-class and the second version may be accessed by a vtable in a “nascent” near-class. According to the invention, mapping of functionally equivalent points in the first and second versions of the mutator code may be facilitated by an associated pcmap. Further, each of the first and second versions may also be associated with a respective nr_map that facilitates mapping functionally equivalent points within different branches of guard code sequences corresponding to reference-writes to non-receiver objects.
-
Citations
35 Claims
-
1. In a computer system, a method for controlling the execution of write-barrier program code when a mutator program calls a reference-modifying method of a receiver object via a class pointer field, the method comprising:
-
A) including in the receiver object, both a first method version with first write-barrier code and a second method version with second write-barrier code that differs from the first write-barrier code; B) before a predetermined condition is met, storing a first pointer in the class pointer field so that a subsequent call to the receiver object method follows the first pointer and executes the first method version; and C) after the predetermined condition is met, storing a second pointer in the class pointer field so that a subsequent call to the receiver object method follows the second pointer and executes the second method version. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
-
-
15. A computer system for controlling the execution of write-barrier program code when a mutator program calls a reference-modifying method of a receiver object via a class pointer field, the system comprising:
-
a processor; and a computer-readable memory that stores program instructions executable by the processor for A) including in the receiver object, both a first method version with first write-barrier code and a second method version with second write-barrier code that differs from the first write-barrier code; B) before a predetermined condition is met, storing a first pointer in the class pointer field so that a subsequent call to the receiver object method follows the first pointer and executes the first method version; and C) after the predetermined condition is met, storing a second pointer in the class pointer field so that a subsequent call to the receiver object method follows the second pointer and executes the second method version. - View Dependent Claims (16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28)
-
-
29. An apparatus operable in a computer system having a memory for controlling the execution of write-barrier program code when a mutator program executing in the memory calls a reference-modifying method of a receiver object via a class pointer field, the apparatus comprising:
-
means for inserting a first method version into the receiver object with first write-barrier code and for inserting a second method version into the receiver object with second write-barrier code that differs from the first write-barrier code; means, operable before a predetermined condition is met, for storing a first pointer in the class pointer field so that a subsequent call to the receiver object method follows the first pointer and executes the first method version; and means, operable after the predetermined condition is met, for storing a second pointer in the class pointer field so that a subsequent call to the receiver object method follows the second pointer and executes the second method version. - View Dependent Claims (30, 31, 32, 33, 34, 35)
-
Specification