Avoiding guard test invalidation for virtual and interface calls
First Claim
1. A method comprising:
- receiving, by one or more computer processors, a virtual call associated with a first implementation method;
identifying, by one or more computer processors, a virtual call associated with a second implementation method that appears to have similar functionality to the first implementation method;
determining, by one or more computer processors, whether the virtual call associated with the first implementation method and the virtual call associated with the second implementation method produce the same result by;
determining either that bytecodes of the first implementation method match bytecodes associated with the second implementation method, ordetermining that constant pool references associated with the first implementation method match constant pool references associated with the second implementation method;
responsive to determining that the virtual call associated with the first implementation method and the virtual call associated with the second implementation method produce the same result, using, by one or more computer processors, a result of the virtual call associated with the first implementation method as a result of the virtual call associated with the second implementation method; and
responsive to determining that the virtual call associated with the second implementation method does not produce the same result as the virtual call associated with the first implementation method, deploying, by one or more computer processors, a slow dispatch of the second virtual call, wherein deploying a slow dispatch of the second virtual call comprises issuing a patch and performing a revirtualization.
1 Assignment
0 Petitions
Accused Products
Abstract
Embodiments of the present invention provide methods, computer program products, and systems for optimizing virtual calls. Embodiments of the present invention can be used to receive a virtual call associated with a first implementation method and identify a virtual call associated with a second implementation method that appears to have similar functionality to the first implementation method. Embodiments of the present invention can determine whether the virtual call associated with the first implementation method and the virtual call associated with the second implementation method produce the same result and, responsive to determining that the virtual call associated with the first implementation method and the virtual call associated with the second implementation method produce the same result, use a result of the virtual call associated with the first implementation method as a result of the virtual call associated with the second implementation method.
15 Citations
8 Claims
-
1. A method comprising:
-
receiving, by one or more computer processors, a virtual call associated with a first implementation method; identifying, by one or more computer processors, a virtual call associated with a second implementation method that appears to have similar functionality to the first implementation method; determining, by one or more computer processors, whether the virtual call associated with the first implementation method and the virtual call associated with the second implementation method produce the same result by; determining either that bytecodes of the first implementation method match bytecodes associated with the second implementation method, or determining that constant pool references associated with the first implementation method match constant pool references associated with the second implementation method; responsive to determining that the virtual call associated with the first implementation method and the virtual call associated with the second implementation method produce the same result, using, by one or more computer processors, a result of the virtual call associated with the first implementation method as a result of the virtual call associated with the second implementation method; and responsive to determining that the virtual call associated with the second implementation method does not produce the same result as the virtual call associated with the first implementation method, deploying, by one or more computer processors, a slow dispatch of the second virtual call, wherein deploying a slow dispatch of the second virtual call comprises issuing a patch and performing a revirtualization. - View Dependent Claims (2, 3)
-
-
4. A computer program product comprising:
one or more computer readable storage media and program instructions stored on the one or more computer readable storage media, the program instructions comprising; program instructions to receive a virtual call associated with a first implementation method; program instructions to identify a virtual call associated with a second implementation method that appears to have similar functionality to the first implementation method; program instructions to determine whether the virtual call associated with the first implementation method and the virtual call associated with the second implementation method produce the same result by; program instructions to determine either that bytecodes of the first implementation method match bytecodes associated with the second implementation method, or program instructions to determine that constant pool references associated with the first implementation method match constant pool references associated with the second implementation method; program instructions to, responsive to determining that the virtual call associated with the first implementation method and the virtual call associated with the second implementation method produce the same result, use a result of the virtual call associated with the first implementation method as a result of the virtual call associated with the second implementation method; and program instructions to, responsive to determining that the virtual call associated with the second implementation method does not produce the same result as the virtual call associated with the first implementation method, deploy a slow dispatch of the second virtual call, wherein deploying a slow dispatch of the second virtual call comprises issuing a patch and performing a revirtualization. - View Dependent Claims (5, 6)
-
7. A computer system comprising:
-
one or more computer processors; one or more computer readable storage media; and program instructions stored on the one or more computer readable storage media for execution by at least one of the one or more computer processors, the program instructions comprising; program instructions to receive a virtual call associated with a first implementation method; program instructions to identify a virtual call associated with a second implementation method that appears to have similar functionality to the first implementation method; program instructions to determine whether the virtual call associated with the first implementation method and the virtual call associated with the second implementation method produce the same result by; program instructions to determine either that bytecodes of the first implementation method match bytecodes associated with the second implementation method, or program instructions to determine that constant pool references associated with the first implementation method match constant pool references associated with the second implementation method; program instructions to, responsive to determining that the virtual call associated with the first implementation method and the virtual call associated with the second implementation method produce the same result, use a result of the virtual call associated with the first implementation method as a result of the virtual call associated with the second implementation method; and program instructions to, responsive to determining that the virtual call associated with the second implementation method does not produce the same result as the virtual call associated with the first implementation method, deploy a slow dispatch of the second virtual call, wherein deploying a slow dispatch of the second virtual call comprises issuing a patch and performing a revirtualization. - View Dependent Claims (8)
-
Specification