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

public final Class BlockCodeBuilderImpl

extends NonterminalCodeBuilder
implements BlockCodeBuilder
Class Inheritance
All Implemented Interfaces
java.lang.classfile.CodeBuilder.BlockCodeBuilder, java.lang.classfile.CodeBuilder, java.lang.classfile.ClassFileBuilder, java.util.function.Consumer
Imports
java.lang.classfile.CodeBuilder, .CodeElement, .Instruction, .Label, .TypeKind, java.lang.classfile.instruction.LabelTarget, java.util.Objects

Field Summary

Modifier and TypeField and Description
private final Label
private final Label
private boolean
private boolean
private final Label
private int
private int
Inherited from jdk.internal.classfile.impl.NonterminalCodeBuilder:
parentterminal

Constructor Summary

AccessConstructor and Description
public

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 Label
breakLabel()

Implements java.lang.classfile.CodeBuilder.BlockCodeBuilder.breakLabel.

Returns the label locating where control is passed back to the parent block.

public void
end()

public Label
endLabel()

Implements java.lang.classfile.CodeBuilder.endLabel.

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

public boolean
public boolean
public void
public Label
startLabel()

Implements java.lang.classfile.CodeBuilder.startLabel.

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

private int
public CodeBuilder
with(CodeElement element)

Implements java.lang.classfile.ClassFileBuilder.with.

Integrates the member element into the structure being built.

Inherited from jdk.internal.classfile.impl.NonterminalCodeBuilder:
constantPoolfindTerminalnewLabelparameterSlotreceiverSlot

Field Detail

breakLabelback to summary
private final Label breakLabel
endLabelback to summary
private final Label endLabel
hasInstructionsback to summary
private boolean hasInstructions
reachableback to summary
private boolean reachable
startLabelback to summary
private final Label startLabel
terminalMaxLocalsback to summary
private int terminalMaxLocals
topLocalback to summary
private int topLocal

Constructor Detail

BlockCodeBuilderImplback to summary
public BlockCodeBuilderImpl(CodeBuilder parent, Label breakLabel)

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
breakLabelback to summary
public Label breakLabel()

Implements java.lang.classfile.CodeBuilder.BlockCodeBuilder.breakLabel.

Doc from java.lang.classfile.CodeBuilder.BlockCodeBuilder.breakLabel.

Returns the label locating where control is passed back to the parent block. A branch to this label "break"'s out of the current block.

If the last instruction in this block does not lead to the break label, Class-File API may append instructions to target the "break" label to the built block.

Annotations
@Override
endback to summary
public void end()
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
isEmptyback to summary
public boolean isEmpty()
reachableback to summary
public boolean reachable()
startback to summary
public void start()
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
topLocalback to summary
private int topLocal(CodeBuilder parent)
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