Method and apparatus to facilitate code verification and garbage collection in a platform-independent virtual machine
AssigneeSun Microsystems, Inc.
InventorsNicholas Shaylor, Douglas N. Simon
Life of this patent
Estimating the term…
Abstract
One embodiment of the present invention provides a system that facilitates code verification and garbage collection in a platform-independent virtual machine. The system operates by first receiving a code module written in a platform-independent language. Next, the system examines the code module to locate calls to program methods within the code module. The system then transforms the code module so that all operands remaining on the evaluation stack only relate to the called method when the method is called, thereby simplifying verification and garbage collection of the code module.
Claims15
A method to facilitate code verification and garbage collection in a platform-independent virtual machine, comprising:
- receiving a code module written in a platform-independent language;
- examining the code module to locate a call to a program method within the code module;
- and
- transforming the code module so that all operands remaining on an evaluation stack when the program method is called relate to the program method, wherein transforming the code module involves ensuring that the evaluation stack includes only elements related to a bytecode that may trigger garbage collection when the bytecode is executed;
- whereby verification and garbage collection of the code module is simplified.
An apparatus to facilitate code verification and garbage collection in a platform-independent virtual machine, comprising:
- a central processing unit;
- a memory system;
- a receiving mechanism configured to receive a code module written in a platform-independent language;
- an examining mechanism configured to examine the code module to locate a call to a program method within the code module;
- and
- a transforming mechanism configured to transform the code module so that all operands remaining on an evaluation stack when the program method is called relate to the program method, wherein transforming the code module involves ensuring that the evaluation stack includes only elements related to a bytecode that may trigger garbage collection when the bytecode is executed;
- whereby verification and garbage collection of the code module is simplified.
A computer system to facilitate code verification and garbage collection in a platform-independent virtual machine, comprising:
- a central processing unit;
- a memory system;
- a port for communicating with an external client;
- a bus to couple the central processing unit, the memory system, and the port;
- a receiving mechanism within the central processing unit configured to receive a code module written in a platform-independent language;
- an examining mechanism configured to examine the code module to locate a call to a program method within the code module;
- and
- a transforming mechanism configured to transform the code module so that all operands remaining on an evaluation stack when the program method is called relate to the program method, wherein transforming the code module involves ensuring that the evaluation stack includes only elements related to a bytecode that may trigger garbage collection when the bytecode is executed;
- whereby verification and garbage collection of the code module is simplified.
Dependencies are inferred from the claim text.