Java Code Examples for java.lang.invoke.CallSite#dynamicInvoker()

The following examples show how to use java.lang.invoke.CallSite#dynamicInvoker() . 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: CompiledFunction.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private MethodHandle createComposableInvoker(final boolean isConstructor) {
    final MethodHandle handle = getInvokerOrConstructor(isConstructor);

    // If compiled function is not optimistic, it can't ever change its invoker/constructor, so just return them
    // directly.
    if(!canBeDeoptimized()) {
        return handle;
    }

    // Otherwise, we need a new level of indirection; need to introduce a mutable call site that can relink itself
    // to the compiled function's changed target whenever the optimistic assumptions are invalidated.
    final CallSite cs = new MutableCallSite(handle.type());
    relinkComposableInvoker(cs, this, isConstructor);
    return cs.dynamicInvoker();
}
 
Example 2
Source File: CompiledFunction.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private MethodHandle createComposableInvoker(final boolean isConstructor) {
    final MethodHandle handle = getInvokerOrConstructor(isConstructor);

    // If compiled function is not optimistic, it can't ever change its invoker/constructor, so just return them
    // directly.
    if(!canBeDeoptimized()) {
        return handle;
    }

    // Otherwise, we need a new level of indirection; need to introduce a mutable call site that can relink itslef
    // to the compiled function's changed target whenever the optimistic assumptions are invalidated.
    final CallSite cs = new MutableCallSite(handle.type());
    relinkComposableInvoker(cs, this, isConstructor);
    return cs.dynamicInvoker();
}
 
Example 3
Source File: CompiledFunction.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private MethodHandle createComposableInvoker(final boolean isConstructor) {
    final MethodHandle handle = getInvokerOrConstructor(isConstructor);

    // If compiled function is not optimistic, it can't ever change its invoker/constructor, so just return them
    // directly.
    if(!canBeDeoptimized()) {
        return handle;
    }

    // Otherwise, we need a new level of indirection; need to introduce a mutable call site that can relink itself
    // to the compiled function's changed target whenever the optimistic assumptions are invalidated.
    final CallSite cs = new MutableCallSite(handle.type());
    relinkComposableInvoker(cs, this, isConstructor);
    return cs.dynamicInvoker();
}
 
Example 4
Source File: CompiledFunction.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private MethodHandle createComposableInvoker(final boolean isConstructor) {
    final MethodHandle handle = getInvokerOrConstructor(isConstructor);

    // If compiled function is not optimistic, it can't ever change its invoker/constructor, so just return them
    // directly.
    if(!canBeDeoptimized()) {
        return handle;
    }

    // Otherwise, we need a new level of indirection; need to introduce a mutable call site that can relink itself
    // to the compiled function's changed target whenever the optimistic assumptions are invalidated.
    final CallSite cs = new MutableCallSite(handle.type());
    relinkComposableInvoker(cs, this, isConstructor);
    return cs.dynamicInvoker();
}
 
Example 5
Source File: CompiledFunction.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private MethodHandle createComposableInvoker(final boolean isConstructor) {
    final MethodHandle handle = getInvokerOrConstructor(isConstructor);

    // If compiled function is not optimistic, it can't ever change its invoker/constructor, so just return them
    // directly.
    if(!canBeDeoptimized()) {
        return handle;
    }

    // Otherwise, we need a new level of indirection; need to introduce a mutable call site that can relink itself
    // to the compiled function's changed target whenever the optimistic assumptions are invalidated.
    final CallSite cs = new MutableCallSite(handle.type());
    relinkComposableInvoker(cs, this, isConstructor);
    return cs.dynamicInvoker();
}
 
Example 6
Source File: CompiledFunction.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private MethodHandle createComposableInvoker(final boolean isConstructor) {
    final MethodHandle handle = getInvokerOrConstructor(isConstructor);

    // If compiled function is not optimistic, it can't ever change its invoker/constructor, so just return them
    // directly.
    if(!canBeDeoptimized()) {
        return handle;
    }

    // Otherwise, we need a new level of indirection; need to introduce a mutable call site that can relink itself
    // to the compiled function's changed target whenever the optimistic assumptions are invalidated.
    final CallSite cs = new MutableCallSite(handle.type());
    relinkComposableInvoker(cs, this, isConstructor);
    return cs.dynamicInvoker();
}
 
Example 7
Source File: CompiledFunction.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
private MethodHandle createComposableInvoker(final boolean isConstructor) {
    final MethodHandle handle = getInvokerOrConstructor(isConstructor);

    // If compiled function is not optimistic, it can't ever change its invoker/constructor, so just return them
    // directly.
    if(!canBeDeoptimized()) {
        return handle;
    }

    // Otherwise, we need a new level of indirection; need to introduce a mutable call site that can relink itself
    // to the compiled function's changed target whenever the optimistic assumptions are invalidated.
    final CallSite cs = new MutableCallSite(handle.type());
    relinkComposableInvoker(cs, this, isConstructor);
    return cs.dynamicInvoker();
}