use of org.apache.tapestry5.internal.plastic.InstructionBuilderState.LVInfo in project tapestry-5 by apache.
the class InstructionBuilderImpl method increment.
@Override
public InstructionBuilder increment(LocalVariable variable) {
check();
LVInfo info = state.locals.get(variable);
v.visitIincInsn(info.offset, 1);
return this;
}
use of org.apache.tapestry5.internal.plastic.InstructionBuilderState.LVInfo in project tapestry-5 by apache.
the class InstructionBuilderState method startVariable.
LocalVariable startVariable(String type) {
Label start = newLabel();
Label end = new Label();
PrimitiveType ptype = PrimitiveType.getByName(type);
int width = (ptype != null && ptype.isWide()) ? 2 : 1;
int loadOpcode = ptype == null ? ALOAD : ptype.loadOpcode;
int storeOpcode = ptype == null ? ASTORE : ptype.storeOpcode;
LVInfo info = new LVInfo(width, localIndex, loadOpcode, storeOpcode, end);
localIndex += width;
LocalVariable var = new LocalVariableImpl(type);
locals.put(var, info);
visitor.visitLocalVariable(nextVarName(), nameCache.toDesc(type), null, start, end, info.offset);
return var;
}
Aggregations