Package org.jruby.ir.runtime
Class IRRuntimeHelpers
java.lang.Object
org.jruby.ir.runtime.IRRuntimeHelpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaliasGlobalVariable(Ruby runtime, Object newName, Object oldName) static booleananyTrue(boolean[] booleans) static intarrayLength(RubyArray array) static RubyStringasString(ThreadContext context, IRubyObject caller, IRubyObject target, CallSite site) asString using a given call sitestatic IRubyObjectblockGivenOrCall(ThreadContext context, IRubyObject self, FunctionalCachingCallSite blockGivenSite, Object blk) static boolean[]buildSplatMap(Operand[] args) static IRubyObjectcallOptimizedAref(ThreadContext context, IRubyObject caller, IRubyObject target, RubyString keyStr, CallSite site) static voidcallTrace(ThreadContext context, Block selfBlock, RubyEvent event, String name, String filename, int line) static voidcallTrace(ThreadContext context, IRubyObject selfClass, RubyEvent event, String name, String filename, int line) static voidcallTraceHooks(ThreadContext context, Block selfBlock, RubyEvent event, String name, String filename, int line) static voidcheckArity(ThreadContext context, StaticScope scope, Object[] args, Object keywords, int required, int opt, boolean rest, int restKey, Block block) static voidcheckAritySpecificArgs(ThreadContext context, StaticScope scope, Object[] args, int required, int opt, boolean rest, int restKey, Block block) static voidcheckForExtraUnwantedKeywordArgs(ThreadContext context, StaticScope scope, RubyHash keywordArgs) static voidcheckForLJE(ThreadContext context, DynamicScope currentScope, boolean definedWithinMethod, Block block) static RubyStringchillLiteralString(RubyString string) static IRubyObjectclassSuper(ThreadContext context, IRubyObject self, String id, RubyModule definingModule, IRubyObject[] args, Block block) static IRubyObjectclassSuperIter(ThreadContext context, IRubyObject self, String id, RubyModule definingModule, IRubyObject[] args, Block block) static IRubyObjectclassSuperIterSplatArgs(ThreadContext context, IRubyObject self, String methodName, RubyModule definingModule, IRubyObject[] args, Block block, boolean[] splatMap) static IRubyObjectclassSuperSplatArgs(ThreadContext context, IRubyObject self, String methodName, RubyModule definingModule, IRubyObject[] args, Block block, boolean[] splatMap) static RubyHashconstructHashFromArray(ThreadContext context, IRubyObject[] pairs) static IRubyObject[]convertValueIntoArgArray(ThreadContext context, RubyArray array, Signature signature) static IRubyObject[]convertValueIntoArgArray(ThreadContext context, IRubyObject value, Signature signature) static IRScopedecodeScopeFromBytes(Ruby runtime, byte[] scopeBytes, String filename) static boolean[]decodeSplatmap(String splatmapString) static voiddefCompiledClassMethod(ThreadContext context, MethodHandle variable, MethodHandle specific, int specificArity, String id, int line, StaticScope scope, String encodedArgumentDescriptors, IRubyObject obj, boolean maybeRefined, boolean receivesKeywordArgs, boolean needsToFindImplementer) static voiddefCompiledClassMethod(ThreadContext context, MethodHandle handle, String id, int line, StaticScope scope, String encodedArgumentDescriptors, IRubyObject obj, boolean maybeRefined, boolean receivesKeywordArgs, boolean needsToFindImplementer) static voiddefCompiledInstanceMethod(ThreadContext context, MethodHandle variable, MethodHandle specific, int specificArity, String id, int line, StaticScope scope, String encodedArgumentDescriptors, DynamicScope currDynScope, IRubyObject self, boolean maybeRefined, boolean receivesKeywordArgs, boolean needsToFindImplementer) static voiddefCompiledInstanceMethod(ThreadContext context, MethodHandle handle, String id, int line, StaticScope scope, String encodedArgumentDescriptors, DynamicScope currDynScope, IRubyObject self, boolean maybeRefined, boolean receivesKeywordArgs, boolean needsToFindImplementer) static voiddefineAlias(ThreadContext context, IRubyObject self, DynamicScope currDynScope, IRubyObject newName, IRubyObject oldName) static voiddefInterpretedClassMethod(ThreadContext context, IRScope method, IRubyObject obj) static voiddefInterpretedInstanceMethod(ThreadContext context, IRScope method, DynamicScope currDynScope, IRubyObject self) static IRubyObjectdupIfKeywordRestAtCallsite(ThreadContext context, IRubyObject arg) Methods like Kernel#send if it receives a key-splatted value at a send site (send :foo, **h) it will dup h.static RubyHashdupKwargsHashAndPopulateFromArray(ThreadContext context, RubyHash dupHash, IRubyObject[] pairs) static StringencodeSplatmap(boolean[] splatmap) static IRubyObjectextractOptionalArgument(RubyArray rubyArray, int minArgsLength, int index) static booleanfeq(double v1, double v2) static booleanfgt(double v1, double v2) static RubyModulefindInstanceMethodContainer(ThreadContext context, DynamicScope currDynScope, IRubyObject self) static booleanflt(double v1, double v2) static RubyStringfreezeLiteralString(RubyString string) static RubyFixnumgetArgScopeDepth(ThreadContext context, StaticScope currScope) static RubyClassgetArray(ThreadContext context) static BlockgetBlockFromObject(ThreadContext context, Object value) static IRubyObjectgetClassVariable(ThreadContext context, RubyModule module, String id) static RubyModulegetCurrentClassBase(ThreadContext context, IRubyObject self) Find the base class or "cbase" used for various class-level operations.static RubyStringgetFileNameStringFromScope(ThreadContext context, StaticScope currScope) static BlockgetFrameBlockFromBlock(Block block) static StringgetFrameNameFromBlock(Block block) static RubyClassgetHash(ThreadContext context) static RubyModulegetModuleFromScope(ThreadContext context, StaticScope scope, IRubyObject arg) static RubyClassgetObject(ThreadContext context) static IRubyObjectgetPreArgSafe(ThreadContext context, IRubyObject[] args, int argIndex) static BlockgetRefinedBlockFromObject(ThreadContext context, StaticScope scope, Object value) static RubyClassgetStandardError(ThreadContext context) static RubyClassgetSymbol(ThreadContext context) static VariableAccessorgetVariableAccessorForRead(IRubyObject object, String name) static VariableAccessorgetVariableAccessorForWrite(IRubyObject object, String name) static IRubyObjecthandleBreakAndReturnsInLambdas(ThreadContext context, DynamicScope dynScope, Object exc, Block block) static IRubyObjecthandleNonlocalReturn(DynamicScope currentScope, Object rjExc) static IRubyObjecthandlePropagatedBreak(ThreadContext context, DynamicScope dynScope, Object bjExc) static IRubyObjecthashCheck(ThreadContext context, IRubyObject hash) static booleanieq(long v1, long v2) static booleanigt(long v1, long v2) static booleanilt(long v1, long v2) static IRubyObjectinheritedSearchConst(ThreadContext context, IRubyObject cmVal, String constName, boolean noPrivateConsts) static IRubyObjectinitiateBreak(ThreadContext context, DynamicScope dynScope, IRubyObject breakValue, Block block) static IRubyObjectinitiateNonLocalReturn(DynamicScope currentScope, Block block, IRubyObject returnValue) static booleaninLambda(Block.Type blockType) static booleaninMethod(Block.Type blockType) static booleaninNonMethodBodyLambda(StaticScope scope, Block.Type blockType) static booleaninProc(Block.Type blockType) static booleanstatic IRubyObjectinstanceSuper(ThreadContext context, IRubyObject self, String id, RubyModule definingModule, IRubyObject[] args, Block block) static IRubyObjectinstanceSuperIter(ThreadContext context, IRubyObject self, String id, RubyModule definingModule, IRubyObject[] args, Block block) static IRubyObjectinstanceSuperIterSplatArgs(ThreadContext context, IRubyObject self, String methodName, RubyModule definingModule, IRubyObject[] args, Block block, boolean[] splatMap) static IRubyObjectinstanceSuperSplatArgs(ThreadContext context, IRubyObject self, String methodName, RubyModule definingModule, IRubyObject[] args, Block block, boolean[] splatMap) static IRubyObjectinvokeModuleBody(ThreadContext context, DynamicMethod method) static IRubyObjectirNot(ThreadContext context, IRubyObject obj) static IRubyObjectirReqdArgMultipleAsgn(ThreadContext context, RubyArray rubyArray, int preArgsCount, int index, int postArgsCount) static intirReqdArgMultipleAsgnIndex(int n, int preArgsCount, int index, int postArgsCount) static RubyArrayirSplat(ThreadContext context, IRubyObject ary) static IRubyObjectirToAry(ThreadContext context, IRubyObject value) static RubyBooleanisBlockGiven(ThreadContext context, Object blk) static booleanisDebug()static IRubyObjectisDefinedBackref(ThreadContext context, IRubyObject definedMessage) static IRubyObjectisDefinedCall(ThreadContext context, IRubyObject self, IRubyObject receiver, String name, IRubyObject definedMessage) static IRubyObjectisDefinedClassVar(ThreadContext context, RubyModule receiver, String name, IRubyObject definedMessage) static IRubyObjectisDefinedConstantOrMethod(ThreadContext context, IRubyObject receiver, RubyString name, IRubyObject definedConstantMessage, IRubyObject definedMethodMessage) static IRubyObjectisDefinedGlobal(ThreadContext context, String name, IRubyObject definedMessage) static IRubyObjectisDefinedMethod(ThreadContext context, IRubyObject receiver, String name, boolean checkIfPublic, IRubyObject definedMessage) static IRubyObjectisDefinedNthRef(ThreadContext context, int matchNumber, IRubyObject definedMessage) static IRubyObjectisDefinedSuper(ThreadContext context, IRubyObject receiver, String frameName, RubyModule frameClass, IRubyObject definedMessage) static IRubyObjectisDefinedSuper(ThreadContext context, IRubyObject receiver, IRubyObject definedMessage) static IRubyObjectisEQQ(ThreadContext context, IRubyObject receiver, IRubyObject value, CallSite callSite, boolean splattedValue) static IRubyObjectisExceptionHandled(ThreadContext context, IRubyObject excType, Object excObj) static IRubyObjectisHashEmpty(ThreadContext context, IRubyObject hash) static IRubyObjectkeywordRestOnHash(ThreadContext context, IRubyObject rest) static IRubyObjectlexicalSearchConst(ThreadContext context, StaticScope staticScope, String constName) static IRubyObjectmatch3(ThreadContext context, RubyRegexp regexp, IRubyObject argValue) static IRubyObjectmergeKeywordArguments(ThreadContext context, IRubyObject restKwarg, IRubyObject explicitKwarg, boolean checkForDuplicates) static booleanneedsSplatting(boolean[] splatmap) static RubyArraynewArray(ThreadContext context) static RubyArraynewArray(ThreadContext context, IRubyObject obj) static RubyArraynewArray(ThreadContext context, IRubyObject obj0, IRubyObject obj1) static final ByteListnewByteListFromRaw(Ruby runtime, String str, String encoding) static DynamicMethodnewCompiledClassBody(ThreadContext context, MethodHandle handle, String id, int line, StaticScope scope, Object container, Object superClass, boolean maybeRefined) static DynamicMethodnewCompiledMetaClass(ThreadContext context, MethodHandle handle, StaticScope scope, IRubyObject obj, int line, boolean refinements, boolean dynscopeEliminated) Construct a new DynamicMethod to wrap the given IRModuleBody and singletonizable object.static DynamicMethodnewCompiledModuleBody(ThreadContext context, MethodHandle handle, String id, int line, StaticScope scope, Object rubyContainer, boolean maybeRefined) static RubyComplexnewComplexRaw(ThreadContext context, IRubyObject i) static RubySymbolnewDSymbol(ThreadContext context, IRubyObject symbol) static RubyRegexpnewDynamicRegexp(ThreadContext context, IRubyObject[] pieces, int embeddedOptions) static RubyRegexpnewDynamicRegexp(ThreadContext context, IRubyObject arg0, int embeddedOptions) static RubyRegexpnewDynamicRegexp(ThreadContext context, IRubyObject arg0, IRubyObject arg1, int embeddedOptions) static RubyRegexpnewDynamicRegexp(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, int embeddedOptions) static RubyRegexpnewDynamicRegexp(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, int embeddedOptions) static RubyRegexpnewDynamicRegexp(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, int embeddedOptions) static BindingnewFrameScopeBinding(ThreadContext context, IRubyObject self, DynamicScope scope) static RubyStringnewFrozenString(ThreadContext context, ByteList bytelist, int coderange) static RubyStringnewFrozenString(ThreadContext context, ByteList bytelist, int coderange, String file, int line) static RubyStringnewFrozenStringFromRaw(ThreadContext context, String str, String encoding, int cr) static RubyStringnewFrozenStringFromRaw(ThreadContext context, String str, String encoding, int cr, String file, int line) static FunctionalCachingCallSitestatic DynamicMethodnewInterpretedMetaClass(ThreadContext context, IRScope metaClassBody, IRubyObject obj) Construct a new DynamicMethod to wrap the given IRModuleBody and singletonizable object.static RubyProcnewLambdaProc(ThreadContext context, Block block) static RubyRegexpnewLiteralRegexp(ThreadContext context, ByteList source, int embeddedOptions) static RubyRegexpnewLiteralRegexp(ThreadContext context, ByteList source, RegexpOptions options) static MonomorphicCallSitenewMonomorphicCallSite(String name) static IRubyObjectstatic IRubyObjectnewProc(ThreadContext context, Block block) static ProfilingCachingCallSitenewProfilingCachingCallSite(CallType callType, String name, IRScope scope, long callSiteId) static RubyRationalnewRationalCanonicalize(ThreadContext context, IRubyObject num, IRubyObject den) static RefinedCachingCallSitenewRefinedCachingCallSite(String name, StaticScope scope, String callType) static RaiseExceptionnewRequiredKeywordArgumentError(ThreadContext context, String id) static RubyModulenewRubyClassFromIR(ThreadContext context, String id, StaticScope scope, Object superClass, Object container, boolean maybeRefined) static RubyModulenewRubyModuleFromIR(ThreadContext context, String id, StaticScope scope, Object rubyContainer, boolean maybeRefined) static RubyProcnewSymbolProc(ThreadContext context, RubySymbol symbol) Create a new Symbol.to_proc for the given symbol name and encoding.static RubyProcnewSymbolProc(ThreadContext context, ByteList value) Create a new Symbol.to_proc for the given symbol name and encoding.static VariableCachingCallSitestatic IRubyObjectnthMatch(ThreadContext context, int matchNumber) static BlockprepareBlock(ThreadContext context, IRubyObject self, DynamicScope scope, BlockBody body) static IRubyObject[]prepareBlockArgs(ThreadContext context, Block block, IRubyObject[] args, boolean usesKwArgs, boolean ruby2Keywords) static IRubyObject[]prepareFixedBlockArgs(ThreadContext context, Block block, IRubyObject[] args) static IRubyObject[]prepareNoBlockArgs(ThreadContext context, Block block, IRubyObject[] args) Check whether incoming args are zero length for a lambda, and no-op for non-lambda.static DynamicScopeprepareScriptScope(ThreadContext context, StaticScope scope) static IRubyObject[]prepareSingleBlockArgs(ThreadContext context, Block block, IRubyObject[] args) static DynamicScopepushBlockDynamicScopeIfNeeded(ThreadContext context, Block block, boolean pushNewDynScope, boolean reuseParentDynScope) static DynamicScopepushBlockDynamicScopeNew(ThreadContext context, Block block) static DynamicScopepushBlockDynamicScopeReuse(ThreadContext context, Block block) static voidpushExitBlock(ThreadContext context, Object blk) static voidpushExitBlock(ThreadContext context, Block blk) static voidputClassVariable(ThreadContext context, IRubyObject self, RubyModule module, String id, IRubyObject value) static voidputConst(ThreadContext context, IRubyObject self, IRubyObject module, String id, IRubyObject value) static voidputConst(ThreadContext context, IRubyObject self, IRubyObject module, String id, IRubyObject value, StaticScope scope, int line) static IRubyObjectreceiveKeywordArg(IRubyObject keywords, RubySymbol key) static IRubyObjectreceiveKeywordArg(ThreadContext context, IRubyObject keywords, String id) static IRubyObjectreceiveKeywordRestArg(ThreadContext context, IRubyObject keywords) static IRubyObjectreceiveKeywords(ThreadContext context, IRubyObject[] args, boolean hasRestArgs, boolean acceptsKeywords, boolean ruby2_keywords_method) Handle incoming keyword arguments given the receiver's rest arg, keyword acceptance, and need for ruby2_keywords.static IRubyObjectreceiveNormalKeywordsNoRestNoKeywords(ThreadContext context, IRubyObject[] args) Simplified receiveKeywords when: receiver is not a ruby2_keywords method.static IRubyObjectreceiveOptArg(IRubyObject[] args, IRubyObject keywords, int requiredArgs, int preArgs, int argIndex) static IRubyObjectreceivePostReqdArg(ThreadContext context, IRubyObject[] args, IRubyObject keywords, int pre, int opt, boolean rest, int post, int argIndex) static IRubyObjectreceiveRestArg(ThreadContext context, IRubyObject[] args, IRubyObject keywords, int required, int argIndex) static IRubyObjectreceiveSpecificArityKeywords(ThreadContext context, IRubyObject last, boolean ruby2Keywords) static RubyEncodingretrieveEncoding(ThreadContext context, String name) static org.jcodings.EncodingretrieveJCodingsEncoding(ThreadContext context, String name) static IRubyObjectreturnOrRethrowSavedException(ThreadContext context, IRubyObject value) static IRubyObjectsearchConst(ThreadContext context, StaticScope staticScope, String constName, boolean noPrivateConsts) static voidsetCallInfo(ThreadContext context, int flags) static IRubyObjectsetCapturedVar(ThreadContext context, IRubyObject matchRes, String id) static IRubyObjectsetInstanceVariable(IRubyObject self, IRubyObject value, String name) static booleanshouldPrintIR(Ruby runtime) If the ir.print property is enabled and we are not booting, or the ir.print.all property is enabled and we are booting, return true to indicate IR should be printed.static booleanshouldPrintScope(IRScope scope) Check if the scope matches the configured ir.print.pattern, or if no pattern is set.static IRubyObject[]singleBlockArgToArray(IRubyObject value) static IRubyObject[]splatArguments(IRubyObject[] args, boolean[] splatMap) static RubyArraysplatArray(ThreadContext context, IRubyObject ary) Call to_ary to get Array or die typing.static RubyArraysplatArray(ThreadContext context, IRubyObject ary, boolean dupArray) Call to_ary to get Array or die typing.static RubyArraysplatArrayDup(ThreadContext context, IRubyObject ary) Call to_ary to get Array or die typing.static IRubyObjectsvalue(ThreadContext context, Object val) static IRubyObject[]toAry(ThreadContext context, IRubyObject[] args) static voidtraceRaise(ThreadContext context) static voidtraceRescue(ThreadContext context, String file, int line) static final org.objectweb.asm.Type[]typesFromSignature(com.headius.invokebinder.Signature signature) static longunboxFixnum(IRubyObject val) static doubleunboxFloat(IRubyObject val) static IRubyObjectstatic IRubyObjectundefMethod(ThreadContext context, Object nameArg, DynamicScope currDynScope, IRubyObject self) static IRubyObjectunresolvedSuper(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjectunresolvedSuperIter(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjectunresolvedSuperIterSplatArgs(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block, boolean[] splatMap) static IRubyObjectunresolvedSuperSplatArgs(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block, boolean[] splatMap) static ObjectunwrapRubyException(Object excObj) static IRubyObjectupdateBlockState(Block block, IRubyObject self) static voidupdateCoverage(ThreadContext context, String filename, int line) Update coverage data for the given file and zero-based line number.static IRubyObjectuseBindingSelf(Binding binding) static voidwarnSetConstInRefinement(ThreadContext context, IRubyObject self) static IRubyObjectyield(ThreadContext context, Block b, IRubyObject yieldVal, boolean unwrapArray) static IRubyObjectyieldSpecific(ThreadContext context, Block b) static IRubyObjectyieldValues(ThreadContext context, Block blk, IRubyObject[] args) static IRubyObjectzSuper(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjectzSuperSplatArgs(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block, boolean[] splatMap)
-
Constructor Details
-
IRRuntimeHelpers
public IRRuntimeHelpers()
-
-
Method Details
-
inProfileMode
public static boolean inProfileMode() -
isDebug
public static boolean isDebug() -
inNonMethodBodyLambda
-
inMethod
-
inLambda
-
inProc
-
checkForLJE
public static void checkForLJE(ThreadContext context, DynamicScope currentScope, boolean definedWithinMethod, Block block) -
initiateNonLocalReturn
public static IRubyObject initiateNonLocalReturn(DynamicScope currentScope, Block block, IRubyObject returnValue) -
handleNonlocalReturn
public static IRubyObject handleNonlocalReturn(DynamicScope currentScope, Object rjExc) throws RuntimeException - Throws:
RuntimeException
-
initiateBreak
public static IRubyObject initiateBreak(ThreadContext context, DynamicScope dynScope, IRubyObject breakValue, Block block) throws RuntimeException - Throws:
RuntimeException
-
handleBreakAndReturnsInLambdas
public static IRubyObject handleBreakAndReturnsInLambdas(ThreadContext context, DynamicScope dynScope, Object exc, Block block) throws RuntimeException - Throws:
RuntimeException
-
returnOrRethrowSavedException
-
handlePropagatedBreak
public static IRubyObject handlePropagatedBreak(ThreadContext context, DynamicScope dynScope, Object bjExc) -
undefMethod
public static IRubyObject undefMethod(ThreadContext context, Object nameArg, DynamicScope currDynScope, IRubyObject self) -
unboxFloat
-
unboxFixnum
-
flt
public static boolean flt(double v1, double v2) -
fgt
public static boolean fgt(double v1, double v2) -
feq
public static boolean feq(double v1, double v2) -
ilt
public static boolean ilt(long v1, long v2) -
igt
public static boolean igt(long v1, long v2) -
ieq
public static boolean ieq(long v1, long v2) -
unwrapRubyException
-
isExceptionHandled
public static IRubyObject isExceptionHandled(ThreadContext context, IRubyObject excType, Object excObj) -
isEQQ
public static IRubyObject isEQQ(ThreadContext context, IRubyObject receiver, IRubyObject value, CallSite callSite, boolean splattedValue) -
newProc
-
newProc
-
newLambdaProc
-
yield
public static IRubyObject yield(ThreadContext context, Block b, IRubyObject yieldVal, boolean unwrapArray) -
yieldSpecific
-
yieldValues
-
convertValueIntoArgArray
public static IRubyObject[] convertValueIntoArgArray(ThreadContext context, IRubyObject value, Signature signature) -
convertValueIntoArgArray
public static IRubyObject[] convertValueIntoArgArray(ThreadContext context, RubyArray array, Signature signature) -
getBlockFromObject
-
getRefinedBlockFromObject
public static Block getRefinedBlockFromObject(ThreadContext context, StaticScope scope, Object value) -
checkAritySpecificArgs
public static void checkAritySpecificArgs(ThreadContext context, StaticScope scope, Object[] args, int required, int opt, boolean rest, int restKey, Block block) -
checkArity
public static void checkArity(ThreadContext context, StaticScope scope, Object[] args, Object keywords, int required, int opt, boolean rest, int restKey, Block block) -
shouldPrintIR
If the ir.print property is enabled and we are not booting, or the ir.print.all property is enabled and we are booting, return true to indicate IR should be printed.- Parameters:
runtime- the current runtime- Returns:
- whether to print IR
-
shouldPrintScope
Check if the scope matches the configured ir.print.pattern, or if no pattern is set.- Parameters:
scope- the scope to match- Returns:
- whether to print the scope
-
updateCoverage
Update coverage data for the given file and zero-based line number.- Parameters:
context-filename-line-
-
hashCheck
-
isHashEmpty
-
undefined
-
receiveSpecificArityKeywords
public static IRubyObject receiveSpecificArityKeywords(ThreadContext context, IRubyObject last, boolean ruby2Keywords) -
receiveNormalKeywordsNoRestNoKeywords
public static IRubyObject receiveNormalKeywordsNoRestNoKeywords(ThreadContext context, IRubyObject[] args) Simplified receiveKeywords when: receiver is not a ruby2_keywords method. receiver does not accept keywords. there's no rest argument.- Parameters:
context-args-- Returns:
- the prepared kwargs hash, or UNDEFINED as a sigil for no kwargs
-
receiveKeywords
public static IRubyObject receiveKeywords(ThreadContext context, IRubyObject[] args, boolean hasRestArgs, boolean acceptsKeywords, boolean ruby2_keywords_method) Handle incoming keyword arguments given the receiver's rest arg, keyword acceptance, and need for ruby2_keywords. We return as undefined and not null when no kwarg since null gets auto-converted to nil because temp vars do this to work around no explicit initialization of temp values (e.g. they might start as null).- Parameters:
context-args-hasRestArgs-acceptsKeywords-ruby2_keywords_method-- Returns:
-
dupIfKeywordRestAtCallsite
Methods like Kernel#send if it receives a key-splatted value at a send site (send :foo, **h) it will dup h. -
setCallInfo
-
checkForExtraUnwantedKeywordArgs
public static void checkForExtraUnwantedKeywordArgs(ThreadContext context, StaticScope scope, RubyHash keywordArgs) -
prepareScriptScope
-
blockGivenOrCall
public static IRubyObject blockGivenOrCall(ThreadContext context, IRubyObject self, FunctionalCachingCallSite blockGivenSite, Object blk) -
match3
-
extractOptionalArgument
public static IRubyObject extractOptionalArgument(RubyArray rubyArray, int minArgsLength, int index) -
isDefinedBackref
-
isDefinedGlobal
public static IRubyObject isDefinedGlobal(ThreadContext context, String name, IRubyObject definedMessage) -
isDefinedNthRef
public static IRubyObject isDefinedNthRef(ThreadContext context, int matchNumber, IRubyObject definedMessage) -
isDefinedClassVar
public static IRubyObject isDefinedClassVar(ThreadContext context, RubyModule receiver, String name, IRubyObject definedMessage) -
isDefinedCall
public static IRubyObject isDefinedCall(ThreadContext context, IRubyObject self, IRubyObject receiver, String name, IRubyObject definedMessage) -
isDefinedConstantOrMethod
public static IRubyObject isDefinedConstantOrMethod(ThreadContext context, IRubyObject receiver, RubyString name, IRubyObject definedConstantMessage, IRubyObject definedMethodMessage) -
isDefinedMethod
public static IRubyObject isDefinedMethod(ThreadContext context, IRubyObject receiver, String name, boolean checkIfPublic, IRubyObject definedMessage) -
isDefinedSuper
public static IRubyObject isDefinedSuper(ThreadContext context, IRubyObject receiver, IRubyObject definedMessage) -
isDefinedSuper
public static IRubyObject isDefinedSuper(ThreadContext context, IRubyObject receiver, String frameName, RubyModule frameClass, IRubyObject definedMessage) -
nthMatch
-
defineAlias
public static void defineAlias(ThreadContext context, IRubyObject self, DynamicScope currDynScope, IRubyObject newName, IRubyObject oldName) -
getCurrentClassBase
Find the base class or "cbase" used for various class-level operations. This should be equivalent to "cbase" in CRuby, as retrieved by vm_get_cbase. SeeGetClassVarContainerModuleInstrandRubyKernel.autoload(ThreadContext, IRubyObject, IRubyObject, IRubyObject)for example usage.- Parameters:
context- the current contextself- the current self object- Returns:
- the instance method definition target, or the "cbase" for other purposes
-
getModuleFromScope
public static RubyModule getModuleFromScope(ThreadContext context, StaticScope scope, IRubyObject arg) -
mergeKeywordArguments
public static IRubyObject mergeKeywordArguments(ThreadContext context, IRubyObject restKwarg, IRubyObject explicitKwarg, boolean checkForDuplicates) -
findInstanceMethodContainer
public static RubyModule findInstanceMethodContainer(ThreadContext context, DynamicScope currDynScope, IRubyObject self) -
isBlockGiven
-
receiveRestArg
public static IRubyObject receiveRestArg(ThreadContext context, IRubyObject[] args, IRubyObject keywords, int required, int argIndex) -
receivePostReqdArg
public static IRubyObject receivePostReqdArg(ThreadContext context, IRubyObject[] args, IRubyObject keywords, int pre, int opt, boolean rest, int post, int argIndex) -
receiveOptArg
public static IRubyObject receiveOptArg(IRubyObject[] args, IRubyObject keywords, int requiredArgs, int preArgs, int argIndex) -
getPreArgSafe
-
receiveKeywordArg
-
receiveKeywordArg
-
keywordRestOnHash
-
receiveKeywordRestArg
-
setCapturedVar
-
instanceSuperSplatArgs
public static IRubyObject instanceSuperSplatArgs(ThreadContext context, IRubyObject self, String methodName, RubyModule definingModule, IRubyObject[] args, Block block, boolean[] splatMap) -
instanceSuperIterSplatArgs
public static IRubyObject instanceSuperIterSplatArgs(ThreadContext context, IRubyObject self, String methodName, RubyModule definingModule, IRubyObject[] args, Block block, boolean[] splatMap) -
instanceSuper
public static IRubyObject instanceSuper(ThreadContext context, IRubyObject self, String id, RubyModule definingModule, IRubyObject[] args, Block block) -
instanceSuperIter
public static IRubyObject instanceSuperIter(ThreadContext context, IRubyObject self, String id, RubyModule definingModule, IRubyObject[] args, Block block) -
classSuperSplatArgs
public static IRubyObject classSuperSplatArgs(ThreadContext context, IRubyObject self, String methodName, RubyModule definingModule, IRubyObject[] args, Block block, boolean[] splatMap) -
classSuperIterSplatArgs
public static IRubyObject classSuperIterSplatArgs(ThreadContext context, IRubyObject self, String methodName, RubyModule definingModule, IRubyObject[] args, Block block, boolean[] splatMap) -
classSuper
public static IRubyObject classSuper(ThreadContext context, IRubyObject self, String id, RubyModule definingModule, IRubyObject[] args, Block block) -
classSuperIter
public static IRubyObject classSuperIter(ThreadContext context, IRubyObject self, String id, RubyModule definingModule, IRubyObject[] args, Block block) -
unresolvedSuperSplatArgs
public static IRubyObject unresolvedSuperSplatArgs(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block, boolean[] splatMap) -
unresolvedSuperIterSplatArgs
public static IRubyObject unresolvedSuperIterSplatArgs(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block, boolean[] splatMap) -
unresolvedSuper
public static IRubyObject unresolvedSuper(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
unresolvedSuperIter
public static IRubyObject unresolvedSuperIter(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
zSuperSplatArgs
public static IRubyObject zSuperSplatArgs(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block, boolean[] splatMap) -
zSuper
public static IRubyObject zSuper(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
splatArguments
-
encodeSplatmap
-
decodeSplatmap
-
buildSplatMap
-
anyTrue
public static boolean anyTrue(boolean[] booleans) -
needsSplatting
public static boolean needsSplatting(boolean[] splatmap) -
typesFromSignature
public static final org.objectweb.asm.Type[] typesFromSignature(com.headius.invokebinder.Signature signature) -
newFrozenStringFromRaw
public static RubyString newFrozenStringFromRaw(ThreadContext context, String str, String encoding, int cr, String file, int line) -
newFrozenStringFromRaw
public static RubyString newFrozenStringFromRaw(ThreadContext context, String str, String encoding, int cr) -
newByteListFromRaw
-
retrieveEncoding
-
retrieveJCodingsEncoding
-
constructHashFromArray
-
dupKwargsHashAndPopulateFromArray
public static RubyHash dupKwargsHashAndPopulateFromArray(ThreadContext context, RubyHash dupHash, IRubyObject[] pairs) -
searchConst
public static IRubyObject searchConst(ThreadContext context, StaticScope staticScope, String constName, boolean noPrivateConsts) -
inheritedSearchConst
public static IRubyObject inheritedSearchConst(ThreadContext context, IRubyObject cmVal, String constName, boolean noPrivateConsts) -
lexicalSearchConst
public static IRubyObject lexicalSearchConst(ThreadContext context, StaticScope staticScope, String constName) -
setInstanceVariable
-
newInterpretedMetaClass
public static DynamicMethod newInterpretedMetaClass(ThreadContext context, IRScope metaClassBody, IRubyObject obj) Construct a new DynamicMethod to wrap the given IRModuleBody and singletonizable object. Used by interpreter. -
newCompiledMetaClass
public static DynamicMethod newCompiledMetaClass(ThreadContext context, MethodHandle handle, StaticScope scope, IRubyObject obj, int line, boolean refinements, boolean dynscopeEliminated) Construct a new DynamicMethod to wrap the given IRModuleBody and singletonizable object. Used by JIT. -
newCompiledModuleBody
public static DynamicMethod newCompiledModuleBody(ThreadContext context, MethodHandle handle, String id, int line, StaticScope scope, Object rubyContainer, boolean maybeRefined) -
newRubyModuleFromIR
public static RubyModule newRubyModuleFromIR(ThreadContext context, String id, StaticScope scope, Object rubyContainer, boolean maybeRefined) -
newCompiledClassBody
public static DynamicMethod newCompiledClassBody(ThreadContext context, MethodHandle handle, String id, int line, StaticScope scope, Object container, Object superClass, boolean maybeRefined) -
newRubyClassFromIR
public static RubyModule newRubyClassFromIR(ThreadContext context, String id, StaticScope scope, Object superClass, Object container, boolean maybeRefined) -
defInterpretedClassMethod
public static void defInterpretedClassMethod(ThreadContext context, IRScope method, IRubyObject obj) -
defCompiledClassMethod
public static void defCompiledClassMethod(ThreadContext context, MethodHandle handle, String id, int line, StaticScope scope, String encodedArgumentDescriptors, IRubyObject obj, boolean maybeRefined, boolean receivesKeywordArgs, boolean needsToFindImplementer) -
defCompiledClassMethod
public static void defCompiledClassMethod(ThreadContext context, MethodHandle variable, MethodHandle specific, int specificArity, String id, int line, StaticScope scope, String encodedArgumentDescriptors, IRubyObject obj, boolean maybeRefined, boolean receivesKeywordArgs, boolean needsToFindImplementer) -
defInterpretedInstanceMethod
public static void defInterpretedInstanceMethod(ThreadContext context, IRScope method, DynamicScope currDynScope, IRubyObject self) -
defCompiledInstanceMethod
public static void defCompiledInstanceMethod(ThreadContext context, MethodHandle handle, String id, int line, StaticScope scope, String encodedArgumentDescriptors, DynamicScope currDynScope, IRubyObject self, boolean maybeRefined, boolean receivesKeywordArgs, boolean needsToFindImplementer) -
defCompiledInstanceMethod
public static void defCompiledInstanceMethod(ThreadContext context, MethodHandle variable, MethodHandle specific, int specificArity, String id, int line, StaticScope scope, String encodedArgumentDescriptors, DynamicScope currDynScope, IRubyObject self, boolean maybeRefined, boolean receivesKeywordArgs, boolean needsToFindImplementer) -
invokeModuleBody
-
newDynamicRegexp
public static RubyRegexp newDynamicRegexp(ThreadContext context, IRubyObject[] pieces, int embeddedOptions) -
newDynamicRegexp
public static RubyRegexp newDynamicRegexp(ThreadContext context, IRubyObject arg0, int embeddedOptions) -
newDynamicRegexp
public static RubyRegexp newDynamicRegexp(ThreadContext context, IRubyObject arg0, IRubyObject arg1, int embeddedOptions) -
newDynamicRegexp
public static RubyRegexp newDynamicRegexp(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, int embeddedOptions) -
newDynamicRegexp
public static RubyRegexp newDynamicRegexp(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, int embeddedOptions) -
newDynamicRegexp
public static RubyRegexp newDynamicRegexp(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, int embeddedOptions) -
newLiteralRegexp
public static RubyRegexp newLiteralRegexp(ThreadContext context, ByteList source, RegexpOptions options) -
newLiteralRegexp
public static RubyRegexp newLiteralRegexp(ThreadContext context, ByteList source, int embeddedOptions) -
irSplat
-
splatArray
Call to_ary to get Array or die typing. The optionally dup it if specified. Some conditional cases in compiler we know we are safe in not-duping. This method is the same impl as MRIs splatarray instr in the YARV instruction set. -
splatArray
Call to_ary to get Array or die typing. The optionally dup it if specified. Some conditional cases in compiler we know we are safe in not-duping. This method is the same impl as MRIs splatarray instr in the YARV instruction set. -
splatArrayDup
Call to_ary to get Array or die typing. The optionally dup it if specified. Some conditional cases in compiler we know we are safe in not-duping. This method is the same impl as MRIs splatarray instr in the YARV instruction set. -
irToAry
-
irReqdArgMultipleAsgnIndex
public static int irReqdArgMultipleAsgnIndex(int n, int preArgsCount, int index, int postArgsCount) -
irReqdArgMultipleAsgn
public static IRubyObject irReqdArgMultipleAsgn(ThreadContext context, RubyArray rubyArray, int preArgsCount, int index, int postArgsCount) -
irNot
-
newRequiredKeywordArgumentError
-
pushExitBlock
-
pushExitBlock
-
newFunctionalCachingCallSite
-
newProfilingCachingCallSite
public static ProfilingCachingCallSite newProfilingCachingCallSite(CallType callType, String name, IRScope scope, long callSiteId) -
newMonomorphicCallSite
-
newVariableCachingCallSite
-
newRefinedCachingCallSite
public static RefinedCachingCallSite newRefinedCachingCallSite(String name, StaticScope scope, String callType) -
decodeScopeFromBytes
-
getVariableAccessorForRead
-
getVariableAccessorForWrite
-
getArgScopeDepth
-
toAry
-
prepareNoBlockArgs
public static IRubyObject[] prepareNoBlockArgs(ThreadContext context, Block block, IRubyObject[] args) Check whether incoming args are zero length for a lambda, and no-op for non-lambda. This could probably be simplified to just an arity check with no return value, but returns the incoming args currently for consistency with the other prepares.- Parameters:
context-block-args-- Returns:
-
prepareSingleBlockArgs
public static IRubyObject[] prepareSingleBlockArgs(ThreadContext context, Block block, IRubyObject[] args) -
prepareFixedBlockArgs
public static IRubyObject[] prepareFixedBlockArgs(ThreadContext context, Block block, IRubyObject[] args) -
prepareBlockArgs
public static IRubyObject[] prepareBlockArgs(ThreadContext context, Block block, IRubyObject[] args, boolean usesKwArgs, boolean ruby2Keywords) -
pushBlockDynamicScopeIfNeeded
public static DynamicScope pushBlockDynamicScopeIfNeeded(ThreadContext context, Block block, boolean pushNewDynScope, boolean reuseParentDynScope) -
pushBlockDynamicScopeNew
-
pushBlockDynamicScopeReuse
-
updateBlockState
-
useBindingSelf
-
newSymbolProc
Create a new Symbol.to_proc for the given symbol name and encoding.- Parameters:
context-value-- Returns:
-
newSymbolProc
Create a new Symbol.to_proc for the given symbol name and encoding.- Parameters:
context-symbol-- Returns:
-
singleBlockArgToArray
-
prepareBlock
public static Block prepareBlock(ThreadContext context, IRubyObject self, DynamicScope scope, BlockBody body) -
newFrameScopeBinding
public static Binding newFrameScopeBinding(ThreadContext context, IRubyObject self, DynamicScope scope) -
newFrozenString
public static RubyString newFrozenString(ThreadContext context, ByteList bytelist, int coderange, String file, int line) -
newFrozenString
-
freezeLiteralString
-
chillLiteralString
-
callOptimizedAref
public static IRubyObject callOptimizedAref(ThreadContext context, IRubyObject caller, IRubyObject target, RubyString keyStr, CallSite site) -
asString
public static RubyString asString(ThreadContext context, IRubyObject caller, IRubyObject target, CallSite site) asString using a given call site -
newArray
-
newArray
-
newArray
-
getFileNameStringFromScope
-
callTrace
public static void callTrace(ThreadContext context, IRubyObject selfClass, RubyEvent event, String name, String filename, int line) -
traceRaise
-
traceRescue
-
callTrace
public static void callTrace(ThreadContext context, Block selfBlock, RubyEvent event, String name, String filename, int line) -
callTraceHooks
public static void callTraceHooks(ThreadContext context, Block selfBlock, RubyEvent event, String name, String filename, int line) -
warnSetConstInRefinement
-
putConst
public static void putConst(ThreadContext context, IRubyObject self, IRubyObject module, String id, IRubyObject value) -
putConst
public static void putConst(ThreadContext context, IRubyObject self, IRubyObject module, String id, IRubyObject value, StaticScope scope, int line) -
getClassVariable
-
putClassVariable
public static void putClassVariable(ThreadContext context, IRubyObject self, RubyModule module, String id, IRubyObject value) -
newRationalCanonicalize
public static RubyRational newRationalCanonicalize(ThreadContext context, IRubyObject num, IRubyObject den) -
newComplexRaw
-
newDSymbol
-
getStandardError
-
getArray
-
getHash
-
getObject
-
getSymbol
-
svalue
-
aliasGlobalVariable
-
arrayLength
-
getFrameNameFromBlock
-
getFrameBlockFromBlock
-