摘要:
A software transactional memory system is provided that provides privatization safety. The system identifies situations where the completion of a transaction may be expedited because a privatization artifact will not occur. The system determines whether a privatization artifact may occur using a read and write set intersection test, transactional variables, pessimistic locks, or declared privatizing transactions. If a privatization artifact will not occur for a transaction, then the system may allow the transaction to complete prior to one or more earlier transactions.
摘要:
A method for heuristic-based resumption of fully-young garbage collection intervals comprises allocating memory to objects within one or more regions of a heap partitioned into a plurality of regions, and classifying each heap region as belonging to a category of a plurality of categories based at least in part on the recency of allocation of objects within the regions. The method may further comprise determining, using a garbage collection efficiency metric, whether regions belonging to a first category of the plurality of categories are to be excluded from a collection set of a particular garbage collection interval on the heap. In response to determining that the first category of regions is to be excluded, the method may comprise selecting a collection set that does not include any regions of the first category, and reclaiming memory from that collection set.
摘要:
Software transactional memory (STM) primitives are provided that allow the results of prior open calls to be used by subsequent open calls either as-is or through another STM primitive that consumes the results of the previous invocation. The STM primitives are configured to ensure that the address of a shadow copy representing a memory location will not changed across a wide range of operations and thereby enable re-use of the shadow copy.
摘要:
A remembered set for a memory heap region in a garbage-collected computer system is modified to classify reference locations stored therein by the heap region from which the references originate so that the number of references originating from a given region can be easily determined. If the number of remembered set entries for references from a second region to a first region reaches a predetermined threshold, the second region is constrained so that it will be collected at the same time as, or before, the first region. Then, all entries in the remembered set associated with the first region for references from the second region to the first region can be deleted, and no such entries need be entered in the future thereby reducing the size of that remembered set and the time required to scan it.
摘要:
A garbage collector operates in multiple threads, and one thread can be parsing a region containing a free block while another thread is allocating space from that free block for an object being relocated to that region. The object being relocated may be an array object, for which the length determination is based on more than one word in the object; it may be based on a class-identifying word and a number-of-elements word. To prevent a parsing thread from parsing erroneously by reading both of those words between the relocating thread's writing one of them and writing the other, the relocating thread first writes into the classifying word a distinguished value from which a parsing thread can conclude that the values it reads in other fields of the block are not to be trusted. The relocating thread then completes writing the other fields before it writes the relocated object's classifying word, and any parsing thread repeats the size-determining routine until the uninitialized value is removed and it can therefore rely on other values in the block.
摘要:
Methods, systems, and articles of manufacture consistent with the present invention provide a program component including a set of instructions native to the system, include in the set of native instructions an instruction to maintain information on use of a particular object, and permit reuse of memory resources corresponding to the particular object based on an indication from a source that the particular object is no longer being used, the source being different from any source used to provide information on use of objects associated with non-native instructions of the program component. Additionally, garbage collection is not permitted during native code operations to read or write data in object fields because during such operations an indication exists that such collection may be inaccurate and could possibly reclaim or relocate objects referenced by native code though not specified as such in the native code stack and global variables.
摘要:
A dynamic compiler determines whether to inline methods in place of virtual method calls by inspecting such calls' receiver expressions. If a given call site meets other criteria for inlining, the method is inlined if its receiver expression can be proved to have a property called “pre-existence.” One kind of expression whose pre-existence is easily proved is a calling-procedure argument to which the body of the calling procedure makes no assignment. One of the other criteria is that the argument's static type is a class whose definition of the callee method has not been overridden, and the compiler employs a dependency data structure to record against both the caller and the callee that the caller contains code whose validity depends on the assumption that this criterion has been met. If the compiler thereafter compiles another implementation of the callee method, it inspects the dependency structures in which dependencies have been recorded against the callee method, and it recompiles the callers whose object code's validity is indicated by such structures to depend on that callee method's not having been overridden. The restriction of inlining to pre-existing receiver expression allows currently running invocations of the original compilation of the caller method to continue without fear of error.
摘要:
Software transactional memory (STM) primitives are provided that allow the results of prior open calls to be used by subsequent open calls either as-is or through another STM primitive that consumes the results of the previous invocation. The STM primitives are configured to ensure that the address of a shadow copy representing a memory location will not changed across a wide range of operations and thereby enable re-use of the shadow copy.
摘要:
A hosted pre-compilation system is described herein that provides a way to enable ahead-of-time compilation for managed code running inside a host. The host triggers ahead-of-time compilation at application runtime, after any configuration settings are available. The host can choose which modules to compile, when to compile them, and where to persist the generated images. Upon detecting a module load, the host can trigger pre-compilation, provide the loader an existing pre-compiled image of the module, or do nothing. The runtime/platform validates the integrity of any host-supplied pre-compiled image and provides application programming interfaces (APIs) to inform the host when an image becomes invalid and fails to load. The platform also provides APIs to let the host trigger compilation of binaries at any time relevant to the host, and to generate the images either synchronously or in a background process.
摘要:
A dynamic race detection system is provided that detects race conditions in code that executes concurrently in a computer system. The dynamic race detection system uses a modified software transactional memory (STM) system to detect race conditions. A compiler converts portions of the code that are not configured to operate with the STM system into pseudo STM code that operates with the STM system. The dynamic race detection system detects race conditions in response to either a pseudo STM transaction in the pseudo STM code failing to validate when executed or an actual STM transaction failing to validate when executed because of conflict with a concurrent pseudo STM transaction.