APIdia Launch Partner
Top Inners Fields Constructors Methods
jdk.internal.classfile.impl

public final Class BufferedCodeBuilder

extends Object
implements TerminalCodeBuilder
Class Inheritance
All Implemented Interfaces
jdk.internal.classfile.impl.TerminalCodeBuilder, jdk.internal.classfile.impl.LabelContext, java.lang.classfile.CodeBuilder, java.lang.classfile.ClassFileBuilder, java.util.function.Consumer
Imports
java.lang.classfile.CodeBuilder, .CodeElement, .CodeModel, .Label, .MethodModel, .TypeKind, java.lang.classfile.constantpool.ConstantPoolBuilder, java.lang.classfile.instruction.ExceptionCatch, java.util.ArrayList, .List, .Optional, java.util.function.Consumer

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class

Field Summary

Modifier and TypeField and Description
private final SplitConstantPool
private final ClassFileImpl
private final List<CodeElement>
private final LabelImpl
private boolean
private int
private final MethodInfo
private final LabelImpl

Constructor Summary

AccessConstructor and Description
public
BufferedCodeBuilder(MethodInfo methodInfo, SplitConstantPool constantPool, ClassFileImpl context, CodeModel original)

Method Summary

Modifier and TypeMethod and Description
public int
allocateLocal(TypeKind typeKind)

Implements java.lang.classfile.CodeBuilder.allocateLocal.

Returns the local variable slot of a fresh local variable.

public ConstantPoolBuilder
constantPool()

Implements java.lang.classfile.ClassFileBuilder.constantPool.

Returns the constant pool builder associated with this builder.

public int
public Label
endLabel()

Implements java.lang.classfile.CodeBuilder.endLabel.

Returns the label associated with the end of the current block.

public Label
public int
public Label
public int
parameterSlot(int paramNo)

Implements java.lang.classfile.CodeBuilder.parameterSlot.

Returns the local variable slot associated with the specified parameter.

public int
receiverSlot()

Implements java.lang.classfile.CodeBuilder.receiverSlot.

Returns the local variable slot associated with the receiver.

public BufferedCodeBuilder
run(Consumer<? super CodeBuilder> handler)

public void
public Label
startLabel()

Implements java.lang.classfile.CodeBuilder.startLabel.

Returns the label associated with the beginning of the current block.

public CodeModel
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public CodeBuilder
with(CodeElement element)

Implements java.lang.classfile.ClassFileBuilder.with.

Integrates the member element into the structure being built.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

constantPoolback to summary
private final SplitConstantPool constantPool
contextback to summary
private final ClassFileImpl context
elementsback to summary
private final List<CodeElement> elements
endLabelback to summary
private final LabelImpl endLabel
finishedback to summary
private boolean finished
maxLocalsback to summary
private int maxLocals
methodInfoback to summary
private final MethodInfo methodInfo
startLabelback to summary
private final LabelImpl startLabel

Constructor Detail

BufferedCodeBuilderback to summary
public BufferedCodeBuilder(MethodInfo methodInfo, SplitConstantPool constantPool, ClassFileImpl context, CodeModel original)

Method Detail

allocateLocalback to summary
public int allocateLocal(TypeKind typeKind)

Implements java.lang.classfile.CodeBuilder.allocateLocal.

Doc from java.lang.classfile.CodeBuilder.allocateLocal.

Returns the local variable slot of a fresh local variable. This method makes reasonable efforts to determine which slots are in use and which are not. When transforming a method, fresh locals begin at the maxLocals of the original method. For a method being built directly, fresh locals begin after the last parameter slot.

If the current code builder is a BlockCodeBuilder, at the end of the block, locals are reset to their value at the beginning of the block.

Annotations
@Override
constantPoolback to summary
public ConstantPoolBuilder constantPool()

Implements java.lang.classfile.ClassFileBuilder.constantPool.

Doc from java.lang.classfile.ClassFileBuilder.constantPool.

Returns the constant pool builder associated with this builder.

Annotations
@Override
curTopLocalback to summary
public int curTopLocal()

Implements jdk.internal.classfile.impl.TerminalCodeBuilder.curTopLocal.

endLabelback to summary
public Label endLabel()

Implements java.lang.classfile.CodeBuilder.endLabel.

Doc from java.lang.classfile.CodeBuilder.endLabel.

Returns the label associated with the end of the current block. If this builder is not a "block" builder, such as those provided by block(Consumer) or ifThenElse(Consumer, Consumer), the current block will be the entire method body.

Annotations
@Override
getLabelback to summary
public Label getLabel(int bci)

Implements jdk.internal.classfile.impl.LabelContext.getLabel.

Annotations
@Override
labelToBciback to summary
public int labelToBci(Label label)

Implements jdk.internal.classfile.impl.LabelContext.labelToBci.

Annotations
@Override
newLabelback to summary
public Label newLabel()

Implements java.lang.classfile.CodeBuilder.newLabel, jdk.internal.classfile.impl.LabelContext.newLabel.

Doc from java.lang.classfile.CodeBuilder.newLabel.

Returns a fresh unbound label. The label can be bound with labelBinding.

Annotations
@Override
parameterSlotback to summary
public int parameterSlot(int paramNo)

Implements java.lang.classfile.CodeBuilder.parameterSlot.

Doc from java.lang.classfile.CodeBuilder.parameterSlot.

Returns the local variable slot associated with the specified parameter. The returned value is adjusted for the receiver slot (if the method is an instance method) and for the requirement that long and double values require two slots.

Annotations
@Override
receiverSlotback to summary
public int receiverSlot()

Implements java.lang.classfile.CodeBuilder.receiverSlot.

Doc from java.lang.classfile.CodeBuilder.receiverSlot.

Returns the local variable slot associated with the receiver.

Annotations
@Override
runback to summary
public BufferedCodeBuilder run(Consumer<? super CodeBuilder> handler)
setLabelTargetback to summary
public void setLabelTarget(Label label, int bci)

Implements jdk.internal.classfile.impl.LabelContext.setLabelTarget.

Annotations
@Override
startLabelback to summary
public Label startLabel()

Implements java.lang.classfile.CodeBuilder.startLabel.

Doc from java.lang.classfile.CodeBuilder.startLabel.

Returns the label associated with the beginning of the current block. If this builder is not a "block" builder, such as those provided by block(Consumer) or ifThenElse(Consumer, Consumer), the current block will be the entire method body.

Annotations
@Override
toModelback to summary
public CodeModel toModel()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
withback to summary
public CodeBuilder with(CodeElement element)

Implements java.lang.classfile.ClassFileBuilder.with.

Doc from java.lang.classfile.ClassFileBuilder.with.

Integrates the member element into the structure being built.

Annotations
@Override
jdk.internal.classfile.impl back to summary

public final Class BufferedCodeBuilder.Model

extends AbstractUnboundModel<CodeElement>
implements CodeModel
Class Inheritance
All Implemented Interfaces
java.lang.classfile.CodeModel, java.lang.classfile.MethodElement, java.lang.classfile.ClassFileElement, java.lang.classfile.AttributedElement, java.lang.classfile.CompoundElement, java.lang.Iterable

Field Summary

Inherited from jdk.internal.classfile.impl.AbstractUnboundModel:
elements

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv int
public List<ExceptionCatch>
exceptionHandlers()

Implements java.lang.classfile.CodeModel.exceptionHandlers.

Returns the exception table of the method.

public Optional<MethodModel>
parent()

Implements java.lang.classfile.CodeModel.parent.

Returns the enclosing method, if known.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
Inherited from jdk.internal.classfile.impl.AbstractUnboundModel:
attributeselementListelementStreamforEach

Constructor Detail

Modelback to summary
private Model()

Method Detail

curTopLocalback to summary
pack-priv int curTopLocal()
exceptionHandlersback to summary
public List<ExceptionCatch> exceptionHandlers()

Implements java.lang.classfile.CodeModel.exceptionHandlers.

Doc from java.lang.classfile.CodeModel.exceptionHandlers.

Returns the exception table of the method. The exception table is also modeled by ExceptionCatch elements in the streaming view.

Annotations
@Override
parentback to summary
public Optional<MethodModel> parent()

Implements java.lang.classfile.CodeModel.parent.

Doc from java.lang.classfile.CodeModel.parent.

Returns the enclosing method, if known.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
writeToback to summary
public void writeTo(DirectMethodBuilder builder)

Overrides jdk.internal.classfile.impl.AbstractElement.writeTo.

Annotations
@Override