Package org.jruby.ir.targets.indy
Class InvokeSite
java.lang.Object
java.lang.invoke.CallSite
java.lang.invoke.MutableCallSite
org.jruby.ir.targets.indy.InvokeSite
- Direct Known Subclasses:
NormalInvokeSite
,SelfInvokeSite
Created by headius on 10/23/14.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
final int
protected CacheEntry
final CallType
protected final String
protected final int
final com.headius.invokebinder.Signature
final boolean
protected final int
protected final String
static final MethodHandle
final com.headius.invokebinder.Signature
-
Constructor Summary
ConstructorsConstructorDescriptionInvokeSite
(MethodType type, String name, CallType callType, boolean literalClosure, int flags, String file, int line) -
Method Summary
Modifier and TypeMethodDescriptionstatic CallSite
bootstrap
(InvokeSite site, MethodHandles.Lookup lookup) static IRubyObject
callMethodMissing
(CacheEntry entry, CallType callType, ThreadContext context, IRubyObject self, RubyClass selfClass, String name, IRubyObject[] args, Block block) Variable arity method_missing invocation.static IRubyObject
callMethodMissing
(CacheEntry entry, CallType callType, ThreadContext context, IRubyObject self, RubyClass selfClass, String name, IRubyObject arg0, Block block) Arity one method_missing invocationstatic IRubyObject
callMethodMissing
(CacheEntry entry, CallType callType, ThreadContext context, IRubyObject self, RubyClass selfClass, String name, IRubyObject arg0, IRubyObject arg1, Block block) Arity two method_missing invocationstatic IRubyObject
callMethodMissing
(CacheEntry entry, CallType callType, ThreadContext context, IRubyObject self, RubyClass selfClass, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) Arity three method_missing invocationfail
(ThreadContext context, IRubyObject caller, IRubyObject self, Block block) Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.fail
(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block) Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.fail
(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, Block block) Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.fail
(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, IRubyObject arg1, Block block) Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.fail
(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.failf
(ThreadContext context, IRubyObject self, Block block) Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.failf
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.failf
(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.failf
(ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, Block block) Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.failf
(ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.protected MethodHandle
getHandle
(ThreadContext context, IRubyObject self, CacheEntry entry) invoke
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) invoke
(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block) boolean
methodMissing
(CacheEntry entry) boolean
methodMissing
(CacheEntry entry, IRubyObject caller) name()
static IRubyObject
negate
(IRubyObject object, RubyNil nil, RubyBoolean.True tru, RubyBoolean.False fals) static RubyClass
pollAndGetClass
(ThreadContext context, IRubyObject self) com.headius.invokebinder.Binder
prepareBinder
(boolean varargs) Prepare a binder for this call site's target, forcing varargs if specifiedvoid
setInitialTarget
(MethodHandle target) void
setTarget
(MethodHandle target) static boolean
protected com.headius.invokebinder.SmartHandle
testTarget
(IRubyObject self, RubyModule testClass) static boolean
testType
(RubyClass original, IRubyObject self) toString()
protected MethodHandle
updateInvocationTarget
(MethodHandle target, IRubyObject self, RubyModule testClass, DynamicMethod method, SwitchPoint switchPoint) Update the given call site using the new target, wrapping with appropriate bind and argument-juggling logic.Methods inherited from class java.lang.invoke.MutableCallSite
dynamicInvoker, getTarget, syncAll
-
Field Details
-
signature
public final com.headius.invokebinder.Signature signature -
fullSignature
public final com.headius.invokebinder.Signature fullSignature -
arity
public final int arity -
methodName
-
argOffset
public final int argOffset -
functional
public final boolean functional -
file
-
line
protected final int line -
flags
protected final int flags -
cache
-
callType
-
NEGATE
-
-
Constructor Details
-
InvokeSite
public InvokeSite(MethodType type, String name, CallType callType, boolean literalClosure, int flags, String file, int line)
-
-
Method Details
-
testType
-
name
-
bootstrap
-
invoke
public IRubyObject invoke(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block) throws Throwable - Throws:
Throwable
-
invoke
public IRubyObject invoke(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) throws Throwable - Throws:
Throwable
-
fail
public IRubyObject fail(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block) throws Throwable Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.- Throws:
Throwable
-
failf
public IRubyObject failf(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) throws Throwable Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.- Throws:
Throwable
-
fail
public IRubyObject fail(ThreadContext context, IRubyObject caller, IRubyObject self, Block block) throws Throwable Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.- Throws:
Throwable
-
failf
Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.- Throws:
Throwable
-
fail
public IRubyObject fail(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, Block block) throws Throwable Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.- Throws:
Throwable
-
failf
public IRubyObject failf(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) throws Throwable Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.- Throws:
Throwable
-
fail
public IRubyObject fail(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, IRubyObject arg1, Block block) throws Throwable Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.- Throws:
Throwable
-
failf
public IRubyObject failf(ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, Block block) throws Throwable Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.- Throws:
Throwable
-
fail
public IRubyObject fail(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) throws Throwable Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.- Throws:
Throwable
-
failf
public IRubyObject failf(ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) throws Throwable Failover version uses a monomorphic cache and DynamicMethod.call, as in non-indy.- Throws:
Throwable
-
prepareBinder
public com.headius.invokebinder.Binder prepareBinder(boolean varargs) Prepare a binder for this call site's target, forcing varargs if specified- Parameters:
varargs
- whether to only call an arg-boxed variable arity path- Returns:
- the prepared binder
-
getHandle
protected MethodHandle getHandle(ThreadContext context, IRubyObject self, CacheEntry entry) throws Throwable - Throws:
Throwable
-
negate
public static IRubyObject negate(IRubyObject object, RubyNil nil, RubyBoolean.True tru, RubyBoolean.False fals) -
updateInvocationTarget
protected MethodHandle updateInvocationTarget(MethodHandle target, IRubyObject self, RubyModule testClass, DynamicMethod method, SwitchPoint switchPoint) Update the given call site using the new target, wrapping with appropriate bind and argument-juggling logic. Return a handle suitable for invoking with the site's original method type. -
testTarget
-
pollAndGetClass
-
setTarget
- Overrides:
setTarget
in classMutableCallSite
-
setInitialTarget
-
methodMissing
-
methodMissing
-
callMethodMissing
public static IRubyObject callMethodMissing(CacheEntry entry, CallType callType, ThreadContext context, IRubyObject self, RubyClass selfClass, String name, IRubyObject[] args, Block block) Variable arity method_missing invocation. Arity zero also passes through here. -
callMethodMissing
public static IRubyObject callMethodMissing(CacheEntry entry, CallType callType, ThreadContext context, IRubyObject self, RubyClass selfClass, String name, IRubyObject arg0, Block block) Arity one method_missing invocation -
callMethodMissing
public static IRubyObject callMethodMissing(CacheEntry entry, CallType callType, ThreadContext context, IRubyObject self, RubyClass selfClass, String name, IRubyObject arg0, IRubyObject arg1, Block block) Arity two method_missing invocation -
callMethodMissing
public static IRubyObject callMethodMissing(CacheEntry entry, CallType callType, ThreadContext context, IRubyObject self, RubyClass selfClass, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) Arity three method_missing invocation -
testClass
-
toString
-