8339876: Move constant symbol caches to Utf8EntryImpl

Reviewed-by: redestad
This commit is contained in:
Chen Liang 2024-09-12 15:16:38 +00:00
parent 0765917dea
commit 4d65c3efca
19 changed files with 87 additions and 113 deletions

View file

@ -36,6 +36,7 @@ import java.lang.constant.ClassDesc;
import jdk.internal.classfile.impl.AbstractPseudoInstruction;
import jdk.internal.classfile.impl.BoundLocalVariable;
import jdk.internal.classfile.impl.TemporaryConstantPool;
import jdk.internal.classfile.impl.Util;
import jdk.internal.javac.PreviewFeature;
/**
@ -70,7 +71,7 @@ public sealed interface LocalVariable extends PseudoInstruction
* {@return the local variable type, as a symbolic descriptor}
*/
default ClassDesc typeSymbol() {
return ClassDesc.ofDescriptor(type().stringValue());
return Util.fieldTypeSymbol(type());
}
/**
@ -109,7 +110,7 @@ public sealed interface LocalVariable extends PseudoInstruction
static LocalVariable of(int slot, String name, ClassDesc descriptor, Label startScope, Label endScope) {
return of(slot,
TemporaryConstantPool.INSTANCE.utf8Entry(name),
TemporaryConstantPool.INSTANCE.utf8Entry(descriptor.descriptorString()),
TemporaryConstantPool.INSTANCE.utf8Entry(descriptor),
startScope, endScope);
}
}