Patent ID: 8769518

Claim:
A computer-implemented method comprising steps of: during a record time, recording instructions of a program that is executed by a virtual machine; during the record time, for each class that is loaded, adding, to each method of said class, a bytecode that allows a replay core to determine that a verification process has started for a class being loaded; determining, by the replay core during the record time, that the verification process has started for a first of the classes being loaded, wherein the determining is based on the bytecode added during the record time, wherein the verification process is performed by one or more verifiers, wherein execution of the verification process is not guaranteed to produce deterministic results; in response to determining that the verification process has started during the record time, for each particular class of two or more classes that are loaded during the verification process of the first class, storing data that (a) identifies a class loader that was used to load said particular class, (b) identifies said particular class, and (c) preserves an order in which the two or more classes were loaded; during a replay time, for each class that is loaded, adding, to each method of said class, a bytecode that allows the replay core to determine that a verification process has started for a class being loaded; determining, by the replay core during the replay time, that the verification process has started for the first class, wherein the determining is based on the bytecode added during the replay time; in response to determining that the verification process has started during the replay time, causing the verification process to produce deterministic results, comprising: i) before a verifier can cause any classes to be loaded, causing the classes identified in the stored data to be loaded in the same order in which those classes were originally loaded during record time; comprising: invoking, in said order, one or more methods of one or more class loaders identified in said stored data, and caching, in a cache, class objects returned due to said invoking; and ii) for each class load operation that the verifier attempts to cause during the replay time, preventing the class load from loading any class, and returning a cached class from said cache to the verifier; wherein said steps are performed by one or more computing devices.