< prev index next >

src/java.base/share/classes/jdk/internal/access/JavaLangInvokeAccess.java

Print this page

 45      */
 46     Class<?> getDeclaringClass(Object rmname);
 47 
 48     /**
 49      * Returns the {@code MethodType} for the given method descriptor
 50      * and class loader.
 51      * Used by {@code StackFrameInfo}.
 52      */
 53     MethodType getMethodType(String descriptor, ClassLoader loader);
 54 
 55     /**
 56      * Returns true if the given flags has MN_CALLER_SENSITIVE flag set.
 57      */
 58     boolean isCallerSensitive(int flags);
 59 
 60     /**
 61      * Returns true if the given flags has MN_HIDDEN_MEMBER flag set.
 62      */
 63     boolean isHiddenMember(int flags);
 64 






 65     /**
 66      * Returns a map of class name in internal forms to its corresponding
 67      * class bytes per the given stream of LF_RESOLVE and SPECIES_RESOLVE
 68      * trace logs. Used by GenerateJLIClassesPlugin to enable generation
 69      * of such classes during the jlink phase.
 70      */
 71     Map<String, byte[]> generateHolderClasses(Stream<String> traces);
 72 
 73     /**
 74      * Returns a var handle view of a given memory segment.
 75      * Used by {@code jdk.internal.foreign.LayoutPath} and
 76      * {@code java.lang.invoke.MethodHandles}.
 77      */
 78     VarHandle memorySegmentViewHandle(Class<?> carrier, MemoryLayout enclosing, long alignmentMask, ByteOrder order, boolean constantOffset, long offset);
 79 
 80     /**
 81      * Var handle carrier combinator.
 82      * Used by {@code java.lang.invoke.MethodHandles}.
 83      */
 84     VarHandle filterValue(VarHandle target, MethodHandle filterToTarget, MethodHandle filterFromTarget);

153      * The invoker class is a hidden class which has the same
154      * defining class loader, runtime package, and protection domain
155      * as the given caller class.
156      */
157     MethodHandle reflectiveInvoker(Class<?> caller);
158 
159     /**
160      * A best-effort method that tries to find any exceptions thrown by the given method handle.
161      * @param handle the handle to check
162      * @return an array of exceptions, or {@code null}.
163      */
164     Class<?>[] exceptionTypes(MethodHandle handle);
165 
166     /**
167      * Returns a method handle that allocates an instance of the given class
168      * and then invoke the given constructor of one of its superclasses.
169      *
170      * This method should only be used by ReflectionFactory::newConstructorForSerialization.
171      */
172     MethodHandle serializableConstructor(Class<?> decl, Constructor<?> ctorToCall) throws IllegalAccessException;










173 }

 45      */
 46     Class<?> getDeclaringClass(Object rmname);
 47 
 48     /**
 49      * Returns the {@code MethodType} for the given method descriptor
 50      * and class loader.
 51      * Used by {@code StackFrameInfo}.
 52      */
 53     MethodType getMethodType(String descriptor, ClassLoader loader);
 54 
 55     /**
 56      * Returns true if the given flags has MN_CALLER_SENSITIVE flag set.
 57      */
 58     boolean isCallerSensitive(int flags);
 59 
 60     /**
 61      * Returns true if the given flags has MN_HIDDEN_MEMBER flag set.
 62      */
 63     boolean isHiddenMember(int flags);
 64 
 65     /**
 66      * Returns true if the member of the given method handle is a null-restricted
 67      * field.
 68      */
 69     boolean isNullRestrictedField(MethodHandle mh);
 70 
 71     /**
 72      * Returns a map of class name in internal forms to its corresponding
 73      * class bytes per the given stream of LF_RESOLVE and SPECIES_RESOLVE
 74      * trace logs. Used by GenerateJLIClassesPlugin to enable generation
 75      * of such classes during the jlink phase.
 76      */
 77     Map<String, byte[]> generateHolderClasses(Stream<String> traces);
 78 
 79     /**
 80      * Returns a var handle view of a given memory segment.
 81      * Used by {@code jdk.internal.foreign.LayoutPath} and
 82      * {@code java.lang.invoke.MethodHandles}.
 83      */
 84     VarHandle memorySegmentViewHandle(Class<?> carrier, MemoryLayout enclosing, long alignmentMask, ByteOrder order, boolean constantOffset, long offset);
 85 
 86     /**
 87      * Var handle carrier combinator.
 88      * Used by {@code java.lang.invoke.MethodHandles}.
 89      */
 90     VarHandle filterValue(VarHandle target, MethodHandle filterToTarget, MethodHandle filterFromTarget);

159      * The invoker class is a hidden class which has the same
160      * defining class loader, runtime package, and protection domain
161      * as the given caller class.
162      */
163     MethodHandle reflectiveInvoker(Class<?> caller);
164 
165     /**
166      * A best-effort method that tries to find any exceptions thrown by the given method handle.
167      * @param handle the handle to check
168      * @return an array of exceptions, or {@code null}.
169      */
170     Class<?>[] exceptionTypes(MethodHandle handle);
171 
172     /**
173      * Returns a method handle that allocates an instance of the given class
174      * and then invoke the given constructor of one of its superclasses.
175      *
176      * This method should only be used by ReflectionFactory::newConstructorForSerialization.
177      */
178     MethodHandle serializableConstructor(Class<?> decl, Constructor<?> ctorToCall) throws IllegalAccessException;
179 
180     /**
181      * Asserts a method handle to be another type without the conversion adaptions.
182      * Useful to avoid many redundant casts.
183      *
184      * @param original original MH
185      * @param assertedType the asserted type the origina MH can execute as
186      * @return the cheap view without extra adaptions
187      */
188     MethodHandle assertAsType(MethodHandle original, MethodType assertedType);
189 }
< prev index next >