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

public final Class CodeImpl

extends BoundCodeAttribute
implements LabelContext
Class Inheritance
All Implemented Interfaces
jdk.internal.classfile.impl.LabelContext
Imports
java.lang.classfile.*, java.lang.classfile.attribute.CodeAttribute, .RuntimeInvisibleTypeAnnotationsAttribute, .RuntimeVisibleTypeAnnotationsAttribute, .StackMapTableAttribute, .UnknownAttribute, java.lang.classfile.constantpool.ClassEntry, java.lang.classfile.instruction.*, java.util.ArrayList, .Collections, .List, .Objects, .Optional, java.util.function.Consumer

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Field Summary

Modifier and TypeField and Description
pack-priv List<Attribute<?>>
pack-priv List<ExceptionCatch>
pack-priv boolean
pack-priv LabelImpl[]
pack-priv int[]
pack-priv static final Instruction[]
Inherited from jdk.internal.classfile.impl.BoundAttribute.BoundCodeAttribute:
attributePoscodeEndcodeLengthcodeStartenclosingMethodexceptionHandlerCntexceptionHandlerPos

Constructor Summary

AccessConstructor and Description
public
CodeImpl(AttributedElement enclosing, ClassReader reader, AttributeMapper<CodeAttribute> mapper, int payloadStart)

Method Summary

Modifier and TypeMethod and Description
private int
public List<Attribute<?>>
attributes()

Implements java.lang.classfile.AttributedElement.attributes.

Returns the attributes of this structure.

private Instruction
bcToInstruction(int bc, int pos)

public boolean
compareCodeBytes(BufWriterImpl buf, int offset, int len)

public List<ExceptionCatch>
exceptionHandlers()

Implements java.lang.classfile.CodeModel.exceptionHandlers.

Returns the exception table of the method.

public void
forEach(Consumer<? super CodeElement> consumer)

Implements java.lang.classfile.CompoundElement.forEach.

Invokes the provided handler with each member element in this compound element.

private void
private void
private void
public Label
private void
private void
inflateLabel(int bci)

private void
private void
private void
public void
public int
public Label
public Optional<MethodModel>
parent()

Implements java.lang.classfile.CodeModel.parent.

Returns the enclosing method, if known.

public void
public String
toString()

Overrides jdk.internal.classfile.impl.BoundAttribute.toString.

Returns a string representation of the object.

public void
Inherited from jdk.internal.classfile.impl.BoundAttribute.BoundCodeAttribute:
codeArraycodeLengthmaxLocalsmaxStack

Field Detail

attributesback to summary
pack-priv List<Attribute<?>> attributes
exceptionTableback to summary
pack-priv List<ExceptionCatch> exceptionTable
inflatedback to summary
pack-priv boolean inflated
labelsback to summary
pack-priv LabelImpl[] labels
lineNumbersback to summary
pack-priv int[] lineNumbers
SINGLETON_INSTRUCTIONSback to summary
pack-priv static final Instruction[] SINGLETON_INSTRUCTIONS

Constructor Detail

CodeImplback to summary
public CodeImpl(AttributedElement enclosing, ClassReader reader, AttributeMapper<CodeAttribute> mapper, int payloadStart)

Method Detail

adjustForObjectOrUninitializedback to summary
private int adjustForObjectOrUninitialized(int bci)
attributesback to summary
public List<Attribute<?>> attributes()

Implements java.lang.classfile.AttributedElement.attributes.

Doc from java.lang.classfile.AttributedElement.attributes.

Returns the attributes of this structure.

Annotations
@Override
bcToInstructionback to summary
private Instruction bcToInstruction(int bc, int pos)
compareCodeBytesback to summary
public boolean compareCodeBytes(BufWriterImpl buf, int offset, int len)
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
forEachback to summary
public void forEach(Consumer<? super CodeElement> consumer)

Implements java.lang.classfile.CompoundElement.forEach.

Doc from java.lang.classfile.CompoundElement.forEach.

Invokes the provided handler with each member element in this compound element.

Annotations
@Override
generateCatchTargetsback to summary
private void generateCatchTargets(Consumer<? super CodeElement> consumer)
generateDebugElementsback to summary
private void generateDebugElements(Consumer<? super CodeElement> consumer)
generateUserAttributesback to summary
private void generateUserAttributes(Consumer<? super CodeElement> consumer)
getLabelback to summary
public Label getLabel(int bci)

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

Annotations
@Override
inflateJumpTargetsback to summary
private void inflateJumpTargets()
inflateLabelback to summary
private void inflateLabel(int bci)
inflateLineNumbersback to summary
private void inflateLineNumbers()
inflateMetadataback to summary
private void inflateMetadata()
inflateTypeAnnotationsback to summary
private void inflateTypeAnnotations()
iterateExceptionHandlersback to summary
public void iterateExceptionHandlers(CodeImpl.ExceptionHandlerAction a)
labelToBciback to summary
public int labelToBci(Label label)

Implements jdk.internal.classfile.impl.LabelContext.labelToBci, java.lang.classfile.attribute.CodeAttribute.labelToBci.

Doc from java.lang.classfile.attribute.CodeAttribute.labelToBci.

Returns the position of the label in the codeArray. The label represents a cursor pointing at immediately before the returned index into the code array.

Annotations
@Override
newLabelback to summary
public Label newLabel()

Implements jdk.internal.classfile.impl.LabelContext.newLabel.

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
setLabelTargetback to summary
public void setLabelTarget(Label label, int bci)

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

Annotations
@Override
toStringback to summary
public String toString()

Overrides jdk.internal.classfile.impl.BoundAttribute.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(BufWriterImpl buf)

Overrides jdk.internal.classfile.impl.BoundAttribute.writeTo.

Implements jdk.internal.classfile.impl.Util.Writable.writeTo.

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

public Interface CodeImpl.ExceptionHandlerAction


Method Summary

Modifier and TypeMethod and Description
public void
accept(int start, int end, int handler, int catchTypeIndex)

Method Detail

acceptback to summary
public void accept(int start, int end, int handler, int catchTypeIndex)