org.jboss.byteman.rule.compiler
Class StackHeights

java.lang.Object
  extended by org.jboss.byteman.rule.compiler.StackHeights

public class StackHeights
extends java.lang.Object

container to track either the current or the maximum local variable count and stack height while generating compiled code for a rule


Field Summary
 int localCount
          number of local variable slots
 int stackCount
          number of stack slots
 
Constructor Summary
StackHeights()
          create withinitial counts 0
StackHeights(StackHeights toCopy)
          create a copy with the same coutns as the original
 
Method Summary
 StackHeights addLocalCount(int increment)
          increment the local count and return this to allow chaining
 StackHeights addStackCount(int increment)
          increment the stack count and return this to allow chaining
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stackCount

public int stackCount
number of stack slots


localCount

public int localCount
number of local variable slots

Constructor Detail

StackHeights

public StackHeights()
create withinitial counts 0


StackHeights

public StackHeights(StackHeights toCopy)
create a copy with the same coutns as the original

Parameters:
toCopy -
Method Detail

addStackCount

public StackHeights addStackCount(int increment)
                           throws CompileException
increment the stack count and return this to allow chaining

Parameters:
increment - the amount ot add to stackCount (can be negative)
Returns:
this
Throws:
CompileException - if the stack count goes negative

addLocalCount

public StackHeights addLocalCount(int increment)
                           throws CompileException
increment the local count and return this to allow chaining

Parameters:
increment - the amount ot add to localCount (can be negative)
Returns:
this
Throws:
CompileException - if the local count goes negative