public void emitStore(final LocalBuilder local) { VerifyArgument.notNull(local, "local"); if (local.getMethodBuilder() != methodBuilder) { throw Error.unmatchedLocal(); } if (local.startOffset < 0) { local.startOffset = offset(); } emitStore( local.getLocalType(), translateLocal(local.getLocalIndex()) ); local.endOffset = offset(); }
l.getName(), l.getLocalType(), builder.generator.translateLocal(l.getLocalIndex()), l.startOffset < 0 ? 0 : l.startOffset, l.endOffset < 0 ? builder.generator.offset() : l.endOffset
l.getName(), l.getLocalType(), position++, l.startOffset < 0 ? 0 : l.startOffset,
public void increment(final LocalBuilder local, final int delta) { VerifyArgument.notNull(local, "local"); final int localIndex = translateLocal(local.getLocalIndex()); if (local.startOffset < 0) { local.startOffset = offset(); } if (localIndex < MAX_BYTE && delta <= Byte.MAX_VALUE && delta >= Byte.MIN_VALUE) { emit(OpCode.IINC); emitByteOperand(localIndex); emitByteOperand(delta); } else { emit(OpCode.IINC_W); emitShortOperand(localIndex); emitShortOperand(delta); } local.endOffset = offset(); }
public LocalBuilder declareLocal(final String name, final Type<?> localType) { VerifyArgument.notNull(localType, "localType"); // Declare a local of type "local". The current active lexical scope // will be the scope that local will live. final LocalBuilder localBuilder; final MethodBuilder methodBuilder = this.methodBuilder; if (methodBuilder == null) { throw Error.bytecodeGeneratorNotOwnedByMethodBuilder(); } if (methodBuilder.isTypeCreated()) { // cannot change method after its containing type has been created throw Error.typeHasBeenCreated(); } if (methodBuilder.isFinished()) { throw Error.methodIsFinished(); } localBuilder = new LocalBuilder(localCount, name, localType, methodBuilder); localCount++; if (locals == null) { locals = new LocalBuilder[DefaultLabelArraySize]; } else if (locals.length < localCount) { locals = enlargeArray(locals); } locals[localCount - 1] = localBuilder; return localBuilder; }
final int translateLocal(final int localIndex) { int index = 0; if (methodBuilder != null) { index += translateParameter(methodBuilder.parameterBuilders.length); } for (int i = 0; i < localIndex; i++) { final TypeKind kind = locals[i].getLocalType().getKind(); index += kind == TypeKind.LONG || kind == TypeKind.DOUBLE ? 2 : 1; } return index; }
" (" + ((LocalBuilder) local).getName() + "): " + local.getLocalType().getBriefDescription();
l.getName(), l.getLocalType(), position++, l.startOffset < 0 ? 0 : l.startOffset,
public void increment(final LocalBuilder local, final int delta) { VerifyArgument.notNull(local, "local"); final int localIndex = translateLocal(local.getLocalIndex()); if (local.startOffset < 0) { local.startOffset = offset(); } if (localIndex < MAX_BYTE && delta <= Byte.MAX_VALUE && delta >= Byte.MIN_VALUE) { emit(OpCode.IINC); emitByteOperand(localIndex); emitByteOperand(delta); } else { emit(OpCode.IINC_W); emitShortOperand(localIndex); emitShortOperand(delta); } local.endOffset = offset(); }
localBuilder = new LocalBuilder(localCount, name, localType, methodBuilder);
for (int i = 0; i < mb.generator.localCount; i++) { final LocalBuilder local = mb.generator.locals[i]; _frames.push(new VerifierFrame(FrameType.LOCAL_VARIABLE, local.getLocalType(), local)); local.getLocalType().accept(this, scope); _frames.pop();
public void emitLoad(final LocalBuilder local) { VerifyArgument.notNull(local, "local"); if (local.getMethodBuilder() != methodBuilder) { throw Error.unmatchedLocal(); } if (local.startOffset < 0) { local.startOffset = offset(); } emitLoad( local.getLocalType(), translateLocal(local.getLocalIndex()) ); local.endOffset = offset(); }
public void increment(final LocalBuilder local, final int delta) { VerifyArgument.notNull(local, "local"); final int localIndex = translateLocal(local.getLocalIndex()); if (local.startOffset < 0) { local.startOffset = offset(); } if (localIndex < MAX_BYTE && delta <= Byte.MAX_VALUE && delta >= Byte.MIN_VALUE) { emit(OpCode.IINC); emitByteOperand(localIndex); emitByteOperand(delta); } else { emit(OpCode.IINC_W); emitShortOperand(localIndex); emitShortOperand(delta); } local.endOffset = offset(); }
localBuilder = new LocalBuilder(localCount, name, localType, methodBuilder);
public void emitLoad(final LocalBuilder local) { VerifyArgument.notNull(local, "local"); if (local.getMethodBuilder() != methodBuilder) { throw Error.unmatchedLocal(); } if (local.startOffset < 0) { local.startOffset = offset(); } emitLoad( local.getLocalType(), translateLocal(local.getLocalIndex()) ); local.endOffset = offset(); }
public void emitLoad(final LocalBuilder local) { VerifyArgument.notNull(local, "local"); if (local.getMethodBuilder() != methodBuilder) { throw Error.unmatchedLocal(); } if (local.startOffset < 0) { local.startOffset = offset(); } emitLoad( local.getLocalType(), translateLocal(local.getLocalIndex()) ); local.endOffset = offset(); }
public void emitStore(final LocalBuilder local) { VerifyArgument.notNull(local, "local"); if (local.getMethodBuilder() != methodBuilder) { throw Error.unmatchedLocal(); } if (local.startOffset < 0) { local.startOffset = offset(); } emitStore( local.getLocalType(), translateLocal(local.getLocalIndex()) ); local.endOffset = offset(); }
public void emitStore(final LocalBuilder local) { VerifyArgument.notNull(local, "local"); if (local.getMethodBuilder() != methodBuilder) { throw Error.unmatchedLocal(); } if (local.startOffset < 0) { local.startOffset = offset(); } emitStore( local.getLocalType(), translateLocal(local.getLocalIndex()) ); local.endOffset = offset(); }