Bytecode program interpreter apparatus and method with pre-verification of data type restrictions and object initialization
First Claim
1. A computer program product for use in conjunction with a computer system, the computer program product comprising a computer readable storage medium and a computer program mechanism embedded therein, the computer mechanism comprising:
- a program verifier for verifying that any specified program meets predefined data type and program stack usage restrictions, the specified program including a sequence of instructions, where each of a subset of the instructions each represents an operation on data of a specific data type;
each instruction in the subset having associated data type restrictions on the data type of data to be manipulated by that instruction;
the program verifier including data type testing instructions for determining whether execution of any instruction in a specified program would violate data type restrictions, if any, for that instruction and generating a program fault signal when execution of any instruction in the specified program would violate the data type restrictions for that instruction;
said data type testing instructions including;
instructions for storing, for each instruction in said program, a data type snapshot, said data type snapshot including data type information concerning data types associated with data stored in an operand stack and registers by said program immediately prior to execution of the corresponding instruction; and
instructions for emulating operation of each of said instructions, including instructions for emulating operation of a selected instruction in the program by;
analyzing stack and register usage by said selected instruction so as to generate a current data type usage map for said operand stack and registers, determining successor instructions to said selected instruction, and merging the current data type usage map with the data type snapshot of said determined successor instructions;
said data type testing instructions including instructions for determining when said stack and register usage by said instruction would violate said data type restrictions for that instruction and generating a program fault signal when execution of said instruction program would violate said data type restrictions.
0 Assignments
0 Petitions
Accused Products
Abstract
A program interpreter for computer programs written in a bytecode language, which uses a restricted set of data type specific bytecodes. The interpreter, prior to executing any bytecode program, executes a bytecode program verifier procedure that verifies the integrity of a specified program by identifying any bytecode instruction that would process data of the wrong type for such a bytecode and any bytecode instruction sequences in the specified program that would cause underflow or overflow of the operand stack. If the program verifier finds any instructions that violate predefined stack usage and data type usage restrictions, execution of the program by the interpreter is prevented. After pre-processing of the program by the verifier, if no program faults were found, the interpreter executes the program without performing operand stack overflow and underflow checks and without performing data type checks on operands stored in operand stack. As a result, program execution speed is greatly improved.
54 Citations
102 Claims
-
1. A computer program product for use in conjunction with a computer system, the computer program product comprising a computer readable storage medium and a computer program mechanism embedded therein, the computer mechanism comprising:
-
a program verifier for verifying that any specified program meets predefined data type and program stack usage restrictions, the specified program including a sequence of instructions, where each of a subset of the instructions each represents an operation on data of a specific data type;
each instruction in the subset having associated data type restrictions on the data type of data to be manipulated by that instruction;the program verifier including data type testing instructions for determining whether execution of any instruction in a specified program would violate data type restrictions, if any, for that instruction and generating a program fault signal when execution of any instruction in the specified program would violate the data type restrictions for that instruction; said data type testing instructions including; instructions for storing, for each instruction in said program, a data type snapshot, said data type snapshot including data type information concerning data types associated with data stored in an operand stack and registers by said program immediately prior to execution of the corresponding instruction; and instructions for emulating operation of each of said instructions, including instructions for emulating operation of a selected instruction in the program by;
analyzing stack and register usage by said selected instruction so as to generate a current data type usage map for said operand stack and registers, determining successor instructions to said selected instruction, and merging the current data type usage map with the data type snapshot of said determined successor instructions;said data type testing instructions including instructions for determining when said stack and register usage by said instruction would violate said data type restrictions for that instruction and generating a program fault signal when execution of said instruction program would violate said data type restrictions.
-
-
2. A method, comprising:
-
receiving from a source computer a program formed of low-level program code; verifying prior to execution that when an instruction of the program is executed that can be executed along more than one execution path, a data type requirement of that instruction is satisfied and a number of operands on a stack is identical, regardless of the execution path taken to arrive at the instruction; and executing the verified program. - View Dependent Claims (3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
-
-
14. A computer system, comprising:
-
memory for storing a program formed of low-level program code; a data processing unit for executing programs stored in the memory; a program verifier, stored in the memory and executed by the data processing unit, the program verifier including instructions for verifying prior to execution that when an instruction of the program is executed that can be executed along more than one execution path, a data type requirement of that instruction is satisfied and a number of operands on a stack is identical, regardless of the execution path taken to arrive at the instruction; and a program execution module for executing the verified program.
-
-
15. A computer system, comprising:
-
means for selectively connecting the computer system via a network to a sending computer to receive from the sending computer a program formed of low-level program code; memory for storing the program; a data processing unit for executing programs stored in the memory; a program verifier, stored in the memory and executed by the data processing unit, the program verifier including instructions for verifying prior to execution that when an instruction of the program is executed that can be executed along more than one execution path, a data type requirement of that instruction is satisfied and a number of operands on a stack is identical, regardless of the execution path taken to arrive at the instruction; and a program execution module for executing the verified program. - View Dependent Claims (16, 17, 18, 19, 20, 21, 22, 23, 24, 25)
-
-
26. A computer program product for use in conjunction with a computer system, the computer program product comprising a computer readable storage medium and a computer program mechanism embedded therein, the computer program mechanism comprising:
-
a program verifier, for analyzing a program formed of low-level, program code;
the program verifier including instructions for verifying prior to execution of the program that when an instruction of the program is executed that can be executed along more than one execution path, a data type requirement of that instruction is satisfied and a number of operands on a stack is identical, regardless of the execution path taken to arrive at the instruction; anda program execution module for executing the verified program. - View Dependent Claims (27, 28, 29, 30, 31, 32, 33, 34, 35, 36)
-
-
37. A method, comprising:
-
receiving from a source computer a program formed of low-level program code; verifying prior to execution that when an instruction of the program is executed that can be executed along more than one execution path, a number of operands on a stack is identical and a data type state associated with the stack is compatible with the instruction, regardless of the execution path taken to arrive at the instruction; and executing the verified program. - View Dependent Claims (38, 39, 40, 41, 42, 43, 44, 45, 46, 47)
-
-
48. A computer system, comprising:
-
memory for storing a program formed of low-level program code; a data processing unit for executing programs stored in the memory; a program verifier, stored in the memory and executed by the data processing unit, the program verifier including instructions for verifying, prior to execution, that when an instruction of the program is executed that can be executed along more than one execution path, a number of operands on a stack is identical and a data type state associated with the stack is compatible with the instruction, regardless of the execution path taken to arrive at the instruction; and a program execution module for executing the verified program.
-
-
49. A computer system, comprising:
-
means for selectively connecting the computer system via a network to a sending computer to receive from the sending computer a program formed of low-level program code; memory for storing the program; a data processing unit for executing programs stored in the memory; a program verifier, stored in the memory and executed by the data processing unit, the program verifier including instructions for verifying, prior to execution, that when an instruction of the program is executed that can be executed along more than one execution path, a number of operands on a stack is identical and a data type state associated with the stack is compatible with the instruction, regardless of the execution path taken to arrive at the instruction; and a program execution module for executing the verified program. - View Dependent Claims (50, 51, 52, 53, 54, 55, 56, 57, 58)
-
-
59. A computer program product for use in conjunction with a computer system, the computer program product comprising a computer readable storage medium and a computer program mechanism embedded therein, the computer program mechanism comprising:
-
a program verifier for analyzing a program formed of low-level program code, the program verifier including instructions for verifying, prior to execution, that when an instruction of the program is executed that can be executed along more than one execution path, a number of operands on a stack is identical and a data type state associated with the stack is compatible with the instruction, regardless of the execution path taken to arrive at the instruction; and a program execution module for executing the verified program. - View Dependent Claims (60, 61, 62, 63, 64, 65, 66, 67, 68)
-
-
69. A computer program product for use in conjunction with a computer system, the computer program product comprising a computer readable storage medium and a computer program mechanism embedded therein, the computer program mechanism comprising:
-
a program verifier, for analyzing a program formed of low-level, program code; the program verifier including instructions for verifying prior to execution of the program that when an instruction of the program that can be executed along more than one execution path is executed by the computer system, a number of operands on a stack associated with that instruction is identical regardless of the execution path taken to arrive at the instruction, and a type associated with each of the operands on the stack for a first execution path that includes the instruction is compatible with a respective type associated with each of the operands on the stack for all other execution paths that include the instruction; a program execution module for executing the verified program. - View Dependent Claims (70, 71, 72, 73, 74, 75, 76, 77, 78)
-
-
79. A method, comprising:
-
receiving from a source computer a program formed of low-level program code; verifying prior to execution that when an instruction of the program is executed that can be executed along more than one execution path, a number of operands on a stack associated with that instruction is identical regardless of the execution path taken to arrive at the instruction, and a type associated with each of the operands on the stack for a first execution path that includes the instruction is compatible with a respective type associated with each of the operands on the stack for all other execution paths that include the instruction; and executing the verified program. - View Dependent Claims (80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90)
-
-
91. A computer system, comprising:
-
memory for storing a program formed of low-level program code; a data processing unit for executing programs stored in the memory; a program verifier, stored in the memory and executed by the data processing unit; the program verifier including instructions for verifying prior to execution that when an instruction of the program is executed that can be executed along more than one execution path, a number of operands on a stack associated with that instruction is identical regardless of the execution path taken to arrive at the instruction, and a type associated with each of the operands on the stack for a first execution path that includes the instruction is compatible with a respective type associated with each of the operands for all other execution paths that include the instruction; and a program execution module for executing the verified program.
-
-
92. A computer system, comprising:
-
means for selectively connecting the computer system via a network to a sending computer to receive from the sending computer a program formed of low-level program code; memory for storing the program; a data processing unit for executing programs stored in the memory; a program verifier, stored in the memory and executed by the data processing unit, the program verifier including instructions for verifying prior to execution that when an instruction of the program is executed that can be executed along more than one execution path, a number of operands on a stack associated with that instruction is identical regardless of the execution path taken to arrive at the instruction, and a type associated with each of the operands on the stack for a first execution path that includes the instruction is compatible with a respective type associated with each of the operands for all other execution paths that include the instruction; and a program execution module for executing the verified program. - View Dependent Claims (93, 94, 95, 96, 97, 98, 99, 100, 101, 102)
-
Specification