Java Code Examples for jdk.nashorn.internal.lookup.MethodHandleFactory#LookupException

The following examples show how to use jdk.nashorn.internal.lookup.MethodHandleFactory#LookupException . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScriptObject.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    final Class<?>   own = ScriptObject.class;
    final MethodType mt  = MH.type(rtype, types);
    try {
        return MH.findStatic(MethodHandles.lookup(), own, name, mt);
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
    }
}
 
Example 2
Source File: RuntimeCallSite.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    try {
        return MH.findStatic(MethodHandles.lookup(), RuntimeCallSite.class, name, MH.type(rtype, types));
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), RuntimeCallSite.class, name, MH.type(rtype, types));
    }
}
 
Example 3
Source File: ScriptFunction.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    final Class<?>   own = ScriptFunction.class;
    final MethodType mt  = MH.type(rtype, types);
    try {
        return MH.findStatic(MethodHandles.lookup(), own, name, mt);
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
    }
}
 
Example 4
Source File: ScriptObject.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    final Class<?>   own = ScriptObject.class;
    final MethodType mt  = MH.type(rtype, types);
    try {
        return MH.findStatic(MethodHandles.lookup(), own, name, mt);
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
    }
}
 
Example 5
Source File: JSObjectLinker.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findJSObjectMH(final String name, final Class<?> rtype, final Class<?>... types) {
    final Class<?>   own = JSObject.class;
    final MethodType mt  = MH.type(rtype, types);
    try {
        return MH.findVirtual(MethodHandles.publicLookup(), own, name, mt);
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
    }
}
 
Example 6
Source File: JSObjectLinker.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    final Class<?>   own = JSObjectLinker.class;
    final MethodType mt  = MH.type(rtype, types);
    try {
        return MH.findStatic(MethodHandles.lookup(), own, name, mt);
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
    }
}
 
Example 7
Source File: LinkerCallSite.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    try {
        return MH.findStatic(MethodHandles.lookup(), TracingLinkerCallSite.class, name, MH.type(rtype, types));
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), TracingLinkerCallSite.class, name, MH.type(rtype, types));
    }
}
 
Example 8
Source File: LinkerCallSite.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    try {
        return MH.findStatic(MethodHandles.lookup(), LinkerCallSite.class, name, MH.type(rtype, types));
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), LinkerCallSite.class, name, MH.type(rtype, types));
    }
}
 
Example 9
Source File: RuntimeCallSite.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    try {
        return MH.findStatic(MethodHandles.lookup(), RuntimeCallSite.class, name, MH.type(rtype, types));
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), RuntimeCallSite.class, name, MH.type(rtype, types));
    }
}
 
Example 10
Source File: ScriptFunction.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    final Class<?>   own = ScriptFunction.class;
    final MethodType mt  = MH.type(rtype, types);
    try {
        return MH.findStatic(MethodHandles.lookup(), own, name, mt);
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
    }
}
 
Example 11
Source File: LinkerCallSite.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    try {
        return MH.findStatic(MethodHandles.lookup(), LinkerCallSite.class, name, MH.type(rtype, types));
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), LinkerCallSite.class, name, MH.type(rtype, types));
    }
}
 
Example 12
Source File: JSObjectLinker.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findMH(final String name, final Class<?> target, final Class<?> rtype, final Class<?>... types) {
    final MethodType mt  = MH.type(rtype, types);
    try {
        return MH.findStatic(MethodHandles.lookup(), target, name, mt);
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), target, name, mt);
    }
}
 
Example 13
Source File: LinkerCallSite.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    try {
        return MH.findStatic(MethodHandles.lookup(), TracingLinkerCallSite.class, name, MH.type(rtype, types));
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), TracingLinkerCallSite.class, name, MH.type(rtype, types));
    }
}
 
Example 14
Source File: LinkerCallSite.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    try {
        return MH.findStatic(MethodHandles.lookup(), LinkerCallSite.class, name, MH.type(rtype, types));
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), LinkerCallSite.class, name, MH.type(rtype, types));
    }
}
 
Example 15
Source File: RuntimeCallSite.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    try {
        return MH.findStatic(MethodHandles.lookup(), RuntimeCallSite.class, name, MH.type(rtype, types));
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), RuntimeCallSite.class, name, MH.type(rtype, types));
    }
}
 
Example 16
Source File: ScriptFunction.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    final Class<?>   own = ScriptFunction.class;
    final MethodType mt  = MH.type(rtype, types);
    try {
        return MH.findStatic(MethodHandles.lookup(), own, name, mt);
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
    }
}
 
Example 17
Source File: ScriptObject.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    final Class<?>   own = ScriptObject.class;
    final MethodType mt  = MH.type(rtype, types);
    try {
        return MH.findStatic(MethodHandles.lookup(), own, name, mt);
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
    }
}
 
Example 18
Source File: JSObjectLinker.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findMH(final String name, final Class<?> target, final Class<?> rtype, final Class<?>... types) {
    final MethodType mt  = MH.type(rtype, types);
    try {
        return MH.findStatic(MethodHandles.lookup(), target, name, mt);
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), target, name, mt);
    }
}
 
Example 19
Source File: LinkerCallSite.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
    try {
        return MH.findStatic(MethodHandles.lookup(), TracingLinkerCallSite.class, name, MH.type(rtype, types));
    } catch (final MethodHandleFactory.LookupException e) {
        return MH.findVirtual(MethodHandles.lookup(), TracingLinkerCallSite.class, name, MH.type(rtype, types));
    }
}