mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8265135: Reduce work initializing VarForms
Reviewed-by: psandoz, mchung
This commit is contained in:
parent
d9e40dd593
commit
5303ccb885
3 changed files with 66 additions and 50 deletions
|
@ -1938,11 +1938,6 @@ public abstract class VarHandle implements Constable {
|
|||
if (am != null) return am;
|
||||
throw new IllegalArgumentException("No AccessMode value for method name " + methodName);
|
||||
}
|
||||
|
||||
@ForceInline
|
||||
static MemberName getMemberName(int ordinal, VarForm vform) {
|
||||
return vform.memberName_table[ordinal];
|
||||
}
|
||||
}
|
||||
|
||||
static final class AccessDescriptor {
|
||||
|
@ -2045,7 +2040,7 @@ public abstract class VarHandle implements Constable {
|
|||
* {@code false}.
|
||||
*/
|
||||
public final boolean isAccessModeSupported(AccessMode accessMode) {
|
||||
return AccessMode.getMemberName(accessMode.ordinal(), vform) != null;
|
||||
return vform.getMemberNameOrNull(accessMode.ordinal()) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2068,8 +2063,7 @@ public abstract class VarHandle implements Constable {
|
|||
* @return a method handle bound to this VarHandle and the given access mode
|
||||
*/
|
||||
public MethodHandle toMethodHandle(AccessMode accessMode) {
|
||||
MemberName mn = AccessMode.getMemberName(accessMode.ordinal(), vform);
|
||||
if (mn != null) {
|
||||
if (isAccessModeSupported(accessMode)) {
|
||||
MethodHandle mh = getMethodHandle(accessMode.ordinal());
|
||||
return mh.bindTo(this);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue