mjc

org.multijava.util.classfile
Class CodeEnv

java.lang.Object
  extended byorg.multijava.util.classfile.CodeEnv

final class CodeEnv
extends Object

This class represent the code environement during control flow This allow to compute the amount of stack consumed, to check if instructions are reached and so on


Field Summary
private  CodeInfo codeInfo
           
private  InstructionHandle methodStart
           
 
Constructor Summary
private CodeEnv(CodeInfo codeInfo)
          Constructs a new CodeEnv structure.
 
Method Summary
static void check(CodeInfo codeInfo)
          Checks the specified CodeInfo structure and computes maxStack and maxLocals.
(package private)  void checkExecutionPath(InstructionHandle handle, int curStack)
          Verifies execution path(s) starting at specified instruction.
private  void checkExecutionPaths()
          Verifies all possible execution path(s).
private  void computeCodeLength()
          Computes size and sets address of each instruction in the code array.
private  void computeStackAndLocals()
          Computes max stack and max locals.
(package private)  void dumpCode()
           
private  void installInstructionHandles()
          Install handles around instructions.
private  void removeInstructionHandles()
          Replaces handles by associated instructions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

codeInfo

private final CodeInfo codeInfo

methodStart

private InstructionHandle methodStart
Constructor Detail

CodeEnv

private CodeEnv(CodeInfo codeInfo)
Constructs a new CodeEnv structure.

Method Detail

check

public static void check(CodeInfo codeInfo)
                  throws ClassFileFormatException
Checks the specified CodeInfo structure and computes maxStack and maxLocals.

Throws:
ClassFileFormatException

checkExecutionPaths

private final void checkExecutionPaths()
                                throws ClassFileFormatException
Verifies all possible execution path(s).

Throws:
ClassFileFormatException

checkExecutionPath

final void checkExecutionPath(InstructionHandle handle,
                              int curStack)
                       throws ClassFileFormatException
Verifies execution path(s) starting at specified instruction.

Parameters:
handle - the handle of the first instruction
curStack - the stack height at the beginning of the execution of the instruction
Throws:
ClassFileFormatException - a problem was detected

computeCodeLength

private final void computeCodeLength()
Computes size and sets address of each instruction in the code array.


computeStackAndLocals

private final void computeStackAndLocals()
Computes max stack and max locals.


installInstructionHandles

private void installInstructionHandles()
Install handles around instructions.


removeInstructionHandles

private void removeInstructionHandles()
Replaces handles by associated instructions.


dumpCode

void dumpCode()

mjc

mjc is Copyright (C) 2000-2004 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. mjc is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.