Package org.jboss.byteman.rule.compiler
Class StackHeights
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description int
localCount
number of local variable slotsint
stackCount
number of stack slots
-
Constructor Summary
Constructors Constructor Description StackHeights()
create withinitial counts 0StackHeights(StackHeights toCopy)
create a copy with the same counts as the original
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StackHeights
addLocalCount(int increment)
increment the local count and return this to allow chainingStackHeights
addStackCount(int increment)
increment the stack count and return this to allow chaining
-
-
-
Constructor Detail
-
StackHeights
public StackHeights()
create withinitial counts 0
-
StackHeights
public StackHeights(StackHeights toCopy)
create a copy with the same counts as the original- Parameters:
toCopy
- the StackHeights instance to copy
-
-
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
-
-