System and method for automatically and selectively promoting object variables to method fields and variables in a digital computer system
First Claim
1. A code generator for generating, from code in a program, native code executable by a computer system, the computer system including a memory subsystem including a heap in which objects are stored and a stack in which method variables are stored, the code generator comprising:
- A. a code portion receiver configured to receive a portion of the program code for which the native executable code is to be generated;
B. an object instantiation detector configured to determine whether the received program code portion includes an operator for enabling instantiation of a new object;
C. a variable promotion eligibility detector configured to, in response to a positive determination by said object instantiation detector, determine whether the object to be instantiated contains a variable to be used in processing of the received program code portion which can be promoted to a method variable, and D. a native code generator configured to, in response to positive determination by said variable promotion eligibility detector, generate native code to enable said variable to be instantiated on the stack.
2 Assignments
0 Petitions
Accused Products
Abstract
A code generating system generates, from code in a program, native code that is executable by a computer system. The computer system includes a memory subsystem including a heap in which objects are stored and a stack in which method variables are stored. The code generating system may be included in a just-in-time compiler used to generate native code that is executable by a computer system, from a program in Java Byte Code form, and specifically determines, in response to Java Byte Code representative of an operator for enabling instantiation of a new object, whether the object to be instantiated contains a variable to be used in processing of the received program code portion which can be promoted to a method variable, and, if so, generates native code to enable said variable to be instantiated on the stack.
65 Citations
21 Claims
-
1. A code generator for generating, from code in a program, native code executable by a computer system, the computer system including a memory subsystem including a heap in which objects are stored and a stack in which method variables are stored, the code generator comprising:
-
A. a code portion receiver configured to receive a portion of the program code for which the native executable code is to be generated;
B. an object instantiation detector configured to determine whether the received program code portion includes an operator for enabling instantiation of a new object;
C. a variable promotion eligibility detector configured to, in response to a positive determination by said object instantiation detector, determine whether the object to be instantiated contains a variable to be used in processing of the received program code portion which can be promoted to a method variable, and D. a native code generator configured to, in response to positive determination by said variable promotion eligibility detector, generate native code to enable said variable to be instantiated on the stack. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A code generation method for generating, from code in a program, native code executable by a computer system, the computer system including a memory subsystem including a heap in which objects are stored and a stack in which method variables are stored, method comprising the steps of:
-
A. receiving a portion of the program code for which the native executable code is to be generated;
B. determining whether the received program code portion includes an operator for enabling instantiation of a new object;
C. in response to a positive determination by said object instantiation detector, determining whether the object to be instantiated contains a variable to be used in processing of the received program code portion which can be promoted to a method variable, and D. in response to positive determination by said variable promotion eligibility detector, generating native code to enable said variable to be instantiated on the stack. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A computer program product for use in connection with a computer to provide a code generator for generating, from code in a program, native code executable by a computer system, the computer system including a memory subsystem including a heap in which objects are stored and a stack in which method variables are stored, the computer program product comprising a computer-readable medium having encoded thereon:
-
A. a code portion receiver module configured to enable the computer to receive a portion of the program code for which the native executable code is to be generated;
B. an object instantiation detector module configured to enable the computer to determine whether the received program code portion includes an operator for enabling instantiation of a new object;
C. a variable promotion eligibility detector module configured to enable the computer to, in response to a positive determination by said object instantiation detector, determine whether the object to be instantiated contains a variable to be used in processing of the received program code portion which can be promoted to a method variable, and D. a native code generator module configured to enable the computer to, in response to positive determination by said variable promotion eligibility detector, generate native code to enable said variable to be instantiated on the stack. - View Dependent Claims (16, 17, 18, 19, 20, 21)
-
Specification