Patent ID: 9542210
Date: 2017-01-10
CPC Classifications: G06F

Claim:
1. A computer-implemented method implemented with a replay core equipped with a processor and one or more memory devices having executable instructions stored thereon, which when executed by the processor, perform the method steps, comprising: during a record phase of a replay core recording instructions of an application that is executed by a virtual machine, the replay core intercepting an event that indicates that a particular class is being loaded by code that is executed by a virtual machine, wherein execution of objects instantiated from the particular class is potentially non-deterministic; in response to intercepting the event, modifying the particular class by injecting bytecodes into the particular class thereby producing a modified particular class, the injected bytecodes for causing values produced by objects instantiated from the particular class in a replay phase of the application executed by the virtual machine to be the same as the values produced by objects instantiated from the particular class during the record phase, wherein modifying the particular class comprises walking a class hierarchy to determine whether the particular class inherits from one or more other classes thereby causing other classes in the class hierarchy to be loaded; storing the modified particular class in memory prior to the replay phase; listening, by the replay core during the record phase, for invocations of original methods associated with the one or more other classes that load as a result of walking the class hierarchy; replacing the invocations of the original methods with invocations of proxy methods that cause data to be stored in a replay stream in memory that (a) identify class loaders that load the other classes, and (b) identify the other classes, wherein the replay stream identifies an order in which the other classes were loaded during the record phase; invoking, by the proxy methods during the record phase, each of the original methods and passing to the original methods the data that identifies the other class for the respective original method; during the replay phase, the replay core intercepting an event that indicates that the particular class is being loaded by code that is executed by the virtual machine; in response to intercepting the event during the replay phase, accessing the modified particular class from the memory instead of modifying the particular class by injecting bytecodes into the particular class as was done during the record phase, therefore the one or more other classes from which the particular class inherits are not caused to be loaded as a result of walking the class hierarchy to determine whether the particular class inherits from one or more other classes; in response to intercepting the event during the replay phase, accessing the replay stream that identifies the order in which the other classes were loaded during the record phase and, in accordance with the order in which the other classes were loaded during the record phase, for each of the other classes: causing the bytecode from the modified particular class to be executed by the virtual machine at the replay phase instead of the particular class to ensure deterministic replay.