< prev index next > src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
Print this page
package java.lang.invoke;
import jdk.internal.access.JavaLangInvokeAccess;
import jdk.internal.access.SharedSecrets;
import jdk.internal.constant.MethodTypeDescImpl;
- import jdk.internal.constant.ReferenceClassDescImpl;
+ import jdk.internal.constant.ClassDescImpl;
import jdk.internal.foreign.abi.NativeEntryPoint;
import jdk.internal.reflect.CallerSensitive;
import jdk.internal.reflect.Reflection;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.Hidden;
// Put the whole mess into its own nested class.
// That way we can lazily load the code and set up the constants.
private static class BindCaller {
- private static final ClassDesc CD_Object_array = ReferenceClassDescImpl.ofValidated("[Ljava/lang/Object;");
+ private static final ClassDesc CD_Object_array = ClassDescImpl.ofValidated("[Ljava/lang/Object;");
private static final MethodType INVOKER_MT = MethodType.methodType(Object.class, MethodHandle.class, Object[].class);
private static final MethodType REFLECT_INVOKER_MT = MethodType.methodType(Object.class, MethodHandle.class, Object.class, Object[].class);
static MethodHandle bindCaller(MethodHandle mh, Class<?> hostClass) {
// Code in the boot layer should now be careful while creating method handles or
// static Object reflect_invoke_V(MethodHandle vamh, Object target, Object[] args) throws Throwable {
// return vamh.invokeExact(target, args);
// }
// }
// }
- return ClassFile.of().build(ReferenceClassDescImpl.ofValidated("LInjectedInvoker;"), clb -> clb
+ return ClassFile.of().build(ClassDescImpl.ofValidated("LInjectedInvoker;"), clb -> clb
.withFlags(ACC_PRIVATE | ACC_SUPER)
.withMethodBody(
"invoke_V",
MethodTypeDescImpl.ofValidated(CD_Object, CD_MethodHandle, CD_Object_array),
ACC_STATIC,
public boolean isHiddenMember(int flags) {
return (flags & MN_HIDDEN_MEMBER) == MN_HIDDEN_MEMBER;
}
+ public boolean isNullRestrictedField(MethodHandle mh) {
+ var memberName = mh.internalMemberName();
+ assert memberName.isField();
+ return memberName.isNullRestricted();
+ }
+
@Override
public Map<String, byte[]> generateHolderClasses(Stream<String> traces) {
return GenerateJLIClassesHelper.generateHolderClasses(traces);
}
< prev index next >