public void emitType(final Type<?> value) { final MethodBuilder methodBuilder = this.methodBuilder; if (methodBuilder == null) { throw Error.bytecodeGeneratorNotOwnedByMethodBuilder(); } final int typeToken = methodBuilder.getDeclaringType().getTypeToken(value); emitLoadConstant(typeToken); }
public void emitMethod(final MethodBase value) { final MethodBuilder methodBuilder = this.methodBuilder; if (methodBuilder == null) { throw Error.bytecodeGeneratorNotOwnedByMethodBuilder(); } final int methodToken = methodBuilder.getDeclaringType().getMethodToken(value); emitLoadConstant(methodToken); }
public void emitThis() { if (methodBuilder == null) { throw Error.bytecodeGeneratorNotOwnedByMethodBuilder(); } if (methodBuilder.isStatic()) { throw Error.cannotLoadThisForStaticMethod(); } emitLoad(methodBuilder.getDeclaringType(), 0); }
@Override protected Type<?> makeGenericTypeCore(final TypeList typeArguments) { if (!isGenericTypeDefinition()) { throw Error.notGenericTypeDefinition(this); } return TypeBuilderInstantiation.makeGenericType(this, typeArguments); }
final void verifyNotGeneric() { if (isGenericMethod() && !isGenericMethodDefinition()) { throw Error.methodIsGeneric(); } }
void addLocalSymInfoToCurrentScope( final String name, final byte[] signature, final int slot, final int startOffset, final int endOffset) { final int i = getCurrentActiveScopeIndex(); if (_localSymInfos[i] == null) { _localSymInfos[i] = new LocalSymInfo(); } _localSymInfos[i].addLocalSymInfo(name, signature, slot, startOffset, endOffset); }
private int getLabelPosition(final Label label) { // Gets the position in the stream of a particular label. // Verifies that the label exists and that it has been given a value. final int index = label.getLabelValue(); if (index < 0 || index >= _labelCount) { throw Error.badLabel(); } if (_labelList[index] < 0) { throw Error.badLabelContent(); } return _labelList[index]; }
final void verifyNotCreated() { if (isCreated()) { throw Error.typeHasBeenCreated(); } }
public void emitType(final Type<?> value) { final MethodBuilder methodBuilder = this.methodBuilder; if (methodBuilder == null) { throw Error.bytecodeGeneratorNotOwnedByMethodBuilder(); } final int typeToken = methodBuilder.getDeclaringType().getTypeToken(value); emitLoadConstant(typeToken); }