public static void setGlobalFallback(GlobalSite site, IRubyObject value, ThreadContext context) throws Throwable { Ruby runtime = context.runtime; GlobalVariable variable = runtime.getGlobalVariables().getVariable(site.name()); MethodHandle uncached = lookup().findStatic(Bootstrap.class, "setGlobalUncached", methodType(void.class, GlobalVariable.class, IRubyObject.class)); uncached = uncached.bindTo(variable); uncached = dropArguments(uncached, 1, ThreadContext.class); site.setTarget(uncached); uncached.invokeWithArguments(value, context); }
public static void setGlobalFallback(GlobalSite site, IRubyObject value, ThreadContext context) throws Throwable { Ruby runtime = context.runtime; GlobalVariable variable = runtime.getGlobalVariables().getVariable(site.name()); MethodHandle uncached = lookup().findStatic(Bootstrap.class, "setGlobalUncached", methodType(void.class, GlobalVariable.class, IRubyObject.class)); uncached = uncached.bindTo(variable); uncached = dropArguments(uncached, 1, ThreadContext.class); site.setTarget(uncached); uncached.invokeWithArguments(value, context); }
public static IRubyObject getGlobalFallback(GlobalSite site, ThreadContext context) throws Throwable { Ruby runtime = context.runtime; GlobalVariable variable = runtime.getGlobalVariables().getVariable(site.name()); RubyGlobal.UNCACHED_GLOBALS.contains(site.name())) { if (Options.INVOKEDYNAMIC_LOG_GLOBALS.load()) LOG.info("global " + site.name() + " (" + site.file() + ":" + site.line() + ") uncacheable or rebound > " + Options.INVOKEDYNAMIC_GLOBAL_MAXFAIL.load() + " times, reverting to simple lookup");
public static IRubyObject getGlobalFallback(GlobalSite site, ThreadContext context) throws Throwable { Ruby runtime = context.runtime; GlobalVariable variable = runtime.getGlobalVariables().getVariable(site.name()); RubyGlobal.UNCACHED_GLOBALS.contains(site.name())) { if (Options.INVOKEDYNAMIC_LOG_GLOBALS.load()) LOG.info("global " + site.name() + " (" + site.file() + ":" + site.line() + ") uncacheable or rebound > " + Options.INVOKEDYNAMIC_GLOBAL_MAXFAIL.load() + " times, reverting to simple lookup");