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.