FileDocCategorySizeDatePackage
VMOp.javaAPI DocGlassfish v2 API27581Fri May 04 22:34:28 BST 2007com.sun.jdo.api.persistence.enhancer.classfile

VMOp

public class VMOp extends Object implements VMConstants
Description of the VM opcodes

Fields Summary
private int
opcodeValue
private String
opcodeName
private int
stackArgs
private int
stackResults
private String
stackArgTypes
private String
stackResultTypes
static VMOp[]
ops
Constructors Summary
public VMOp(int theOpcode, String theOpcodeName, int nArgs, int nResults, String argDescr, String resultDescr)
constructor for a VMOp

    opcodeValue = theOpcode;
    opcodeName = theOpcodeName;
    stackArgs = nArgs;
    stackResults = nResults;
    stackArgTypes = argDescr;
    stackResultTypes = resultDescr;
  
Methods Summary
public final java.lang.StringargTypes()
Return the type descriptor for the stack arguments to the operation.

    return stackArgTypes;
  
private static voidcheck()
Check that each entry in the ops array has a valid VMOp entry

//NOI18N

                  
      
    for (int i=0; i<=opc_jsr_w; i++) {
      VMOp op = ops[i];
      if (op == null)
          throw new InsnError ("null VMOp for " + i);//NOI18N
      if (op.opcode() != i)
          throw new InsnError ("bad opcode for " + i);//NOI18N

      if (1 == 0) {
	/* check arg/result data */
	checkTypes(op.argTypes(), op.nStackArgs(), op);
	checkTypes(op.resultTypes(), op.nStackResults(), op);
      }
    }
  
private static voidcheckTypes(java.lang.String types, int n, com.sun.jdo.api.persistence.enhancer.classfile.VMOp op)

    for (int i=0; i<types.length(); i++) {
      char c = types.charAt(i);
      if (c == '?")
	return;
      if (c == 'J" || c == 'X" || c == 'D")
	n -= 2;
      else
	n -= 1;
    }
    if (n != 0)
        throw new InsnError ("Bad arg/result for VMOp " + op.opcodeName);//NOI18N
  
public final intnStackArgs()
Return the number of words of stack arguments expected by this operation. If the number is not a fixed value, return -1;

    return stackArgs;
  
public final intnStackResults()
Return the number of words of stack results produced by this operation. If the number is not a fixed value, return -1;

    return stackResults;
  
public final java.lang.Stringname()
Return the opcode name

    return opcodeName;
  
public final intopcode()
Return the opcode value

    return opcodeValue;
  
public final java.lang.StringresultTypes()
Return the type descriptor for the stack results of the operation.

    return stackResultTypes;