Method and system for performing static initialization
DC CAFCFirst Claim
1. A method in a data processing system for statically initializing an array, comprising the steps of:
- compiling source code containing the array with static values to generate a class file with a clinit method containing byte codes to statically initialize the array to the static values;
receiving the class file into a preloader;
simulating execution of the byte codes of the clinit method against a memory without executing the byte codes to identify the static initialization of the array by the preloader;
storing into an output file an instruction requesting the static initialization of the array; and
interpreting the instruction by a virtual machine to perform the static initialization of the array.
2 Assignments
Litigations
0 Petitions
Reexaminations
Accused Products
Abstract
The disclosed system represents an improvement over conventional systems for initializing static arrays by reducing the amount of code executed by the virtual machine to statically initialize an array. To realize this reduction, when consolidating class files, the preloader identifies all <clinit> methods and play executes these methods to determine the static initialization performed by them. The preloader then creates an expression indicating the static initialization performed by the <clinit> method and stores this expression in the .mclass file, replacing the <clinit> method. As such, the code of the <clinit> method, containing many instructions, is replaced by a single expression instructing the virtual machine to perform static initialization, thus saving a significant amount of memory. The virtual machine is modified to recognize this expression and perform the appropriate static initialization of an array.
53 Citations
23 Claims
-
1. A method in a data processing system for statically initializing an array, comprising the steps of:
-
compiling source code containing the array with static values to generate a class file with a clinit method containing byte codes to statically initialize the array to the static values; receiving the class file into a preloader; simulating execution of the byte codes of the clinit method against a memory without executing the byte codes to identify the static initialization of the array by the preloader; storing into an output file an instruction requesting the static initialization of the array; and interpreting the instruction by a virtual machine to perform the static initialization of the array. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A method in a data processing system, comprising the steps of:
-
receiving code to be run on a processing component to perform an operation; play executing the code without running the code on the processing component to identify the operation if the code were run by the processing component; and creating an instruction for the processing component to perform the operation. - View Dependent Claims (7, 8, 9, 10, 11)
-
-
12. A data processing system comprising:
-
a storage device containing; a program with source code that statically initializes a data structure; and class files, wherein one of the class files contains a clinit method that statically initializes the data structure; a memory containing; a compiler for compiling the program and generating the class files; and a preloader for consolidating the class files, for play executing the clinit method to determine the static initialization the clinit method performs, and for creating an instruction to perform the static initialization; and a processor for running the compiler and the preloader. - View Dependent Claims (13, 14, 15, 16, 17)
-
-
18. A computer-readable medium containing instructions for controlling a data processing system to perform a method, comprising the steps of:
-
receiving code to be run on a processing component to perform an operation; simulating execution of the code without running the code on the processing component to identify the operation if the code were run by the processing component; and creating an instruction for the processing component to perform the operation. - View Dependent Claims (19, 20, 21, 22, 23)
-
Specification