Patent ID: 6978456
Filing Date: 2005-12-20
Classification: G06F

Abstract:
1. A method of executing a Load Constant instruction by a virtual machine, the method comprising: receiving a class file for execution by the virtual machine, the class file including a first Load Constant command which is represented as one or more bytecodes in a single stream; reading, at load time, a constant pool in the class file; determining, at load time, a Constant Pool index into the Constant Pool for the first Load Constant command; reading, at load time, the appropriate structures of the Constant Pool index based on the determined Constant Pool index; determining, at load time, the corresponding Constant Value; converting, at load time, the first Load Constant command in the single stream to a representation of the Load Constant command in a pair of bytecode streams which is loaded inside the virtual machine prior to runtime, the pair of bytecode streams consisting of: writing the Constant Value into the data stream in the virtual machine without modifying the constant pool, thereby allowing the constant value to be determined without having to load the constant pool in the virtual machine; writing the Load Constant command into the code stream in the virtual machine; reading at runtime the Load Constant command in the code stream inside the Virtual machine; retrieving at runtime the Load Constant value in the data stream inside the virtual machine; and executing at runtime the Load Constant command in the code stream by using the constant value in the data stream, thereby allowing the Load Constant command to be executed without processing the constant pool at runtime or having to load the constant pool in the virtual machine.