File tree 3 files changed +95
-324
lines changed
src/java.base/share/classes/java/lang/invoke
3 files changed +95
-324
lines changed Original file line number Diff line number Diff line change 40
40
import java .util .function .Function ;
41
41
42
42
import jdk .internal .util .Preconditions ;
43
+ import jdk .internal .vm .annotation .DontInline ;
43
44
import jdk .internal .vm .annotation .ForceInline ;
44
45
import jdk .internal .vm .annotation .IntrinsicCandidate ;
45
46
import jdk .internal .vm .annotation .Stable ;
@@ -2028,6 +2029,19 @@ public final MethodType accessModeType(AccessMode accessMode) {
2028
2029
return accessModeType (accessMode .at .ordinal ());
2029
2030
}
2030
2031
2032
+ @ ForceInline
2033
+ final void checkExactAccessMode (VarHandle .AccessDescriptor ad ) {
2034
+ if (exact && accessModeType (ad .type ) != ad .symbolicMethodTypeExact ) {
2035
+ throwWrongMethodTypeException (ad );
2036
+ }
2037
+ }
2038
+
2039
+ @ DontInline
2040
+ private final void throwWrongMethodTypeException (VarHandle .AccessDescriptor ad ) {
2041
+ throw new WrongMethodTypeException ("expected " + accessModeType (ad .type ) + " but found "
2042
+ + ad .symbolicMethodTypeExact );
2043
+ }
2044
+
2031
2045
@ ForceInline
2032
2046
final MethodType accessModeType (int accessTypeOrdinal ) {
2033
2047
TypesAndInvokers tis = getTypesAndInvokers ();
You can’t perform that action at this time.
0 commit comments