Method and apparatus for selecting ways to compile at runtime
First Claim
1. A method of determining at runtime how to compile bytecode instructions associated with a floating point operation creating a floating point underflow in a computer program, the method comprising:
- retrieving a bytecode instruction associated with the floating point operation that can be compiled in a plurality of ways;
determining whether the floating point operation can create a floating point underflow;
compiling the bytecode instruction a first way;
determining at runtime that a second way of compiling the bytecode instruction is desirable based on a predetermined criteria; and
recompiling the bytecode instruction the second way.
3 Assignments
0 Petitions
Accused Products
Abstract
Apparatus, methods, and computer program products are disclosed for determining how to compile a program at runtime. A bytecode instruction associated with the program that can be compiled in multiple ways is retrieved and compiled in a particular way, typically the default way. At runtime, a virtual machine determines whether another way of compiling the bytecode instruction is more desirable and, if so, the bytecode is then recompiled the other way. In some embodiments, the portion of the program that contains the bytecode instruction to be recompiled is placed in a queue with other instructions that are to be recompiled. The virtual machine may examine changing requirements of the program that have developed at the program'"'"'s execution in which the requirements are derived from profile data on each of the multiple ways the program can be compiled. The bytecode instruction within the program may be recompiled in a more preferred way based upon the profile data.
-
Citations
33 Claims
-
1. A method of determining at runtime how to compile bytecode instructions associated with a floating point operation creating a floating point underflow in a computer program, the method comprising:
-
retrieving a bytecode instruction associated with the floating point operation that can be compiled in a plurality of ways;
determining whether the floating point operation can create a floating point underflow;
compiling the bytecode instruction a first way;
determining at runtime that a second way of compiling the bytecode instruction is desirable based on a predetermined criteria; and
recompiling the bytecode instruction the second way. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A method of generating different sets of native instructions for executing a floating point operation creating a floating point underflow in a software program, the method comprising:
-
compiling the floating point operation in a first way to create a first set of native instructions;
determining whether the floating point operation can create a floating point underflow;
determining at runtime of the software program that it would be desirable to compile the floating point operation in a different way based on a predetermined criteria; and
recompiling the floating point operation in the different way to create a second set of native instructions whereby the second set of native instructions replaces the first set of native instructions. - View Dependent Claims (8, 9, 10, 11)
-
-
12. A method of executing a floating point operation in a program, the method comprising:
-
determining whether a floating point operation can create a floating point underflow;
checking a particular indicator to determine how many times a specific floating point operation has caused an underflow; and
compiling the specific floating point operation using a first way when the particular indicator meets predetermined criteria and otherwise compiling the specific floating point operation using a second way. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19, 20, 21)
checking whether a predetermined amount of time has passed from the time the specific floating point operation was compiled using an explicit check; and
marking a module including the specific floating point operation to be recompiled if the predetermined amount of time has passed.
-
-
16. A method as recited in claim 14 further including initiating the trap routine.
-
17. A method as recited in claim 14 further including setting a timer if the specific floating point operation is compiled using an explicit check.
-
18. A method as recited in claim 14 wherein the particular indicator is a counter that is incremented each time the floating point underflow is handled using a trap routine.
-
19. A method as recited in claim 14, further comprising:
-
determining which floating point operation caused the trap routine to execute;
incrementing a counter; and
marking a module including the specific floating point operation to be recompiled if the counter is above a predetermined value.
-
-
20. A method as recited in claim 19, further comprising placing the module in a recompile queue if the module is marked to be recompiled.
-
21. A method as recited in claim 19, further comprising resetting the counter associated with the method if the method has been marked to be recompiled.
-
22. A method of generating instructions for detecting floating point underflow, the method comprising:
-
determining whether an operation in a program can create a floating point underflow;
examining an underflow indicator to measure a tendency of a particular floating point operation for causing an underflow;
compiling the particular floating point operation using a trap routine according to the tendency of the particular floating point operation for causing an underflow; and
recompiling the floating point operation using an inline explicit check according to the tendency of the particular floating point operation for causing an underflow. - View Dependent Claims (23, 24)
-
-
25. A computer program product for determining at runtime how to compile bytecode instructions associated with a floating point operation creating a floating point underflow in a computer program, comprising:
-
a computer code that retrieves a bytecode instruction associated with the floating point operation that can be compiled in a plurality of ways;
a computer code that determines whether the floating point operation can create a floating point underflow;
a computer code that compiles the bytecode instruction a first way;
a computer code that determines at runtime that a second way of compiling the bytecode instruction is desirable based on a predetermined criteria; and
a computer code that recompiles the bytecode instruction the second way; and
a computer readable medium that stores the computer codes.
-
-
26. A computer program product for executing a floating point operation in a program, comprising:
-
a computer code that determines whether a floating point operation can create a floating point underflow;
a computer code that checks a particular indicator to determine how many times a particular floating point operation has caused an underflow;
a computer code that compiles the particular floating point operation using a first way when the particular indicator meets predetermined criteria and otherwise compiling the floating point operation using a second way; and
a computer readable medium that stores the computer codes.
-
-
27. A system for determining at runtime how to compile bytecode instructions associated with a floating point operation causing a floating point underflow in a computer program, the system comprising:
-
a bytecode retriever for retrieving a bytecode instruction associated with the floating point operation that can be compiled in a plurality of ways;
a floating point underflow detector for detecting whether the floating point operation can create a floating point underflow;
a compiling module for compiling the bytecode instruction in one of a first way and a second way; and
an alternative compiling detector for determining at runtime that the second way of compiling the instruction is desirable based on a predetermined criteria. - View Dependent Claims (28, 29, 30)
-
-
31. A system for executing a floating point instruction in a program, the system comprising:
-
an instruction evaluator for determining whether a floating point instruction can create a floating point underflow;
a floating point underflow indicator for keeping a count of the number of times a particular floating point operation has caused a floating point underflow; and
a compiler for compiling the particular floating point operation using a first way when the particular indicator meets predetermined criteria and otherwise compiling the particular floating point operation using a second way, wherein the floating point underflow indicator is checked to determine how many times the particular floating point operation has caused an underflow. - View Dependent Claims (32)
-
-
33. A system for determining at runtime how to compile bytecode instructions associated with a floating point operation creating a floating point underflow in a computer program having instructions comprising:
-
one or more processors; and
a computer readable medium storing a program for execution by the one or more processors comprising;
computer code that retrieves an instruction in the floating point operation that can be compiled in a plurality of ways;
computer code that determines whether the floating point operation can create a floating point underflow;
computer code that compiles the instruction in a first way;
computer code that determines at runtime that a second way of compiling the instruction is desirable based on a predetermined criteria; and
computer code that recompiles the instruction in the second way.
-
Specification