public interface FrameModelVisitor<T>
Modifier and Type | Method and Description |
---|---|
T |
branch(Instruction i,
IBasicBlock target)
Handle a branch instruction.
|
T |
consumeAndProduceValue(Instruction i,
int consumeCount)
Handle an instruction that consumes value stack elements,
and then pushes a new value onto the stack.
|
T |
consumeValue(Instruction i,
int count)
Handle an instruction that consumes value stack elements.
|
T |
dup(Instruction i)
Duplicate the top of the stack.
|
T |
getlocal(Instruction i,
int idx)
Get a local variable, leaving its value on the stack.
|
T |
getScopeobject(Instruction i,
int idx)
Get a value from the scope stack.
|
T |
hasnext2(Instruction i)
Special-case the hasnext2 instruction.
|
void |
modifyLocal(Instruction i,
int idx)
Modify (i.e., increment, decrement, or kill)
a local variable.
|
T |
moveValueToScopeStack(Instruction i)
Move the top of the value stack to the top
of the scope stack.
|
T |
multiwayBranch(Instruction i,
Collection<IBasicBlock> targets)
Handle a multibranch instruction.
|
T |
noFrameEffect(Instruction i)
Handle an instruction that does not affect the frame.
|
T |
popscope(Instruction i)
Pop the top of the scope stack.
|
T |
produceValue(Instruction i)
Handle an instruction that pushes a value onto the stack.
|
T |
setlocal(Instruction i,
int idx)
Set a local variable, comsuming a value from the stack.
|
T |
swap(Instruction i)
Swap the two top values on the stack.
|
void |
visit(FrameModelEncoder encoder)
Begin a visit to a method body.
|
boolean |
visitBlock(IBasicBlock b)
Visit a new Block.
|
void |
visitEdge(IBasicBlock from,
IBasicBlock to)
Visit a control-flow edge from one Block to another.
|
void |
visitEnd()
Finish visiting a method body.
|
void |
visitEndBlock(IBasicBlock b)
End a visit to a block.
|
void visit(FrameModelEncoder encoder)
encoder
- - the FrameModelEncoder driving the visit.void visitEnd()
T noFrameEffect(Instruction i)
i
- - the Instruction.T consumeValue(Instruction i, int count)
i
- - the Instruction.count
- - the number of value stack elements consumed.T produceValue(Instruction i)
i
- - the Instruction.T consumeAndProduceValue(Instruction i, int consumeCount)
i
- - the Instruction.consumeCount
- - the number of value stack elements consumed.T branch(Instruction i, IBasicBlock target)
i
- - the Instruction.target
- - the Instruction's target. Instructions with
fall-through semantics also implicitly target the next Block.T multiwayBranch(Instruction i, Collection<IBasicBlock> targets)
i
- - the Instruction.targets
- - the Instruction's targets.T getlocal(Instruction i, int idx)
i
- - the Instruction.idx
- - the variable's index.T setlocal(Instruction i, int idx)
i
- - the Instruction.idx
- - the variable's index.void modifyLocal(Instruction i, int idx)
i
- - the Instruction.idx
- - the variable's index.T moveValueToScopeStack(Instruction i)
i
- - the Instruction.T popscope(Instruction i)
i
- - the Instruction.T getScopeobject(Instruction i, int idx)
i
- - the Instruction.idx
- - the index of the object in the scope stack.T hasnext2(Instruction i)
i
- - the Instruction.T dup(Instruction i)
i
- - the Instruction.T swap(Instruction i)
i
- - the Instruction.boolean visitBlock(IBasicBlock b)
b
- - the Block.void visitEndBlock(IBasicBlock b)
b
- - the Block. Must be the block passed
to the most recent visitBlock(b) call that returned true.void visitEdge(IBasicBlock from, IBasicBlock to)
Copyright © 2016 The Apache Software Foundation. All rights reserved.