Search in sources :

Example 1 with LVInfo

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;
}
Also used : LVInfo(org.apache.tapestry5.internal.plastic.InstructionBuilderState.LVInfo)

Example 2 with LVInfo

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;
}
Also used : Label(org.apache.tapestry5.internal.plastic.asm.Label) LocalVariable(org.apache.tapestry5.plastic.LocalVariable)

Aggregations

LVInfo (org.apache.tapestry5.internal.plastic.InstructionBuilderState.LVInfo)1 Label (org.apache.tapestry5.internal.plastic.asm.Label)1 LocalVariable (org.apache.tapestry5.plastic.LocalVariable)1