Patent ID: 7058934

Claim:
A method of instantiating objects by a virtual machine, said method comprising: receiving a first sequence of bytecodes to be executed by said virtual machine, wherein said first sequence of bytecodes is selected from a defined first set of executable virtual machine instructions implemented to conform with a virtual machine specification that includes said defined first set of executable virtual machine instructions; selecting, at load time, a first-reduced instruction from a reduced-set of virtual machine instructions, wherein said first-reduced instruction represents two or more different virtual machine instructions in said first sequences of virtual machine instructions that were selected from said defined first set of executable virtual machine instructions, the virtual machine being arranged to execute the reduced-set of virtual machine instructions that provide substantially all of the functionality provided by said defined first set of virtual machine instructions, and wherein every one of the instructions in said defined first set of virtual machine instructions can be represented by at least one of the virtual machine instructions in the reduced-set of virtual machine instructions, and wherein said reduced-set of virtual machine instructions consists of a number of virtual machine instructions which is less than the number executable virtual machine instructions in said defined first set of virtual machine instructions; translating, at load time, said two or more different virtual machine instructions in said first sequence into said first-reduced instruction from said reduced-set of virtual machine instructions; determining, after said translating, a second sequence of bytecodes that includes said first-reduced instruction, thereby representing said first sequence of bytecodes with a second sequence which includes at least said first-reduced instruction, selected from said reduced-set of virtual machine instruction, that replaces said two or more different virtual machine instructions in said first sequence; determining, at load time, whether said second sequence of bytecodes includes an instantiation instruction immediately followed by a duplicate stack instruction; determining, at load time, a macro instruction that represents said instantiation instruction and said duplicate stack instruction that immediately follows said instantiation instruction; loading in said virtual machine prior to execution time, said macro instruction instead of said instantiation instruction and said duplicate stack instruction; and executing said macro instruction to instantiate a new object.