mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8339876: Move constant symbol caches to Utf8EntryImpl
Reviewed-by: redestad
This commit is contained in:
parent
0765917dea
commit
4d65c3efca
19 changed files with 87 additions and 113 deletions
|
@ -38,6 +38,8 @@ import java.lang.constant.ClassDesc;
|
|||
import java.lang.constant.Constable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import jdk.internal.classfile.impl.Util;
|
||||
import jdk.internal.javac.PreviewFeature;
|
||||
|
||||
/**
|
||||
|
@ -405,7 +407,7 @@ public sealed interface AnnotationValue {
|
|||
|
||||
/** {@return the class descriptor} */
|
||||
default ClassDesc classSymbol() {
|
||||
return ClassDesc.ofDescriptor(className().stringValue());
|
||||
return Util.fieldTypeSymbol(className());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -423,7 +425,7 @@ public sealed interface AnnotationValue {
|
|||
|
||||
/** {@return the enum class descriptor} */
|
||||
default ClassDesc classSymbol() {
|
||||
return ClassDesc.ofDescriptor(className().stringValue());
|
||||
return Util.fieldTypeSymbol(className());
|
||||
}
|
||||
|
||||
/** {@return the enum constant name} */
|
||||
|
@ -452,7 +454,7 @@ public sealed interface AnnotationValue {
|
|||
* @param constantName the name of the enum constant
|
||||
*/
|
||||
static OfEnum ofEnum(ClassDesc className, String constantName) {
|
||||
return ofEnum(TemporaryConstantPool.INSTANCE.utf8Entry(className.descriptorString()),
|
||||
return ofEnum(TemporaryConstantPool.INSTANCE.utf8Entry(className),
|
||||
TemporaryConstantPool.INSTANCE.utf8Entry(constantName));
|
||||
}
|
||||
|
||||
|
@ -469,7 +471,7 @@ public sealed interface AnnotationValue {
|
|||
* @param className the descriptor of the class
|
||||
*/
|
||||
static OfClass ofClass(ClassDesc className) {
|
||||
return ofClass(TemporaryConstantPool.INSTANCE.utf8Entry(className.descriptorString()));
|
||||
return ofClass(TemporaryConstantPool.INSTANCE.utf8Entry(className));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue