| constant | type | note |
|---|---|---|
| CALL_SPLATS | int | |
| CALL_KEYWORD | int | |
| CALL_KEYWORD_REST | int | |
| CALL_KEYWORD_EMPTY | int | |
| WALKER | StackWalker | |
| WALKER8 | StackWalker |
| field | type | note |
|---|---|---|
| runtime | Ruby | |
| nil | IRubyObject | |
| tru | RubyBoolean | |
| fals | RubyBoolean | |
| runtimeCache | RuntimeCache | |
| builtinBits | int[] | Thread-local reference to runtime's builtin bits. Public final for direct field access (fastest possible). Usage: Builtins.checkIntegerPlus(context) reads context.builtinBits[0] |
| traceEvents | TraceEventManager | |
| callInfo | int | |
| sites | JavaSites | |
| callNumber | int | |
| exceptionRequiresBacktrace | boolean |
callThreadPoll(org.jruby.runtime.ThreadContext context)clearCallInfo(org.jruby.runtime.ThreadContext context)Clear call info state (set to 0). This method is static to make it trivially inlinable on most JVM JITs
createRawBacktraceStringFromThrowable(Throwable ex, boolean color)hasKeywords(int callInfo)hasNonemptyKeywords(int callInfo)keywordsEmpty(int callInfo)pushBacktrace(org.jruby.runtime.ThreadContext context, String method, String file, int line)resetCallInfo(org.jruby.runtime.ThreadContext context)Reset call info state and return the value of call info right before it is reset. This method is static to make it trivially inlinable on most JVM JITs
Returns: the old call info
addThreadTraceFunction(org.jruby.runtime.builtin.IRubyObject trace_func, boolean useContextHook)Get the value of the $~ (backref) "global".
Returns: the value of $~
setBackRef(org.jruby.RubyMatchData match) · also: set_back_refSet the $~ (backref) "global" to the given RubyMatchData value. The value will be marked as "in use" since it can now be seen across threads that share the current frame.
| name | type | description |
|---|---|---|
| match | org.jruby.RubyMatchData | the value to set |
Returns: the value passed in
Create a snapshot Array with current backtrace information.
Returns: the backtrace
blockingThreadPoll()Poll for thread events that should be fired before a blocking call. See vm_check_ints_blocking and RUBY_VM_CHECK_INTS_BLOCKING in CRuby.
callThreadPoll()getCalleeName() · also: get_callee_nameThe name under which the current method was called, if called via an alias. Used for __callee__.
Returns: the name under which the current method was called
Set the $~ (backref) "global" to nil.
Returns: nil
clearCallInfo()Clear call info state (set to 0).
clearErrorInfo()clearLocalMatch()Set the thread-local MatchData specific to this context to null.
getCompositeName() · also: get_composite_nameA string representing the name of the current method and the name under which it was called. If not called via an alias, this will be a single string. If called via an alias, it will be encoded as "\0alias\0original" and must be unpacked for its components.
Returns: a representation of the current method's name and the name it was called under
createCallerBacktrace(int level, int length, java.util.stream.Stream<com.headius.backport9.stack.StackWalker.StackFrame> stackStream)Create an Array with backtrace information for Kernel#caller
Returns: an Array with the backtrace
createCallerLocations(int level, int length, java.util.stream.Stream<com.headius.backport9.stack.StackWalker.StackFrame> stackStream)Create an array containing Thread::Backtrace::Location objects for the requested caller trace level and length.
| name | type | description |
|---|---|---|
| level | int | the level at which the trace should start |
| length | int | the length of the trace |
Returns: an Array with the backtrace locations
Return a binding representing the current call's state
Returns: the current binding
currentBinding(org.jruby.runtime.builtin.IRubyObject self)Return a binding representing the current call's state but with a specified self
| name | type | description |
|---|---|---|
| self | org.jruby.runtime.builtin.IRubyObject | the self object to use |
Returns: the current binding, using the specified self
currentBinding(org.jruby.runtime.builtin.IRubyObject self, org.jruby.runtime.Visibility visibility)Return a binding representing the current call's state but with the specified visibility and self.
| name | type | description |
|---|---|---|
| self | org.jruby.runtime.builtin.IRubyObject | the self object to use |
| visibility | org.jruby.runtime.Visibility | the visibility to use |
Returns: the current binding using the specified self and visibility
currentBinding(org.jruby.runtime.builtin.IRubyObject self, org.jruby.runtime.DynamicScope scope)Return a binding representing the current call's state but with the specified scope and self.
| name | type | description |
|---|---|---|
| self | org.jruby.runtime.builtin.IRubyObject | the self object to use |
| scope | org.jruby.runtime.DynamicScope | the scope to use |
Returns: the current binding using the specified self and scope
currentBinding(org.jruby.runtime.builtin.IRubyObject self, org.jruby.runtime.Visibility visibility, org.jruby.runtime.DynamicScope scope)Return a binding representing the current call's state but with the specified visibility, scope, and self. For shared-scope binding consumers like for loops.
| name | type | description |
|---|---|---|
| self | org.jruby.runtime.builtin.IRubyObject | the self object to use |
| visibility | org.jruby.runtime.Visibility | the visibility to use |
| scope | org.jruby.runtime.DynamicScope | the scope to use |
Returns: the current binding using the specified self, scope, and visibility
getCurrentTarget() · also: get_current_targetsetCurrentVisibility(org.jruby.runtime.Visibility visibility) · also: set_current_visibilityeachCallerLocation(java.util.stream.Stream<com.headius.backport9.stack.StackWalker.StackFrame> stackStream, java.util.function.Consumer<org.jruby.RubyThread.Location> consumer)Like #createCallerLocations(int, int, Stream) but accepts a lambda to yield each location and yields
all stack elements until the loop ends or is broken early.
| name | type | description |
|---|---|---|
| stack_stream | java.util.stream.Stream<com.headius.backport9.stack.StackWalker.StackFrame> | the stream of StackFrame objects from JVM |
| consumer | java.util.function.Consumer<org.jruby.RubyThread.Location> | the consumer of RubyThread.Location objects |
encodingHolder()setErrorInfo(org.jruby.runtime.builtin.IRubyObject errorInfo) · also: set_error_infosetEventHooksEnabled(boolean flag) · also: set_event_hooks_enabledisEventHooksEnabled() · also: is_event_hooks_enabledexceptionBacktraceOff()exceptionBacktraceOn()setExceptionRequiresBacktrace(boolean exceptionRequiresBacktrace) · also: set_exception_requires_backtraceexecRecursive(org.jruby.runtime.ThreadContext.RecursiveFunctionEx<T> func, T state, org.jruby.runtime.builtin.IRubyObject obj, String name)setFiber(org.jruby.ext.fiber.ThreadFiber fiber) · also: set_fibergetFile() · also: get_filegetFileAndLine() · also: get_file_and_linegetFrameName() · also: get_frame_nameThe currently-running method's original name, used for stack traces, super calls, and __method__, and trace hooks.
Returns: the current method's name
Find the active Continuation for the given tag. Must be called with an interned string.
| name | type | description |
|---|---|---|
| tag | Object | The interned string to search for |
Returns: The continuation associated with this tag
Return a single RubyStackTraceElement representing the nearest Ruby stack trace element. Used for warnings and Kernel#__dir__.
Returns: the nearest stack trace element
getSingleBacktraceExact(int level)Return the trace of level or null.
hasAnyScopes() · also: has_any_scopessetLastExitStatus(org.jruby.runtime.builtin.IRubyObject lastExitStatus) · also: set_last_exit_statusGet the value of the $_ (lastline) "global".
Returns: the value of $_
setLastLine(org.jruby.runtime.builtin.IRubyObject last) · also: set_last_lineSet the $_ (lastlne) "global" to the given value.
| name | type | description |
|---|---|---|
| last | org.jruby.runtime.builtin.IRubyObject | the value to set |
Returns: the value passed in
getLine() · also: get_linesetLine(int line) · also: set_lineGet the thread-local MatchData specific to this context. This is different from the frame backref since frames may be shared by several executing contexts at once (see jruby/jruby#4868).
Returns: the current thread-local MatchData, or null if none
setLocalMatch(org.jruby.RubyMatchData localMatch) · also: set_local_matchSet the thread-local MatchData specific to this context. This is different from the frame backref since frames may be shared by several executing contexts at once (see jruby/jruby#4868).
| name | type | description |
|---|---|---|
| local_match | org.jruby.RubyMatchData | the new thread-local MatchData or null |
Get the thread-local MatchData specific to this context or nil if none.
Returns: the current thread-local MatchData, or nil if none
pollThreadEvents()popCatch()popFrame()popScope()postBackrefMethod()postEvalScriptlet()postExecuteUnder()postMethodBacktraceAndScope()postMethodBacktraceDummyScope()postMethodBacktraceOnly()postMethodFrameAndScope()postMethodFrameOnly()postMethodScopeOnly()postNodeEval()postScopedBody()postTrace()preAdoptThread()preBackrefMethod()preEvalScriptlet(org.jruby.runtime.DynamicScope scope)preExecuteUnder(org.jruby.runtime.builtin.IRubyObject executeUnderObj, org.jruby.RubyModule executeUnderClass, org.jruby.runtime.Block block)preExtensionLoad(org.jruby.runtime.builtin.IRubyObject self)preMethodBacktraceAndScope(String name, org.jruby.parser.StaticScope staticScope)preMethodBacktraceDummyScope(String name, org.jruby.parser.StaticScope staticScope)preMethodBacktraceOnly(String name)preMethodFrameAndDummyScope(org.jruby.RubyModule clazz, String name, org.jruby.runtime.builtin.IRubyObject self, org.jruby.runtime.Block block, org.jruby.parser.StaticScope staticScope)preMethodFrameAndScope(org.jruby.RubyModule clazz, String name, org.jruby.runtime.builtin.IRubyObject self, org.jruby.runtime.Block block, org.jruby.parser.StaticScope staticScope)preMethodFrameOnly(org.jruby.RubyModule clazz, String name, org.jruby.runtime.builtin.IRubyObject self, org.jruby.runtime.Block block)preMethodFrameOnly(org.jruby.RubyModule clazz, String name, org.jruby.runtime.builtin.IRubyObject self, org.jruby.runtime.Visibility visiblity, org.jruby.runtime.Block block)preMethodFrameOnly(org.jruby.RubyModule clazz, String name, org.jruby.runtime.builtin.IRubyObject self)preMethodNoFrameAndDummyScope(org.jruby.parser.StaticScope staticScope)preMethodScopeOnly(org.jruby.parser.StaticScope staticScope)preTrace()preYieldSpecificBlock(org.jruby.runtime.Binding binding, org.jruby.parser.StaticScope scope)prepareTopLevel(org.jruby.RubyClass objectClass, org.jruby.runtime.builtin.IRubyObject topSelf)printScope()getPrivateConstantReference() · also: get_private_constant_referencesetPrivateConstantReference(org.jruby.RubyModule privateConstantReference) · also: set_private_constant_referencegetProfileCollection() · also: get_profile_collectionGet the profile collection for this thread (ThreadContext).
Returns: the thread's profile collection
profileEnter(int nextMethod)profileEnter(String name, org.jruby.internal.runtime.methods.DynamicMethod nextMethod)profileExit(int nextMethod, long startTime)isProfiling() · also: is_profilingpushEvalSimpleFrame(org.jruby.runtime.builtin.IRubyObject executeObject)pushFrame()pushNewScope(org.jruby.parser.StaticScope staticScope)setRecursiveSet(Set<org.jruby.util.RecursiveComparator.Pair> recursiveSet) · also: set_recursive_setrenderCurrentBacktrace(StringBuilder sb)Render the current backtrace as a string to the given StringBuilder. This will honor the currently-configured backtrace format and content.
| name | type | description |
|---|---|---|
| sb | StringBuilder | the StringBuilder to which to render the backtrace |
resetCallInfo()Reset call info state and return the value of call info right before it is reset.
Returns: the old call info
setRootFiber(org.jruby.ext.fiber.ThreadFiber rootFiber) · also: set_root_fibergetRubyDateFormatter() · also: get_ruby_date_formatterRetrieve the runtime associated with this context. Note that there's no reason to call this method rather than accessing the runtime field directly.
Returns: the runtime associated with this context
safeRecurse(org.jruby.runtime.ThreadContext.RecursiveFunctionEx<T> func, T state, org.jruby.runtime.builtin.IRubyObject obj, String name, boolean outer)getSavedExceptionInLambda() · also: get_saved_exception_in_lambdasetSavedExceptionInLambda(Throwable e) · also: set_saved_exception_in_lambdascopeExistsOnCallStack(org.jruby.runtime.DynamicScope scope)Check if a scope is present on the call stack. This is the IR equivalent of isJumpTargetAlive
| name | type | description |
|---|---|---|
| scope | org.jruby.runtime.DynamicScope | the scope to look for |
Returns: true if it exists. otherwise false.
setFileAndLine(String file, int line)setLastCallStatusAndVisibility(org.jruby.runtime.CallType callType, org.jruby.runtime.Visibility visibility)Same as calling getSingleBacktrace(0);
startProfiling()stopProfiling()setThreadTraceFunction(org.jruby.runtime.builtin.IRubyObject trace_func) · also: set_thread_trace_functiontrace(org.jruby.runtime.RubyEvent event, String name, org.jruby.RubyModule implClass)trace(org.jruby.runtime.RubyEvent event, String name, org.jruby.RubyModule implClass, String file, int line)Update the current frame's backref using the current thread-local match, or clear it if that match is null.
Returns: The current match, or nil
useRecursionGuardsFrom(org.jruby.runtime.ThreadContext context)Fibers must use the same recursion guards as their parent thread.
setWithinTrace(boolean isWithinTrace) · also: set_within_traceSet whether we are actively tracing or not on this thread.
| name | type | description |
|---|---|---|
| is_within_trace | boolean | true is so |
isWithinTrace() · also: is_within_traceIs this thread actively tracing at this moment.
Returns: true if so