Package org.jboss.byteman.rule.compiler
Class StackHeights
java.lang.Object
org.jboss.byteman.rule.compiler.StackHeights
container to track either the current or the maximum local variable count and stack height
while generating compiled code for a rule
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
number of local variable slotsint
number of stack slots -
Constructor Summary
ConstructorsConstructorDescriptioncreate withinitial counts 0StackHeights
(StackHeights toCopy) create a copy with the same counts as the original -
Method Summary
Modifier and TypeMethodDescriptionaddLocalCount
(int increment) increment the local count and return this to allow chainingaddStackCount
(int increment) increment the stack count and return this to allow chaining
-
Field Details
-
stackCount
public int stackCountnumber of stack slots -
localCount
public int localCountnumber of local variable slots
-
-
Constructor Details
-
StackHeights
public StackHeights()create withinitial counts 0 -
StackHeights
create a copy with the same counts as the original- Parameters:
toCopy
- the StackHeights instance to copy
-
-
Method Details
-
addStackCount
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
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
-