×

System and method for pre-verification of stack usage in bytecode program loops

  • US 6,704,923 B1
  • Filed: 02/28/2000
  • Issued: 03/09/2004
  • Est. Priority Date: 12/20/1994
  • Status: Expired due to Fees
First Claim
Patent Images

1. A method of operating a computer system, the steps of the method comprising:

  • (A) storing a program in a memory, the program including a sequence of bytecodes, where each of a multiplicity of the bytecodes represents an operation on data of a specific data type;

    each bytecode having associated data type restrictions on the data type of data to be manipulated by that bytecode;

    (B) prior to execution of the program, preprocessing the program by;

    (B1) determining the state of a virtual stack associated with the program before execution of each bytecode in the program, the virtual stack state storing data type values for operands that would be stored in an operand stack during execution of the program;

    (B2) determining whether execution of any bytecode in the program would violate the data type restrictions for that bytecode and generating a program fault signal when execution of any bytecode in the program would violate the data type restrictions for that bytecode; and

    (B3) determining whether execution of any loop in the program would result in a net addition or deletion of operands to the operand stack and generating a program fault signal when execution of any loop in the program would produce a net addition or deletion of operands to the operand stack;

    (C) when the preprocessing of the program results in the generation of no program fault signals, enabling execution of the program; and

    (D) when the preprocessing of the program results in the generation of a program fault, preventing execution of the program;

    wherein step (B) includes determining, whenever a location in the program can be immediately preceded in execution by two or more distinct bytecodes in the program, at least one of the two or more distinct bytecodes in the program comprising a jump/branch bytecode, whether the states of the virtual stack subsequent to execution of each of the two or more distinct bytecodes in the program are compatible with each other, and generating a program fault if the virtual stack states are not compatible.

View all claims
  • 0 Assignments
Timeline View
Assignment View
    ×
    ×