Package org.jruby.ir.runtime
Class IRRuntimeHelpers
java.lang.Object
org.jruby.ir.runtime.IRRuntimeHelpers
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final RubyHash.VisitorWithState<StaticScope>private static final IRRuntimeHelpers.InvalidKeyExceptionprivate static final Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaliasGlobalVariable(Ruby runtime, Object newName, Object oldName) static booleananyTrue(boolean[] booleans) static RubyStringasString(ThreadContext context, IRubyObject caller, IRubyObject target, CallSite site) asString using a given call sitestatic boolean[]buildSplatMap(Operand[] args) static IRubyObjectcallOptimizedAref(ThreadContext context, IRubyObject caller, IRubyObject target, RubyString keyStr, CallSite site) static voidcallTrace(ThreadContext context, RubyEvent event, String name, String filename, int line) static voidcheckArity(ThreadContext context, StaticScope scope, Object[] args, int required, int opt, boolean rest, boolean receivesKwargs, int restKey, Block block) private static RubyClasscheckClassForDef(ThreadContext context, String id, IRubyObject obj) static voidcheckForExtraUnwantedKeywordArgs(ThreadContext context, StaticScope scope, RubyHash keywordArgs) static voidcheckForLJE(ThreadContext context, DynamicScope currentScope, boolean definedWithinMethod, Block block) 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(Ruby runtime, IRubyObject[] pairs) static IRubyObjectconstructRestArg(ThreadContext context, Object[] args, RubyHash keywordArguments, int required, int argIndex) private static IRubyObjectconstructRestArg(ThreadContext context, IRubyObject[] args, RubyHash keywordArguments, int required, int argIndex) 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 RubyHashdupKwargsHashAndPopulateFromArray(ThreadContext context, RubyHash dupHash, IRubyObject[] pairs) static StringencodeSplatmap(boolean[] splatmap) private static IRScopeTypeensureScopeIsClosure(ThreadContext context, DynamicScope dynamicScope) static RubyHashextractKwargsHash(Object[] args, int requiredArgsCount, boolean receivesKwargs) Deprecated.static RubyHashextractKwargsHash(ThreadContext context, Object[] args, int requiredArgsCount, boolean receivesKwargs) 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 RubyStringfreezeLiteralString(RubyString string, ThreadContext context, String file, int line) static IRubyObject[]frobnicateKwargsArgument(ThreadContext context, IRubyObject[] args, int requiredArgsCount) static RubyFixnumgetArgScopeDepth(ThreadContext context, StaticScope currScope) static BlockgetBlockFromObject(ThreadContext context, Object value) private static DynamicScopegetContainingLambda(DynamicScope dynamicScope) private static DynamicScopegetContainingReturnToScope(DynamicScope returnLocationScope) 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 RubyModulegetModuleFromScope(ThreadContext context, StaticScope scope, IRubyObject arg) private static DynamicScopegetNewBlockScope(Block block, boolean pushNewDynScope, boolean reuseParentDynScope) static RubyClassgetObject(ThreadContext context) static IRubyObjectgetPreArgSafe(ThreadContext context, IRubyObject[] args, int argIndex) static BlockgetRefinedBlockFromObject(ThreadContext context, StaticScope scope, Object value) static RubyClassgetStandardError(ThreadContext context) private static CacheEntrygetSuperMethodEntry(String id, RubyModule definingModule) static VariableAccessorgetVariableAccessorForRead(IRubyObject object, String name) static VariableAccessorgetVariableAccessorForWrite(IRubyObject object, String name) static IRubyObjectgetVariableWithAccessor(IRubyObject self, VariableAccessor accessor, ThreadContext context, 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) private static IRubyObject[]homogenizeKwargs(ThreadContext context, IRubyObject[] args, RubyHash kwargs) 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 booleanprivate static booleaninReturnToScope(Block.Type blockType, IRReturnJump exception, DynamicScope currentScope) static 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 IRubyObjectinvokeModuleBody(ThreadContext context, DynamicMethod method, Block block) 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 IRubyObjectisDefinedInstanceVar(ThreadContext context, IRubyObject receiver, 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 hashArg) private static booleanisJavaExceptionHandled(ThreadContext context, IRubyObject excType, Object excObj, boolean arrayCheck) private static booleanisRubyExceptionHandled(ThreadContext context, IRubyObject excType, Object excObj) private static IRubyObjectjavaProxySuper(ThreadContext context, JavaProxy self, String id, RubyClass definingModule, IRubyObject[] args, InstanceMethodInvoker superMethod) Perform a super invocation against a Java proxy, using proxy logic to locate and invoke the appropriate shim method.static IRubyObjectlexicalSearchConst(ThreadContext context, StaticScope staticScope, String constName) static IRubyObjectmatch3(ThreadContext context, RubyRegexp regexp, IRubyObject argValue) static IRubyObjectmergeKeywordArguments(ThreadContext context, IRubyObject restKwarg, IRubyObject explicitKwarg) 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, String file, int line) static RubyStringnewFrozenStringFromRaw(ThreadContext context, String str, String encoding, int cr, String file, int line) static FunctionalCachingCallSitestatic DynamicMethodnewInterpretedMetaClass(Ruby runtime, 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) private static RubyClassnewMetaClassFromIR(Ruby runtime, StaticScope scope, IRubyObject obj, boolean refinements) 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(Ruby runtime, 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) private static IRubyObject[]prepareBlockArgsInternal(ThreadContext context, Block block, IRubyObject[] args) 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.private static IRubyObject[]prepareProcArgs(ThreadContext context, Block b, IRubyObject[] args) 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, RubyModule module, String id, IRubyObject value) static IRubyObjectreceiveKeywordArg(ThreadContext context, IRubyObject[] args, int required, String id, boolean acceptsKeywordArgument) static IRubyObjectreceiveKeywordArg(ThreadContext context, IRubyObject[] args, int required, RubySymbol key, boolean acceptsKeywordArgument) static IRubyObjectreceiveKeywordRestArg(ThreadContext context, IRubyObject[] args, int required, boolean keywordArgumentSupplied) static IRubyObjectreceiveOptArg(IRubyObject[] args, int requiredArgs, int preArgs, int argIndex, boolean acceptsKeywordArgument) Deprecated.static IRubyObjectreceiveOptArg(ThreadContext context, IRubyObject[] args, int requiredArgs, int preArgs, int argIndex, boolean acceptsKeywordArgument) static IRubyObjectreceivePostReqdArg(ThreadContext context, IRubyObject[] args, int pre, int opt, boolean rest, int post, int argIndex, boolean acceptsKeywordArgument) static IRubyObjectreceiveRestArg(ThreadContext context, Object[] args, int required, int argIndex, boolean acceptsKeywordArguments) static IRubyObjectreceiveRestArg(ThreadContext context, IRubyObject[] args, int required, int argIndex, boolean acceptsKeywordArguments) 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) private static RubyClasssearchNormalSuperclass(RubyModule klazz) static IRubyObjectsetCapturedVar(ThreadContext context, IRubyObject matchRes, String id) static IRubyObjectsetInstanceVariable(IRubyObject self, IRubyObject value, String name) static voidsetVariableWithAccessor(IRubyObject self, IRubyObject value, VariableAccessor accessor) 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 IRubyObject[]singleBlockArgToArray(IRubyObject value) private static JavaSites.IRRuntimeHelpersSitessites(ThreadContext context) static IRubyObject[]splatArguments(IRubyObject[] args, boolean[] splatMap) static RubyArraysplatArray(ThreadContext context, IRubyObject ary, boolean dupArray) Call to_ary to get Array or die typing.static IRubyObjectsvalue(ThreadContext context, Object val) static IRubyObject[]toAry(ThreadContext context, IRubyObject[] args) private static IRubyObjecttoHash(ThreadContext context, IRubyObject lastArg) static final org.objectweb.asm.Type[]typesFromSignature(com.headius.invokebinder.Signature signature) static longunboxFixnum(IRubyObject val) static doubleunboxFloat(IRubyObject val) static 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) private static IRubyObjectwrapJavaException(ThreadContext context, IRubyObject excType, Throwable throwable) private static IRubyObjectwrapWithNativeException(ThreadContext context, Throwable throwable, Ruby runtime) 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)
-
Field Details
-
LOG
-
INVALID_KEY_EXCEPTION
-
CheckUnwantedKeywordsVisitor
-
-
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) -
getContainingLambda
-
initiateNonLocalReturn
public static IRubyObject initiateNonLocalReturn(DynamicScope currentScope, Block block, IRubyObject returnValue) -
getContainingReturnToScope
-
handleNonlocalReturn
public static IRubyObject handleNonlocalReturn(DynamicScope currentScope, Object rjExc) throws RuntimeException - Throws:
RuntimeException
-
ensureScopeIsClosure
-
initiateBreak
public static IRubyObject initiateBreak(ThreadContext context, DynamicScope dynScope, IRubyObject breakValue, Block block) throws RuntimeException - Throws:
RuntimeException
-
inReturnToScope
private static boolean inReturnToScope(Block.Type blockType, IRReturnJump exception, DynamicScope currentScope) -
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
-
isJavaExceptionHandled
private static boolean isJavaExceptionHandled(ThreadContext context, IRubyObject excType, Object excObj, boolean arrayCheck) -
wrapJavaException
private static IRubyObject wrapJavaException(ThreadContext context, IRubyObject excType, Throwable throwable) -
wrapWithNativeException
private static IRubyObject wrapWithNativeException(ThreadContext context, Throwable throwable, Ruby runtime) -
isRubyExceptionHandled
private static boolean isRubyExceptionHandled(ThreadContext context, IRubyObject excType, Object excObj) -
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) -
checkArity
public static void checkArity(ThreadContext context, StaticScope scope, Object[] args, int required, int opt, boolean rest, boolean receivesKwargs, int restKey, Block block) -
frobnicateKwargsArgument
public static IRubyObject[] frobnicateKwargsArgument(ThreadContext context, IRubyObject[] args, int requiredArgsCount) -
homogenizeKwargs
private static IRubyObject[] homogenizeKwargs(ThreadContext context, IRubyObject[] args, RubyHash kwargs) -
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
-
updateCoverage
Update coverage data for the given file and zero-based line number.- Parameters:
context-filename-line-
-
isHashEmpty
-
toHash
-
extractKwargsHash
public static RubyHash extractKwargsHash(ThreadContext context, Object[] args, int requiredArgsCount, boolean receivesKwargs) -
extractKwargsHash
@Deprecated public static RubyHash extractKwargsHash(Object[] args, int requiredArgsCount, boolean receivesKwargs) Deprecated. -
checkForExtraUnwantedKeywordArgs
public static void checkForExtraUnwantedKeywordArgs(ThreadContext context, StaticScope scope, RubyHash keywordArgs) -
prepareScriptScope
-
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) -
isDefinedInstanceVar
public static IRubyObject isDefinedInstanceVar(ThreadContext context, IRubyObject 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) -
findInstanceMethodContainer
public static RubyModule findInstanceMethodContainer(ThreadContext context, DynamicScope currDynScope, IRubyObject self) -
isBlockGiven
-
receiveRestArg
public static IRubyObject receiveRestArg(ThreadContext context, Object[] args, int required, int argIndex, boolean acceptsKeywordArguments) -
receiveRestArg
public static IRubyObject receiveRestArg(ThreadContext context, IRubyObject[] args, int required, int argIndex, boolean acceptsKeywordArguments) -
constructRestArg
public static IRubyObject constructRestArg(ThreadContext context, Object[] args, RubyHash keywordArguments, int required, int argIndex) -
constructRestArg
private static IRubyObject constructRestArg(ThreadContext context, IRubyObject[] args, RubyHash keywordArguments, int required, int argIndex) -
receivePostReqdArg
public static IRubyObject receivePostReqdArg(ThreadContext context, IRubyObject[] args, int pre, int opt, boolean rest, int post, int argIndex, boolean acceptsKeywordArgument) -
receiveOptArg
public static IRubyObject receiveOptArg(ThreadContext context, IRubyObject[] args, int requiredArgs, int preArgs, int argIndex, boolean acceptsKeywordArgument) -
receiveOptArg
@Deprecated public static IRubyObject receiveOptArg(IRubyObject[] args, int requiredArgs, int preArgs, int argIndex, boolean acceptsKeywordArgument) Deprecated. -
getPreArgSafe
-
receiveKeywordArg
public static IRubyObject receiveKeywordArg(ThreadContext context, IRubyObject[] args, int required, String id, boolean acceptsKeywordArgument) -
receiveKeywordArg
public static IRubyObject receiveKeywordArg(ThreadContext context, IRubyObject[] args, int required, RubySymbol key, boolean acceptsKeywordArgument) -
receiveKeywordRestArg
public static IRubyObject receiveKeywordRestArg(ThreadContext context, IRubyObject[] args, int required, boolean keywordArgumentSupplied) -
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) -
javaProxySuper
private static IRubyObject javaProxySuper(ThreadContext context, JavaProxy self, String id, RubyClass definingModule, IRubyObject[] args, InstanceMethodInvoker superMethod) Perform a super invocation against a Java proxy, using proxy logic to locate and invoke the appropriate shim method. This duplicates some logic from InstanceMethodInvoker.call and JavaMethod.tryProxyInvocation in order to properly retrieve the superclass method from the caller's point of view. See GH-6718.- Parameters:
context- the current contextself- the proxy wrapperid- the method namedefiningModule- the module in which the calling method is definedargs- arguments to the callsuperMethod- the invoker for the super method found using using Ruby super logic- Returns:
- the result of invoking the super method via a shim method
-
instanceSuperIter
public static IRubyObject instanceSuperIter(ThreadContext context, IRubyObject self, String id, RubyModule definingModule, IRubyObject[] args, Block block) -
getSuperMethodEntry
-
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) -
searchNormalSuperclass
-
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) -
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(Ruby runtime, 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. -
newMetaClassFromIR
private static RubyClass newMetaClassFromIR(Ruby runtime, StaticScope scope, IRubyObject obj, boolean refinements) -
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(Ruby runtime, 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) -
checkClassForDef
-
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
public static IRubyObject invokeModuleBody(ThreadContext context, DynamicMethod method, Block block) -
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. -
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
-
getVariableWithAccessor
public static IRubyObject getVariableWithAccessor(IRubyObject self, VariableAccessor accessor, ThreadContext context, String name) -
setVariableWithAccessor
public static void setVariableWithAccessor(IRubyObject self, IRubyObject value, VariableAccessor accessor) -
getArgScopeDepth
-
toAry
-
prepareProcArgs
-
prepareBlockArgsInternal
private static IRubyObject[] prepareBlockArgsInternal(ThreadContext context, Block block, IRubyObject[] args) -
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) -
getNewBlockScope
private static DynamicScope getNewBlockScope(Block block, boolean pushNewDynScope, boolean reuseParentDynScope) -
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) -
freezeLiteralString
-
freezeLiteralString
public static RubyString freezeLiteralString(RubyString string, ThreadContext context, String file, int line) -
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, RubyEvent event, String name, String filename, int line) -
warnSetConstInRefinement
-
putConst
public static void putConst(ThreadContext context, IRubyObject self, RubyModule module, String id, IRubyObject value) -
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
-
getObject
-
svalue
-
aliasGlobalVariable
-
sites
-