High speed virtual machine and compiler
First Claim
1. A virtual machine that executes a virtual machine instruction sequence under control of a real machine, comprising:
- stack means for temporarily storing data in a last-in first-out format;
instruction storing means for storing the virtual machine instruction sequence and a plurality of sets of succeeding instruction information, wherein each virtual machine instruction in the virtual machine instruction sequence is associated with a set of succeeding instruction information that indicates a change in a storage state of the data in the stack means due to execution of a virtual machine instruction executed after the associated virtual machine instruction;
read means for reading a virtual machine instruction and an associated set of succeeding instruction information from the instruction storing means; and
decoding-executing means for specifying and executing operations corresponding to a combination of the read virtual machine instruction and the read set of succeeding instruction information.
0 Assignments
0 Petitions
Accused Products
Abstract
A virtual machine with a stack architecture includes: a stack 120 whose top level (TOS) and the second level from the top (SOS) are mapped to registers of a real machine 201; an instruction storing unit 102 for storing a virtual machine instruction sequence to be executed; next instruction information storing unit 101 for storing a plurality of sets of next instruction information that are each associated with a different virtual machine instruction in the virtual machine instruction sequence, the set of next instruction information for a given virtual machine instruction indicating a change in a number of sets of data stored in the stack 120 due to execution of a virtual machine instruction executed after the given virtual machine instruction; a decoding unit 103 for decoding a virtual machine instruction and an associated set of next instruction information after reading them from the instruction storing unit 102 and the next instruction information storing unit 101; and an executing unit 110 for executing the decoded virtual machine instruction and performing a stack handling in the stack 120 in advance for a virtual machine instruction that is to be executed next based on the set of next instruction information.
53 Citations
38 Claims
-
1. A virtual machine that executes a virtual machine instruction sequence under control of a real machine, comprising:
-
stack means for temporarily storing data in a last-in first-out format;
instruction storing means for storing the virtual machine instruction sequence and a plurality of sets of succeeding instruction information, wherein each virtual machine instruction in the virtual machine instruction sequence is associated with a set of succeeding instruction information that indicates a change in a storage state of the data in the stack means due to execution of a virtual machine instruction executed after the associated virtual machine instruction;
read means for reading a virtual machine instruction and an associated set of succeeding instruction information from the instruction storing means; and
decoding-executing means for specifying and executing operations corresponding to a combination of the read virtual machine instruction and the read set of succeeding instruction information. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A compiler that generates programs for a virtual machine with a stack architecture that includes a stack, comprising:
-
instruction sequence converting means for converting a source program into a virtual machine instruction sequence executable by the virtual machine;
succeeding instruction information generating means for generating sets of succeeding instruction information corresponding to virtual machine instructions in the virtual machine instruction sequence, each set of succeeding instruction information indicating a change in a storage state of data in the stack due to execution of a virtual machine instruction executed after a virtual machine instruction corresponding to the set of succeeding instruction information; and
associating means for associating each set of generated succeeding instruction information with a corresponding virtual machine instruction and outputting the set of succeeding instruction information and the virtual machine instruction.
-
-
8. A virtual machine that executes a virtual machine instruction sequence under control of a real machine, comprising:
-
instruction storing means for storing the virtual machine instruction sequence;
read means for reading a virtual machine instruction in the virtual machine instruction sequence from the instruction storing means; and
decoding-executing means for specifying and executing operations corresponding to the virtual machine instruction, wherein the decoding-executing means includes a branch instruction judging unit for judging if the virtual machine instruction is a branch instruction and an interrupt handling unit for detecting, if the virtual machine instruction is judged to be a branch instruction, whether there is an interrupt request, and, if so, performing a corresponding interrupt handling in addition to executing the branch instruction. - View Dependent Claims (9)
-
-
10. A virtual machine that executes a virtual machine instruction sequence under control of a real machine, comprising:
-
instruction storing means for storing the virtual machine instruction sequence;
read means for reading a virtual machine instruction in the virtual machine instruction sequence from the instruction storing means; and
decoding-executing means for specifying and executing operations corresponding to the read virtual machine instruction, wherein the decoding-executing means includes a block judging unit for judging if the read virtual machine instruction is a virtual machine instruction representative of a block, a block being a predetermined number of virtual machine instructions and an interrupt handling unit for detecting, if the read virtual machine instruction is judged to be the representative virtual machine instruction, whether there is an interrupt request to the virtual machine, and if so, performing a corresponding interrupt handling in addition to executing the representative virtual machine instruction. - View Dependent Claims (11)
-
-
12. A virtual machine that executes a virtual machine instruction sequence under control of a real machine, comprising:
-
real machine program storing means for storing a plurality of subprograms composed of real machine instructions,;
instruction storing means that includes a first area for storing the virtual machine instruction sequence and a second area for storing a plurality of pointers to the subprograms in the real machine program storing means;
read means for reading a virtual machine instruction in the virtual machine instruction sequence from the first area in the instruction storing means; and
decoding-executing means for specifying and executing operations corresponding to the read virtual machine instruction, wherein the decoding-executing means includes an area judging unit for judging whether the virtual machine instruction is an instruction that transfers control flow to a location in the second area and an address converting-executing unit for executing, if the virtual machine instruction is judged to be an instruction that transfers control flow to a location in the second area, a subprogram indicated by a pointer stored in the location. - View Dependent Claims (13)
-
-
14. A virtual machine that executes a virtual machine instruction sequence under control of a real machine, comprising:
-
instruction storing means for storing the virtual machine instruction sequence;
read means for reading a virtual machine instruction in the virtual machine instruction sequence from the instruction storing means; and
decoding-executing means for specifying and executing operations corresponding to the read virtual machine instruction, wherein the instruction storing means is a plurality of instruction blocks that constitute the virtual machine instruction sequence, the instruction blocks corresponding to basic blocks, wherein the instruction blocks each include;
an identifier area for storing an identifier that specifies a start position of the instruction block in the instruction storing means;
a non-branch instruction area for storing non-branch instructions belonging to a corresponding basic block; and
a branch instruction area for storing at least one branch instruction belonging to the corresponding basic block,wherein each branch instruction stored in the branch instruction area designates a branch destination using an identifier stored in one of the identifier areas, and wherein if the read virtual machine instruction is a branch instruction, the decoding-executing means has control flow branch to a start position of a non-branch instruction area in an instruction block having an identifier designated by the branch instruction as a branch destination. - View Dependent Claims (15, 16, 17, 18)
-
-
19. A virtual machine that executes a virtual machine instruction sequence under control of a real machine, comprising:
-
instruction storing means for storing a compressed virtual machine instruction sequence to be executed;
read means for reading a compressed virtual machine instruction in the compressed virtual machine instruction sequence from the instruction storing means and decompressing the compressed virtual machine instruction to generate a decompressed virtual machine instruction; and
decoding-executing means for specifying and executing operations corresponding to the decompressed virtual machine instruction, wherein the instruction storing means is a plurality of instruction blocks containing compressed virtual machine instructions constituting the compressed virtual machine instruction sequence, the instruction blocks corresponding to basic blocks, wherein the instruction blocks each include;
an identifier area for storing an identifier that specifies a start position of the instruction block in the instruction decompresses the compressed virtual machine instruction by referring to a decompression table in an instruction block to which the compressed virtual machine instruction belongs to generate the decompressed virtual machine instruction. - View Dependent Claims (21, 22, 20, 23, 24)
-
-
25. A Just-In-Time (JIT) compiler for use with a virtual machine that executes a virtual machine instruction sequence under control of a real machine, the JIT compiler converting parts of the virtual machine instruction sequence into real machine instruction sequences before execution, and
the JIT compiler comprising: -
block start information receiving means for receiving an input of block start information for each virtual machine instruction that composes the virtual machine instruction sequence, the block start information showing whether a corresponding virtual machine instruction would correspond to a start of a basic block if the virtual machine instruction sequence were divided into basic blocks;
converting means for converting virtual machine instructions in the virtual machine instruction sequence into real machine instruction sequences; and
outputting means for rearranging the real machine instruction sequences produced by the converting means into basic block units in accordance with the block start information received by the block start information receiving means. - View Dependent Claims (26, 27, 28)
-
-
29. A storage method used by instruction storing means that stores a virtual machine instruction sequence to be executed by a virtual machine, having a stack architecture, under control of a real machine,
the storage method being characterized by storing each virtual machine instruction in the virtual machine instruction sequence associated with different succeeding instruction information, the succeeding instruction information for a given virtual machine instruction indicating a change in a storage state of data in a stack due to execution of a virtual machine instruction executed after the given virtual machine instruction.
-
30. A storage method used by instruction storing means that stores a virtual machine instruction sequence to be executed by a virtual machine under control of a real machine,
wherein the storage method results in: -
the instruction storing means being a plurality of instruction blocks that constitute the virtual machine instruction sequence, the instruction blocks corresponding to basic blocks;
the instruction blocks each including;
an identifier area for storing an identifier that specifies a start position of the instruction block in the instruction storing means;
a non-branch instruction area for storing non-branch instructions belonging to a corresponding basic block; and
a branch instruction area for storing at least one branch instruction belonging to the corresponding basic block; and
each branch instruction stored in the branch instruction area designating a branch destination using an identifier stored in one of the identifier areas.
-
-
31. A computer-readable recording medium that stores a program to have a computer function as a virtual machine with a stack architecture,
wherein the virtual machine comprises: -
stack means for temporarily storing data in a last-in first-out format;
instruction storing means for storing a virtual machine instruction sequence and a plurality of sets of succeeding instruction information, wherein each virtual machine instruction in the virtual machine instruction sequence is associated with a set of succeeding instruction information that indicates a change in a storage state of the data in the stack means due to execution of a virtual machine instruction executed after the associated virtual machine instruction;
read means for reading a virtual machine instruction and an associated set of succeeding instruction information from the instruction storing means; and
decoding-executing means for specifying and executing operations corresponding to a combination of the read virtual machine instruction and the read set of succeeding instruction information.
-
-
32. A computer-readable recording medium that stores a program to have a computer function as a compiler that generates a program for a virtual machine with a stack architecture,
wherein the compiler comprises: -
instruction sequence converting means for converting a source program into a virtual machine instruction sequence executable by the virtual machine;
succeeding instruction information generating means for generating sets of succeeding instruction information corresponding to virtual machine instructions in the virtual machine instruction sequence, each set of succeeding instruction information indicating a change in a storage state of data in the stack due to execution of a virtual machine instruction executed after a virtual machine instruction corresponding to the set of succeeding instruction information; and
associating means for associating each set of generated succeeding instruction information with a corresponding virtual machine instruction and outputting the set of succeeding instruction information and the virtual machine instruction.
-
-
33. A computer-readable recording medium that stores a program to have a computer function as a virtual machine,
wherein the virtual machine comprises: -
instruction storing means for storing a virtual machine instruction sequence;
read means for reading a virtual machine instruction in the virtual machine instruction sequence from the instruction storing means; and
decoding-executing means for specifying and executing operations corresponding to the virtual machine instruction, wherein the decoding-executing means includes a branch instruction judging unit for judging if the virtual machine instruction is a branch instruction and an interrupt handling unit for detecting, if the virtual machine instruction is judged to be a branch instruction, whether there is an interrupt request, and, if so, performing a corresponding interrupt handling in addition to executing the branch instruction.
-
-
34. A computer-readable recording medium that stores a program to have a computer function as a virtual machine,
wherein the virtual machine comprises: -
instruction storing means for storing a virtual machine instruction sequence;
read means for reading a virtual machine instruction in the virtual machine instruction sequence from the instruction storing means; and
decoding-executing means for specifying and executing operations corresponding to the read virtual machine it instruction, wherein the decoding-executing means includes a block judging unit for judging if the read virtual machine instruction is a virtual machine instruction representative of a block, a block being a predetermined number of virtual machine instructions and an interrupt handling unit for detecting, if the read virtual machine instruction is judged to be the representative virtual machine instruction, whether there is an interrupt request to the virtual machine, and if so, performing a corresponding interrupt handling in addition to executing the representative virtual machine instruction.
-
-
35. A computer-readable recording medium that stores a program to have a computer function as a virtual machine,
wherein the virtual machine comprises: -
real machine program storing means for storing a plurality of subprograms composed of real machine instructions;
instruction storing means that includes a first area for storing a virtual machine instruction sequence and a second area for storing a plurality of pointers to the subprograms in the real machine program storing means;
read means for reading a virtual machine instruction in the virtual machine instruction sequence from the first area in the instruction storing means; and
decoding-executing means for specifying and executing operations corresponding to the read virtual machine instruction, wherein the decoding-executing means includes an area judging unit for judging whether the virtual machine instruction is an instruction that transfers control flow to a location in the second area and an address converting-executing unit for executing, if the virtual machine instruction is judged to be an instruction that transfers control flow to a location in the second area, a subprogram indicated by a pointer stored in the location.
-
-
36. A computer-readable recording medium that stores a program to have a computer function as a virtual machine,
wherein the virtual machine comprises: -
instruction storing means for storing a virtual machine instruction sequence;
read means for reading a virtual machine instruction in the virtual machine instruction sequence from the instruction storing means; and
decoding-executing means for specifying and executing operations corresponding to the read virtual machine instruction, wherein the instruction storing means is a plurality of instruction blocks that constitute the virtual machine instruction sequence, the instruction blocks corresponding to basic blocks, wherein the instruction blocks each include;
an identifier area for storing an identifier that specifies a start position of the instruction block in the instruction storing means;
a non-branch instruction area for storing non-branch instructions belonging to a corresponding basic block; and
a branch instruction area for storing at least one branch instruction belonging to the corresponding basic block,wherein each branch instruction stored in the branch instruction area designates a branch destination using an identifier stored in one of the identifier areas, and wherein if the read virtual machine instruction is a branch instruction, the decoding-executing means has control flow branch to a start position of a non-branch instruction area in an instruction block having an identifier designated by the branch instruction as a branch destination.
-
-
37. A computer-readable recording medium that stores a program to have a computer function as a virtual machine,
wherein the virtual machine comprises: -
instruction storing means for storing a compressed virtual machine instruction sequence to be executed;
read means for reading a compressed virtual machine instruction in the compressed virtual machine instruction sequence from the instruction storing means and decompressing the compressed virtual machine instruction to generate a decompressed virtual machine instruction; and
decoding-executing means for specifying and executing operations corresponding to the decompressed virtual machine instruction, wherein the instruction storing means is a plurality of instruction blocks containing compressed virtual machine instructions constituting the compressed virtual machine instruction sequence, the instruction blocks corresponding to basic blocks, wherein the instruction blocks each include;
an identifier area for storing an identifier that specifies a start position of the instruction block in the instruction storing means;
a non-branch instruction area for storing compressed non-branch instructions belonging to a corresponding basic block; and
a branch instruction area for storing at least one compressed branch instruction belonging to the corresponding basic block,wherein each compressed branch instruction stored in a branch instruction area designates a branch destination using an identifier stored in one of the identifier areas, and wherein if the decompressed virtual machine instruction is a branch instruction, the decoding-executing means has control flow branch to a start position of a non-branch instruction area in an instruction block having an identifier designated by the branch instruction as a branch destination.
-
-
38. A computer-readable recording medium that stores a program to have a computer function as a Just-In-Time (JIT) compiler used with a virtual machine that executes a virtual machine instruction sequence under control of a real machine, the JIT compiler converting parts of the virtual machine instruction sequence into real machine instruction sequences before execution,
wherein the compiler comprises: -
block start information receiving means for receiving an input of block start information for each virtual machine instruction that composes the virtual machine instruction sequence, the block start information showing whether a corresponding virtual machine instruction would correspond to a start of a basic block if the virtual machine instruction sequence were divided into basic blocks;
converting means for converting virtual machine instructions in the virtual machine instruction sequence into real machine instruction sequences; and
outputting means for rearranging the real machine instruction sequences produced by the converting means into basic block units in accordance with the block start information received by the block start information receiving means.
-
Specification