diff options
Diffstat (limited to 'src/jdk/nashorn/internal/lookup/MethodHandleFunctionality.java')
-rw-r--r-- | src/jdk/nashorn/internal/lookup/MethodHandleFunctionality.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/jdk/nashorn/internal/lookup/MethodHandleFunctionality.java b/src/jdk/nashorn/internal/lookup/MethodHandleFunctionality.java index c7dd83b2..beaa85c2 100644 --- a/src/jdk/nashorn/internal/lookup/MethodHandleFunctionality.java +++ b/src/jdk/nashorn/internal/lookup/MethodHandleFunctionality.java @@ -152,6 +152,17 @@ public interface MethodHandleFunctionality { public MethodHandle throwException(Class<?> returnType, Class<? extends Throwable> exType); /** + * Wrapper for {@link java.lang.invoke.MethodHandles#catchException(MethodHandle, Class, MethodHandle)} + * + * @param target target method + * @param exType exception type + * @param handler the method handle to call when exception is thrown + * + * @return exception thrower method handle + */ + public MethodHandle catchException(final MethodHandle target, final Class<? extends Throwable> exType, final MethodHandle handler); + + /** * Wrapper for {@link java.lang.invoke.MethodHandles#constant(Class, Object)} * * @param type type of constant @@ -162,6 +173,15 @@ public interface MethodHandleFunctionality { public MethodHandle constant(Class<?> type, Object value); /** + * Wrapper for {@link java.lang.invoke.MethodHandles#identity(Class)} + * + * @param type type of value + * + * @return method handle that returns identity argument + */ + public MethodHandle identity(Class<?> type); + + /** * Wrapper for {@link java.lang.invoke.MethodHandle#asType(MethodType)} * * @param handle method handle for type conversion @@ -286,6 +306,19 @@ public interface MethodHandleFunctionality { public MethodHandle findVirtual(MethodHandles.Lookup explicitLookup, Class<?> clazz, String name, MethodType type); /** + * Wrapper for {@link java.lang.invoke.MethodHandles.Lookup#findSpecial(Class, String, MethodType, Class)} + * + * @param explicitLookup explicit lookup to be used + * @param clazz class to look in + * @param name name of method + * @param type method type + * @param thisClass thisClass + * + * @return method handle for virtual method + */ + public MethodHandle findSpecial(MethodHandles.Lookup explicitLookup, Class<?> clazz, String name, MethodType type, final Class<?> thisClass); + + /** * Wrapper for SwitchPoint creation. Just like {@code new SwitchPoint()} but potentially * tracked * @@ -313,5 +346,6 @@ public interface MethodHandleFunctionality { * @return the method type */ public MethodType type(Class<?> returnType, Class<?>... paramTypes); + } |