Top Fields Constructors Methods
org.jruby.runtime.invokedynamic

public Class GlobalSite

extends MutableCallSite
Class Inheritance
Imports
java.lang.invoke.CallSite, .MethodHandle, .MethodHandles, .MethodType, .MutableCallSite, .SwitchPoint, org.jruby.Ruby, .RubyGlobal, org.jruby.internal.runtime.GlobalVariable, org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.opto.Invalidator, org.jruby.util.JavaNameMangler, org.jruby.util.cli.Options, org.jruby.util.log.Logger, .LoggerFactory, org.objectweb.asm.Handle, .Opcodes

Field Summary

Modifier and TypeField and Description
private volatile int
private final String
public static final Handle
private final int
private static final Logger
private final String

Constructor Summary

AccessConstructor and Description
public
GlobalSite(MethodType type, String name, String file, int line)

Method Summary

Modifier and TypeMethod and Description
public int
public String
file()

public IRubyObject
public static IRubyObject
public static CallSite
globalBootstrap(MethodHandles.Lookup lookup, String name, MethodType type, String file, int line)

public void
public int
line()

public String
name()

public void
public static void
public void
setTarget(MethodHandle
the new target
target
)

Overrides java.lang.invoke.MutableCallSite.setTarget.

Updates the target method of this call site, as a normal variable.

Inherited from java.lang.invoke.MutableCallSite:
dynamicInvokergetTargetsyncAll

Field Detail

failuresback to summary
private volatile int failures
fileback to summary
private final String file
GLOBAL_BOOTSTRAP_Hback to summary
public static final Handle GLOBAL_BOOTSTRAP_H
lineback to summary
private final int line
LOGback to summary
private static final Logger LOG
nameback to summary
private final String name

Constructor Detail

GlobalSiteback to summary
public GlobalSite(MethodType type, String name, String file, int line)

Method Detail

failuresback to summary
public int failures()
fileback to summary
public String file()
getGlobalFallbackback to summary
public IRubyObject getGlobalFallback(ThreadContext context) throws Throwable
getGlobalUncachedback to summary
public static IRubyObject getGlobalUncached(GlobalVariable variable) throws Throwable
globalBootstrapback to summary
public static CallSite globalBootstrap(MethodHandles.Lookup lookup, String name, MethodType type, String file, int line) throws Throwable
incrementFailuresback to summary
public void incrementFailures()
lineback to summary
public int line()
nameback to summary
public String name()
setGlobalFallbackback to summary
public void setGlobalFallback(IRubyObject value, ThreadContext context) throws Throwable
setGlobalUncachedback to summary
public static void setGlobalUncached(GlobalVariable variable, IRubyObject value) throws Throwable
setTargetback to summary
public void setTarget(MethodHandle target)

Overrides java.lang.invoke.MutableCallSite.setTarget.

Doc from java.lang.invoke.MutableCallSite.setTarget.

Updates the target method of this call site, as a normal variable. The type of the new target must agree with the type of the old target.

The interactions with memory are the same as of a write to an ordinary variable, such as an array element or a non-volatile, non-final field.

In particular, unrelated threads may fail to see the updated target until they perform a read from memory. Stronger guarantees can be created by putting appropriate operations into the bootstrap method and/or the target methods used at any given call site.

Parameters
target:MethodHandle

the new target