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

public final Class SplitConstantPool

extends Object
implements ConstantPoolBuilder
Class Inheritance
All Implemented Interfaces
java.lang.classfile.constantpool.ConstantPoolBuilder, java.lang.classfile.constantpool.ConstantPool, java.lang.Iterable
Imports
java.lang.classfile.Attributes, .BootstrapMethodEntry, .ClassReader, java.lang.classfile.attribute.BootstrapMethodsAttribute, java.lang.classfile.constantpool.*, java.lang.constant.ClassDesc, .DynamicCallSiteDesc, .MethodTypeDesc, java.util.Arrays, .List

Field Summary

Modifier and TypeField and Description
private EntryMap
private int
private boolean
private EntryMap
private BootstrapMethodEntryImpl[]
private PoolEntry[]
private final ClassReaderImpl
private final int
private final int
private int

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
private static ConstantPoolException
badCP(int index)

public int
bootstrapMethodCount()

Implements java.lang.classfile.constantpool.ConstantPool.bootstrapMethodCount.

Returns the number of entries in the bootstrap method table.

public BootstrapMethodEntryImpl
bootstrapMethodEntry(int index)

Implements java.lang.classfile.constantpool.ConstantPool.bootstrapMethodEntry.

Returns the BootstrapMethodEntry at the specified index within the bootstrap method table.

public BootstrapMethodEntry
private EntryMap
public boolean
canWriteDirect(ConstantPool other)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.canWriteDirect.

Returns true if the index of any entry in the given constant pool refers to the same entry in this builder.

public AbstractPoolEntry.ClassEntryImpl
pack-priv AbstractPoolEntry.ClassEntryImpl
public ClassEntry
classEntry(ClassDesc cd)

Overrides default java.lang.classfile.constantpool.ConstantPoolBuilder.classEntry.

Returns a ClassEntry describing the same reference type as the provided ClassDesc.

private AbstractPoolEntry.ClassEntryImpl
pack-priv AbstractPoolEntry.ClassEntryImpl
public ConstantDynamicEntry
public DoubleEntry
doubleEntry(double value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.doubleEntry.

Returns a DoubleEntry describing the provided value.

public PoolEntry
entryByIndex(int index)

Implements java.lang.classfile.constantpool.ConstantPool.entryByIndex.

Returns the entry at the specified index.

public <T extends PoolEntry> T
entryByIndex(int index, Class<T> cls)

Implements java.lang.classfile.constantpool.ConstantPool.entryByIndex.

Returns the entry of a given type at the specified index.

public FieldRefEntry
private DoubleEntry
findDoubleEntry(double val)

private <T extends AbstractPoolEntry> AbstractPoolEntry
findEntry(int tag, T ref1)

private <T extends AbstractPoolEntry, U extends AbstractPoolEntry> AbstractPoolEntry
findEntry(int tag, T ref1, U ref2)

private FloatEntry
findFloatEntry(float val)

private IntegerEntry
findIntEntry(int val)

private LongEntry
findLongEntry(long val)

public FloatEntry
floatEntry(float value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.floatEntry.

Returns a FloatEntry describing the provided value.

private void
public IntegerEntry
intEntry(int value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.intEntry.

Returns an IntegerEntry describing the provided value.

public InterfaceMethodRefEntry
private <E extends PoolEntry> E
internalAdd(E cpi)

private <E extends PoolEntry> E
internalAdd(E cpi, int hash)

private BootstrapMethodEntryImpl
public InvokeDynamicEntry
public LongEntry
longEntry(long value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.longEntry.

Returns a LongEntry describing the provided value.

private EntryMap
map()

pack-priv AbstractPoolEntry.Utf8EntryImpl
public MethodHandleEntry
methodHandleEntry(int refKind, MemberRefEntry reference)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.methodHandleEntry.

Returns a MethodHandleEntry encoding a reference kind and referring to a MemberRefEntry.

public MethodRefEntry
public MethodTypeEntry
methodTypeEntry(MethodTypeDesc descriptor)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.methodTypeEntry.

Returns a MethodTypeEntry describing the same method type as the provided MethodTypeDesc.

public MethodTypeEntry
public ModuleEntry
public AbstractPoolEntry.NameAndTypeEntryImpl
nameAndTypeEntry(Utf8Entry nameEntry, Utf8Entry typeEntry)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.nameAndTypeEntry.

Returns a NameAndTypeEntry referring to the provided name and type Utf8Entry.

public PackageEntry
public int
size()

Implements java.lang.classfile.constantpool.ConstantPool.size.

Returns the exclusive upper bound of the valid indices of this constant pool.

public StringEntry
private AbstractPoolEntry.ClassEntryImpl
private AbstractPoolEntry.ClassEntryImpl
private AbstractPoolEntry.Utf8EntryImpl
tryFindUtf8(int hash, String target)

private AbstractPoolEntry.Utf8EntryImpl
private static ConstantPoolException
unusableCP(int index)

public AbstractPoolEntry.Utf8EntryImpl
public Utf8Entry
public AbstractPoolEntry.Utf8EntryImpl
public boolean
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bsmMapback to summary
private EntryMap bsmMap
bsmSizeback to summary
private int bsmSize
doneFullScanback to summary
private boolean doneFullScan
mapback to summary
private EntryMap map
myBsmEntriesback to summary
private BootstrapMethodEntryImpl[] myBsmEntries
myEntriesback to summary
private PoolEntry[] myEntries
parentback to summary
private final ClassReaderImpl parent
parentBsmSizeback to summary
private final int parentBsmSize
parentSizeback to summary
private final int parentSize
sizeback to summary
private int size

Constructor Detail

SplitConstantPoolback to summary
public SplitConstantPool()
SplitConstantPoolback to summary
public SplitConstantPool(ClassReader parent)

Method Detail

badCPback to summary
private static ConstantPoolException badCP(int index)
bootstrapMethodCountback to summary
public int bootstrapMethodCount()

Implements java.lang.classfile.constantpool.ConstantPool.bootstrapMethodCount.

Doc from java.lang.classfile.constantpool.ConstantPool.bootstrapMethodCount.

Returns the number of entries in the bootstrap method table.

Annotations
@Override
bootstrapMethodEntryback to summary
public BootstrapMethodEntryImpl bootstrapMethodEntry(int index)

Implements java.lang.classfile.constantpool.ConstantPool.bootstrapMethodEntry.

Doc from java.lang.classfile.constantpool.ConstantPool.bootstrapMethodEntry.

Returns the BootstrapMethodEntry at the specified index within the bootstrap method table.

Annotations
@Override
bsmEntryback to summary
public BootstrapMethodEntry bsmEntry(MethodHandleEntry methodReference, List<LoadableConstantEntry> arguments)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.bsmEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.bsmEntry.

Returns a BootstrapMethodEntry referring to a MethodHandleEntry and a list of LoadableConstantEntry. The MethodHandleEntry is the bootstrap method, and the list of LoadableConstantEntry is the arguments.

Annotations
@Override
bsmMapback to summary
private EntryMap bsmMap()
canWriteDirectback to summary
public boolean canWriteDirect(ConstantPool other)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.canWriteDirect.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.canWriteDirect.

Returns true if the index of any entry in the given constant pool refers to the same entry in this builder. This may be because they are the same builder, or because this builder was pre-populated from the given constant pool.

If the constant pool of an entry is not directly writable to this pool, it is alien to this pool, and a ClassFileBuilder associated with this constant pool will convert that alien constant pool entry.

Annotations
@Override
classEntryback to summary
public AbstractPoolEntry.ClassEntryImpl classEntry(Utf8Entry nameEntry)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.classEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.classEntry.

Returns a ClassEntry referring to the provided Utf8Entry. The Utf8Entry describes the internal form of the binary name of a class or interface or the field descriptor string of an array type.

Annotations
@Override
classEntryback to summary
pack-priv AbstractPoolEntry.ClassEntryImpl classEntry(AbstractPoolEntry.Utf8EntryImpl ne, boolean isArray)
classEntryback to summary
public ClassEntry classEntry(ClassDesc cd)

Overrides default java.lang.classfile.constantpool.ConstantPoolBuilder.classEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.classEntry.

Returns a ClassEntry describing the same reference type as the provided ClassDesc.

Annotations
@Override
classEntryForClassOrInterfaceback to summary
private AbstractPoolEntry.ClassEntryImpl classEntryForClassOrInterface(ClassDesc cd)
cloneClassEntryback to summary
pack-priv AbstractPoolEntry.ClassEntryImpl cloneClassEntry(AbstractPoolEntry.ClassEntryImpl e)
constantDynamicEntryback to summary
public ConstantDynamicEntry constantDynamicEntry(BootstrapMethodEntry bootstrapMethodEntry, NameAndTypeEntry nameAndType)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.constantDynamicEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.constantDynamicEntry.

Returns a ConstantDynamicEntry referring to a BootstrapMethodEntry and a NameAndTypeEntry. The BootstrapMethodEntry describes the bootstrap method and its invocation arguments in addition to the name and type, and the NameAndTypeEntry a name and a field descriptor.

Annotations
@Override
doubleEntryback to summary
public DoubleEntry doubleEntry(double value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.doubleEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.doubleEntry.

Returns a DoubleEntry describing the provided value.

All NaN values of the double may or may not be collapsed into a single "canonical" NaN value.

Annotations
@Override
entryByIndexback to summary
public PoolEntry entryByIndex(int index)

Implements java.lang.classfile.constantpool.ConstantPool.entryByIndex.

Doc from java.lang.classfile.constantpool.ConstantPool.entryByIndex.

Returns the entry at the specified index.

Annotations
@Override
entryByIndexback to summary
public <T extends PoolEntry> T entryByIndex(int index, Class<T> cls)

Implements java.lang.classfile.constantpool.ConstantPool.entryByIndex.

Doc from java.lang.classfile.constantpool.ConstantPool.entryByIndex.

Returns the entry of a given type at the specified index.

Annotations
@Override
fieldRefEntryback to summary
public FieldRefEntry fieldRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.fieldRefEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.fieldRefEntry.

Returns a FieldRefEntry referring to a ClassEntry and a NameAndTypeEntry. The ClassEntry describes a class or interface that has this field as a member, and the NameAndTypeEntry describes the unqualified name and the field descriptor for this field.

Annotations
@Override
findDoubleEntryback to summary
private DoubleEntry findDoubleEntry(double val)
findEntryback to summary
private <T extends AbstractPoolEntry> AbstractPoolEntry findEntry(int tag, T ref1)
findEntryback to summary
private <T extends AbstractPoolEntry, U extends AbstractPoolEntry> AbstractPoolEntry findEntry(int tag, T ref1, U ref2)
findFloatEntryback to summary
private FloatEntry findFloatEntry(float val)
findIntEntryback to summary
private IntegerEntry findIntEntry(int val)
findLongEntryback to summary
private LongEntry findLongEntry(long val)
floatEntryback to summary
public FloatEntry floatEntry(float value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.floatEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.floatEntry.

Returns a FloatEntry describing the provided value.

All NaN values of the float may or may not be collapsed into a single "canonical" NaN value.

Annotations
@Override
fullScanback to summary
private void fullScan()
intEntryback to summary
public IntegerEntry intEntry(int value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.intEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.intEntry.

Returns an IntegerEntry describing the provided value.

Annotations
@Override
interfaceMethodRefEntryback to summary
public InterfaceMethodRefEntry interfaceMethodRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.interfaceMethodRefEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.interfaceMethodRefEntry.

Returns an InterfaceMethodRefEntry referring to a ClassEntry and a NameAndTypeEntry. The ClassEntry describes an interface that has this method as a member, and the NameAndTypeEntry describes the unqualified name and the method descriptor for this method.

Annotations
@Override
internalAddback to summary
private <E extends PoolEntry> E internalAdd(E cpi)
internalAddback to summary
private <E extends PoolEntry> E internalAdd(E cpi, int hash)
internalAddback to summary
private BootstrapMethodEntryImpl internalAdd(BootstrapMethodEntryImpl bsm, int hash)
invokeDynamicEntryback to summary
public InvokeDynamicEntry invokeDynamicEntry(BootstrapMethodEntry bootstrapMethodEntry, NameAndTypeEntry nameAndType)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.invokeDynamicEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.invokeDynamicEntry.

Returns an InvokeDynamicEntry referring to a BootstrapMethodEntry and a NameAndTypeEntry. The BootstrapMethodEntry describes the bootstrap method and its invocation arguments in addition to the name and type, and the NameAndTypeEntry a name and a method descriptor.

Annotations
@Override
longEntryback to summary
public LongEntry longEntry(long value)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.longEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.longEntry.

Returns a LongEntry describing the provided value.

Annotations
@Override
mapback to summary
private EntryMap map()
maybeCloneUtf8Entryback to summary
pack-priv AbstractPoolEntry.Utf8EntryImpl maybeCloneUtf8Entry(Utf8Entry entry)
methodHandleEntryback to summary
public MethodHandleEntry methodHandleEntry(int refKind, MemberRefEntry reference)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.methodHandleEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.methodHandleEntry.

Returns a MethodHandleEntry encoding a reference kind and referring to a MemberRefEntry. The reference kind is in [1, 9], and the MemberRefEntry is subject to various restrictions based on the reference kind (JVMS 4.4.8).

Annotations
@Override
methodRefEntryback to summary
public MethodRefEntry methodRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.methodRefEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.methodRefEntry.

Returns a MethodRefEntry referring to a ClassEntry and a NameAndTypeEntry. The ClassEntry describes a class that has this method as a member, and the NameAndTypeEntry describes the unqualified name or the special name <init> and the method descriptor for this method.

Annotations
@Override
methodTypeEntryback to summary
public MethodTypeEntry methodTypeEntry(MethodTypeDesc descriptor)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.methodTypeEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.methodTypeEntry.

Returns a MethodTypeEntry describing the same method type as the provided MethodTypeDesc.

Annotations
@Override
methodTypeEntryback to summary
public MethodTypeEntry methodTypeEntry(Utf8Entry descriptor)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.methodTypeEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.methodTypeEntry.

Returns a MethodTypeEntry referring to a Utf8Entry. The Utf8Entry represents a method descriptor string.

Annotations
@Override
moduleEntryback to summary
public ModuleEntry moduleEntry(Utf8Entry nameEntry)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.moduleEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.moduleEntry.

Returns a ModuleEntry referring to the provided Utf8Entry. The Utf8Entry describes the module name.

Annotations
@Override
nameAndTypeEntryback to summary
public AbstractPoolEntry.NameAndTypeEntryImpl nameAndTypeEntry(Utf8Entry nameEntry, Utf8Entry typeEntry)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.nameAndTypeEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.nameAndTypeEntry.

Returns a NameAndTypeEntry referring to the provided name and type Utf8Entry. The name Utf8Entry describes an unqualified name or the special name <init>, and the type Utf8Entry describes a field or method descriptor string.

Annotations
@Override
packageEntryback to summary
public PackageEntry packageEntry(Utf8Entry nameEntry)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.packageEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.packageEntry.

Returns a PackageEntry referring to the provided Utf8Entry. The Utf8Entry describes the internal form of the name of a package.

Annotations
@Override
sizeback to summary
public int size()

Implements java.lang.classfile.constantpool.ConstantPool.size.

Doc from java.lang.classfile.constantpool.ConstantPool.size.

Returns the exclusive upper bound of the valid indices of this constant pool. The actual number of entries is lower because 0, size() are not valid, and a valid index may be unusable.

Annotations
@Override
stringEntryback to summary
public StringEntry stringEntry(Utf8Entry utf8)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.stringEntry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.stringEntry.

Returns a StringEntry referring to a Utf8Entry. The Utf8Entry describes the string value.

Annotations
@Override
tryFindClassEntryback to summary
private AbstractPoolEntry.ClassEntryImpl tryFindClassEntry(int hash, AbstractPoolEntry.Utf8EntryImpl utf8)
tryFindClassOrInterfaceback to summary
private AbstractPoolEntry.ClassEntryImpl tryFindClassOrInterface(int hash, ClassDesc cd)
tryFindUtf8back to summary
private AbstractPoolEntry.Utf8EntryImpl tryFindUtf8(int hash, String target)
tryFindUtf8back to summary
private AbstractPoolEntry.Utf8EntryImpl tryFindUtf8(int hash, AbstractPoolEntry.Utf8EntryImpl target)
unusableCPback to summary
private static ConstantPoolException unusableCP(int index)
utf8Entryback to summary
public AbstractPoolEntry.Utf8EntryImpl utf8Entry(ClassDesc desc)

Overrides default java.lang.classfile.constantpool.ConstantPoolBuilder.utf8Entry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.utf8Entry.

Returns a Utf8Entry describing the field descriptor string of the provided ClassDesc.

Annotations
@Override
utf8Entryback to summary
public Utf8Entry utf8Entry(MethodTypeDesc desc)

Overrides default java.lang.classfile.constantpool.ConstantPoolBuilder.utf8Entry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.utf8Entry.

Returns a Utf8Entry describing the method descriptor string of the provided MethodTypeDesc.

Annotations
@Override
utf8Entryback to summary
public AbstractPoolEntry.Utf8EntryImpl utf8Entry(String s)

Implements java.lang.classfile.constantpool.ConstantPoolBuilder.utf8Entry.

Doc from java.lang.classfile.constantpool.ConstantPoolBuilder.utf8Entry.

Returns a Utf8Entry describing the provided String.

Annotations
@Override
writeBootstrapMethodsback to summary
public boolean writeBootstrapMethods(BufWriterImpl buf)
writeToback to summary
pack-priv void writeTo(BufWriterImpl buf)