Search Images Maps Play YouTube News Gmail Drive More »
Advanced Patent Search | Web History | Sign in

Patents

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.

InventorsFrank Yellin, Richard D. Tuck
Original AssigneeSun Microsystems, Inc.
Primary Examiner: Kelvin E. Booker
Current U.S. Classification717/148; 703/22; 717/151; 718/100
International Classification: G06F 945; G06F 300

View patent at USPTO
Search USPTO Assignment Database

Citations

Cited PatentFiling dateIssue dateOriginal AssigneeTitle
US5361350Dec 12, 1991Nov 1, 1994International Business Machines CorporationObject oriented method management system and software for managing class method names in a computer system
US5367685Dec 22, 1992Nov 22, 1994FirstPerson, Inc.Method and apparatus for resolving data references in generated code
US5421016Dec 12, 1991May 30, 1995International Business Machines CorporationSystem and method for dynamically invoking object methods from an application designed for static method invocation
US5437025Jan 26, 1993Jul 25, 1995International Business Machines CorporationSystem and method for run time configuration of objects in an object oriented computing environment
US5615400Jun 30, 1993Mar 25, 1997Apple Computer, Inc.System for object oriented dynamic linking based upon a catalog of registered function set or class identifiers
US5668999Dec 20, 1994Sep 16, 1997Sun Microsystems, Inc.System and method for pre-verification of stack usage in bytecode program loops
US5812828Apr 24, 1997Sep 22, 1998Centerline Software, Inc.Function simulation
US5815718May 30, 1996Sep 29, 1998Sun Microsystems, Inc.Method and system for loading classes in read-only memory
US5903899Apr 23, 1997May 11, 1999Sun Microsystems, Inc.System and method for assisting exact Garbage collection by segregating the contents of a stack into sub stacks
US5966702Oct 31, 1997Oct 12, 1999Sun Microsystems, Inc.Method and apparatus for pre-processing and packaging class files
US5999732Mar 23, 1998Dec 7, 1999Sun Microsystems, Inc.Techniques for reducing the cost of dynamic class initialization checks in compiled code
US6003038Mar 31, 1997Dec 14, 1999Sun Microsystems, Inc.Object-oriented processor architecture and operating method

Referenced by

Citing PatentFiling dateIssue dateOriginal AssigneeTitle
US6339841Apr 16, 1999Jan 15, 2002International Business Machines CorporationClass loading model
US6658492Mar 20, 1998Dec 2, 2003Sun Microsystems, Inc.System and method for reducing the footprint of preloaded classes
US6760019Jun 1, 2000Jul 6, 2004Sun Microsystems, Inc.Methods and apparatus for facilitating the sharing of computer graphics operations
US6813762Feb 22, 2000Nov 2, 2004Freescale Semiconductor, Inc.Method for processing program files in a programming language capable of dynamic loading
US6832369Aug 1, 2000Dec 14, 2004International Business Machines CorporationObject oriented method and apparatus for class variable initialization
US6915508Apr 24, 2001Jul 5, 2005Sun Microsystems, Inc.Method and apparatus for eliminating C recursion from a Java™ bytecode interpreter
US6978448Apr 24, 2001Dec 20, 2005Sun Microsystems, Inc.Method and apparatus for rewriting bytecodes to minimize runtime checks
US7024657Feb 20, 2001Apr 4, 2006Matsushita Electric Industrial Co., Ltd.Program generation apparatus for program execution system, replaces variable name in each class file by assigned offset number so that same offset numbers are assigned to non-dependent variables with same variable name
US7051323Oct 8, 2002May 23, 2006SUN Microsystems, Inc.Method and apparatus for initializing romized system classes at virtual machine build time
US7055133Apr 12, 2005May 30, 2006Sun Microsystems, Inc.Method and apparatus for eliminating C recursion from a Java programming language bytecode interpreter
US7197750Jun 28, 2001Mar 27, 2007Sun Microsystems, Inc.Java Bytecode instruction for determining hashcode values
US7222336Sep 20, 2002May 22, 2007NXP B.V.Method of compiling bytecode to native code
US7272827Apr 3, 2002Sep 18, 2007International Business Machines CorporationStatically detecting externally referenced interfaces of a program
US7434212Jul 1, 2004Oct 7, 2008International Business Machines CorporationMethod and apparatus to guarantee type and initialization safety in multithreaded programs
US7450631Oct 26, 2001Nov 11, 2008Intel CorporationMetric correction for multi user detection, for long codes DS-CDMA
US7493616May 30, 2002Feb 17, 2009Research In Motion LimitedMobile communication device application processing system
US8099729Jun 5, 2006Jan 17, 2012Freescale Semiconductor, Inc.Method and device for creating and using pre-internalized program files

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.

2. The method of claim 1 wherein the storing step includes step of:

storing a constant pool entry into the constant pool.

3. The method of claim 1 wherein the play executing step includes the steps of:

allocating a stack;
reading a byte code from the clinit method that manipulates the stack; and
performing the stack manipulation on the allocated stack.

4. The method of claim 1 wherein the play executing step includes the steps of:

allocating variables;
reading a byte code from the clinit method that manipulates local variables of the clinit method; and
performing the manipulation of the local variables on the allocated variables.

5. The method of claim 1 wherein the play executing step includes the steps of:

obtaining a reference to a constant pool of the clinit method;
reading a byte code from the clinit method that manipulates the constant pool; and
performing the constant pool manipulation.

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.

7. The method of claim 6 wherein the operation initializes a data structure, and wherein the play executing step includes the step of:

play executing the code to identify the initialization of the data structure.

8. The method of claim 6 wherein the operation statically initializes an array and wherein the play executing step includes the step of:

play executing the code to identify the static initialization of the array.

9. The method of claim 6 further including the step of:

running the created instruction on the processing component to perform the operation.

10. The method of claim 6 further including the step of:

interpreting the created instruction by a virtual machine to perform the operation.

11. The method of claim 6 wherein the operation has an effect on memory, and wherein the play executing step includes the step of:

play executing the code to identify the effect on the memory.

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.

13. The data processing system of claim 12 wherein the preloader includes a mechanism for generating an output file containing the created instruction.

14. The data processing system of claim 13 wherein the memory further includes a virtual machine that interprets the created instruction to perform the static initialization.

15. The data processing system of claim 12, wherein the data structure is an array.

16. The data processing system of claim 12 wherein the clinit method has byte codes that statically initialize the data structure.

17. The data processing system of claim 12 wherein the created instruction includes an entry into a constant pool.

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.

19. The computer-readable medium of claim 18 wherein the operation initializes a data structure, and wherein the simulating step includes the step of:

simulating execution of the code to identify the initialization of the data structure.

20. The computer-readable medium of claim 18 wherein the operation statically initializes an array and wherein the simulating step includes the step of:

simulating execution of the code to identify the static initialization of the array.

21. The computer-readable medium of claim 18 further including the step of:

running the created instruction on the processing component to perform the operation.

22. The computer-readable medium of claim 18 further including the step of:

interpreting the created instruction by a virtual machine to perform the operation.

23. The computer-readable medium of claim 18 wherein the operation has an effect on memory, and wherein the simulating step includes the step of:

simulating execution of the code to identify the effect on the memory.