Package org.jruby.ir.targets.simple
Class NormalInvocationCompiler
java.lang.Object
org.jruby.ir.targets.simple.NormalInvocationCompiler
- All Implemented Interfaces:
InvocationCompiler
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
asString
(AsStringInstr call, String scopeFieldName, String file) Coerces the receiver to a String using to_s, unless it is already a String Stack required: context, caller, receivervoid
void
invokeArrayDeref
(String file, String scopeFieldName, CallBase call) Invoke the array dereferencing method ([]) on an object other than self.void
invokeBlockGiven
(String methodName, String file) Invoke block_given? or iterator? with awareness of any built-in methods.void
invokeClassSuper
(String file, String name, int arity, boolean hasClosure, boolean literalClosure, boolean[] splatmap, int flags) Invoke a superclass method from a class context.void
Perform a === call appropriate for a case/when statement.void
invokeFrameName
(String methodName, String file) Invoke __method__ or __callee__ with awareness of any built-in methods.void
invokeInstanceSuper
(String file, String name, int arity, boolean hasClosure, boolean literalClosure, boolean[] splatmap, int flags) Invoke a superclass method from an instance context.void
invokeOther
(String file, String scopeFieldName, CallBase call, int arity) Invoke a method on an object other than self.void
invokeOtherOneFixnum
(String file, CallBase call, long fixnum) Invoke a fixnum-receiving method on an object other than self.void
invokeOtherOneFloat
(String file, CallBase call, double flote) Invoke a float-receiving method on an object other than self.void
invokeSelf
(String file, String scopeFieldName, CallBase call, int arity) Invoke a method on self.void
invokeUnresolvedSuper
(String file, String name, int arity, boolean hasClosure, boolean literalClosure, boolean[] splatmap, int flags) Invoke a superclass method from an unresolved context.void
invokeZSuper
(String file, String name, int arity, boolean hasClosure, boolean[] splatmap, int flags) Invoke a superclass method from a zsuper in a block.void
setCallInfo
(int flags) Sets the current callInfo, when it cannot be passed other ways Stack required: none
-
Field Details
-
SUPER_SPLAT_UNRESOLVED
-
SUPER_NOSPLAT_UNRESOLVED
-
SUPER_SPLAT_RESOLVED
-
SUPER_NOSPLAT_RESOLVED
-
-
Constructor Details
-
NormalInvocationCompiler
-
-
Method Details
-
invokeOther
Description copied from interface:InvocationCompiler
Invoke a method on an object other than self.Stack required: context, self, all arguments, optional block
- Specified by:
invokeOther
in interfaceInvocationCompiler
- Parameters:
call
- the call to be invoked
-
invokeArrayDeref
Description copied from interface:InvocationCompiler
Invoke the array dereferencing method ([]) on an object other than self.If this invokes against a Hash with a frozen string, it will follow an optimized path.
Stack required: context, self, target, arg0
- Specified by:
invokeArrayDeref
in interfaceInvocationCompiler
- Parameters:
file
-
-
invoke
-
invokeOtherOneFixnum
Description copied from interface:InvocationCompiler
Invoke a fixnum-receiving method on an object other than self.Stack required: context, self, receiver (fixnum will be handled separately)
- Specified by:
invokeOtherOneFixnum
in interfaceInvocationCompiler
-
invokeOtherOneFloat
Description copied from interface:InvocationCompiler
Invoke a float-receiving method on an object other than self.Stack required: context, self, receiver (float will be handled separately)
- Specified by:
invokeOtherOneFloat
in interfaceInvocationCompiler
-
invokeSelf
Description copied from interface:InvocationCompiler
Invoke a method on self. Stack required: context, caller, self, all arguments, optional block- Specified by:
invokeSelf
in interfaceInvocationCompiler
- Parameters:
file
- the filename of the script making this callcall
- to be invoked on selfarity
- of the call.
-
invokeInstanceSuper
public void invokeInstanceSuper(String file, String name, int arity, boolean hasClosure, boolean literalClosure, boolean[] splatmap, int flags) Description copied from interface:InvocationCompiler
Invoke a superclass method from an instance context.Stack required: context, caller, self, start class, arguments[, block]
- Specified by:
invokeInstanceSuper
in interfaceInvocationCompiler
- Parameters:
file
- the filename of the script making this callname
- name of the method to invokearity
- arity of the arguments on the stackhasClosure
- whether a block is passedliteralClosure
- whether the block passed is a literal closuresplatmap
- a map of arguments to be splatted back into arg listflags
-
-
invokeClassSuper
public void invokeClassSuper(String file, String name, int arity, boolean hasClosure, boolean literalClosure, boolean[] splatmap, int flags) Description copied from interface:InvocationCompiler
Invoke a superclass method from a class context.Stack required: context, caller, self, start class, arguments[, block]
- Specified by:
invokeClassSuper
in interfaceInvocationCompiler
- Parameters:
file
- the filename of the script making this callname
- name of the method to invokearity
- arity of the arguments on the stackhasClosure
- whether a block is passedliteralClosure
- whether the block passed is a literal closuresplatmap
- a map of arguments to be splatted back into arg listflags
-
-
invokeUnresolvedSuper
public void invokeUnresolvedSuper(String file, String name, int arity, boolean hasClosure, boolean literalClosure, boolean[] splatmap, int flags) Description copied from interface:InvocationCompiler
Invoke a superclass method from an unresolved context.Stack required: context, caller, self, arguments[, block]
- Specified by:
invokeUnresolvedSuper
in interfaceInvocationCompiler
- Parameters:
file
- the filename of the script making this callname
- name of the method to invokearity
- arity of the arguments on the stackhasClosure
- whether a block is passedliteralClosure
- whether the block passed is a literal closuresplatmap
- a map of arguments to be splatted back into arg listflags
-
-
invokeZSuper
public void invokeZSuper(String file, String name, int arity, boolean hasClosure, boolean[] splatmap, int flags) Description copied from interface:InvocationCompiler
Invoke a superclass method from a zsuper in a block.Stack required: context, caller, self, arguments[, block]
- Specified by:
invokeZSuper
in interfaceInvocationCompiler
- Parameters:
file
- the filename of the script making this callname
- name of the method to invokearity
- arity of the arguments on the stackhasClosure
- whether a block is passedsplatmap
- a map of arguments to be splatted back into arg listflags
-
-
invokeEQQ
Description copied from interface:InvocationCompiler
Perform a === call appropriate for a case/when statement. Stack required: context, case value, when value- Specified by:
invokeEQQ
in interfaceInvocationCompiler
-
asString
Description copied from interface:InvocationCompiler
Coerces the receiver to a String using to_s, unless it is already a String Stack required: context, caller, receiver- Specified by:
asString
in interfaceInvocationCompiler
-
setCallInfo
public void setCallInfo(int flags) Description copied from interface:InvocationCompiler
Sets the current callInfo, when it cannot be passed other ways Stack required: none- Specified by:
setCallInfo
in interfaceInvocationCompiler
-
invokeBlockGiven
Description copied from interface:InvocationCompiler
Invoke block_given? or iterator? with awareness of any built-in methods.- Specified by:
invokeBlockGiven
in interfaceInvocationCompiler
-
invokeFrameName
Description copied from interface:InvocationCompiler
Invoke __method__ or __callee__ with awareness of any built-in methods.- Specified by:
invokeFrameName
in interfaceInvocationCompiler
-