public final class ThreadContext extends Object
Modifier and Type | Field and Description |
---|---|
int |
callNumber |
boolean |
is19 |
IRubyObject |
nil |
Ruby |
runtime |
RuntimeCache |
runtimeCache |
SecureRandom |
secureRandom |
public final Ruby runtime
public final IRubyObject nil
public final RuntimeCache runtimeCache
public final boolean is19
public final SecureRandom secureRandom
public int callNumber
public static ThreadContext newContext(Ruby runtime)
protected void finalize() throws Throwable
public final Ruby getRuntime()
runtime
public IRubyObject getErrorInfo()
public IRubyObject setErrorInfo(IRubyObject errorInfo)
public JumpException.ReturnJump returnJump(IRubyObject value)
public void setLastCallStatus(CallType callType)
public CallType getLastCallType()
public void setLastVisibility(Visibility visibility)
public Visibility getLastVisibility()
public void setLastCallStatusAndVisibility(CallType callType, Visibility visibility)
public IRubyObject getLastExitStatus()
public void setLastExitStatus(IRubyObject lastExitStatus)
public void printScope()
public DynamicScope getCurrentScope()
public StaticScope getCurrentStaticScope()
public DynamicScope getPreviousScope()
public void pushScope(DynamicScope scope)
public void popScope()
public RubyThread getThread()
public RubyThread getFiberCurrentThread()
public RubyDateFormatter getRubyDateFormatter()
public void setThread(RubyThread thread)
public ThreadFiber getFiber()
public void setFiber(ThreadFiber fiber)
public void setRootFiber(ThreadFiber rootFiber)
public void setRootThread(RubyThread rootThread)
public void pushCatch(RubyContinuation.Continuation catchTarget)
public void popCatch()
public RubyContinuation.Continuation getActiveCatch(Object tag)
tag
- The interned string to search forpublic void pushFrame()
public void popFrame()
public Frame getCurrentFrame()
public Frame getNextFrame()
public Frame getPreviousFrame()
public IRubyObject setBackRef(IRubyObject match)
match
- the value to setpublic IRubyObject getBackRef()
public IRubyObject setLastLine(IRubyObject last)
last
- the value to setpublic IRubyObject getLastLine()
public static void pushBacktrace(ThreadContext context, String method, ISourcePosition position)
public static void pushBacktrace(ThreadContext context, String method, String file, int line)
public static void popBacktrace(ThreadContext context)
public boolean isJumpTargetAlive(int target, int skipFrames)
target
- The JumpTarget to search forskipFrames
- The number of frames to skip before searchingpublic boolean scopeExistsOnCallStack(StaticScope s)
s
- the static scope to look forpublic String getFrameName()
public IRubyObject getFrameSelf()
public int getFrameJumpTarget()
public RubyModule getFrameKlazz()
public Block getFrameBlock()
public String getFile()
public int getLine()
public void setLine(int line)
public void setFileAndLine(String file, int line)
public void setFileAndLine(ISourcePosition position)
public Visibility getCurrentVisibility()
public Visibility getPreviousVisibility()
public void setCurrentVisibility(Visibility visibility)
public void pollThreadEvents()
public int getCurrentTarget()
public void callThreadPoll()
public static void callThreadPoll(ThreadContext context)
public void trace(RubyEvent event, String name, RubyModule implClass)
public void trace(RubyEvent event, String name, RubyModule implClass, String file, int line)
public void pushRubyClass(RubyModule currentModule)
public RubyModule popRubyClass()
public RubyModule getRubyClass()
public RubyModule getPreviousRubyClass()
@Deprecated public boolean getConstantDefined(String internedName)
@Deprecated public IRubyObject getConstant(String internedName)
@Deprecated public IRubyObject setConstantInCurrent(String internedName, IRubyObject result)
@Deprecated public IRubyObject setConstantInModule(String internedName, IRubyObject target, IRubyObject result)
@Deprecated public IRubyObject setConstantInObject(String internedName, IRubyObject result)
public IRubyObject createCallerBacktrace(int level, StackTraceElement[] stacktrace)
runtime
- level
- public IRubyObject createCallerBacktrace(int level, Integer length, StackTraceElement[] stacktrace)
runtime
- level
- length
- public IRubyObject createCallerLocations(int level, Integer length, StackTraceElement[] stacktrace)
level
- the level at which the trace should startlength
- the length of the tracepublic RubyStackTraceElement[] createWarningBacktrace(Ruby runtime)
runtime
- public RubyStackTraceElement[] gatherCallerBacktrace()
public Frame[] createBacktrace(int level, boolean nativeException)
level
- nativeException
- public boolean isEventHooksEnabled()
public void setEventHooksEnabled(boolean flag)
public BacktraceElement[] createBacktrace2(int level, boolean nativeException)
level
- nativeException
- public static String createRawBacktraceStringFromThrowable(Throwable t)
public static RubyStackTraceElement[] gatherRawBacktrace(Ruby runtime, StackTraceElement[] stackTrace)
public void preAdoptThread()
public void preExtensionLoad(IRubyObject self)
public void postExtensionLoad()
public void preCompiledClass(RubyModule type, StaticScope staticScope)
public void preCompiledClassDummyScope(RubyModule type, StaticScope staticScope)
public void postCompiledClass()
public void preScopeNode(StaticScope staticScope)
public void postScopeNode()
public void preClassEval(StaticScope staticScope, RubyModule type)
public void postClassEval()
public void preBsfApply(String[] names)
public void postBsfApply()
public void preMethodFrameAndClass(RubyModule implClass, String name, IRubyObject self, Block block, StaticScope staticScope)
public void preMethodFrameAndScope(RubyModule clazz, String name, IRubyObject self, Block block, StaticScope staticScope)
public void preMethodFrameAndDummyScope(RubyModule clazz, String name, IRubyObject self, Block block, StaticScope staticScope)
public void preMethodNoFrameAndDummyScope(RubyModule clazz, StaticScope staticScope)
public void postMethodFrameAndScope()
public void preMethodFrameOnly(RubyModule clazz, String name, IRubyObject self, Block block)
public void postMethodFrameOnly()
public void preMethodScopeOnly(RubyModule clazz, StaticScope staticScope)
public void postMethodScopeOnly()
public void preMethodBacktraceAndScope(String name, RubyModule clazz, StaticScope staticScope)
public void postMethodBacktraceAndScope()
public void preMethodBacktraceOnly(String name)
public void preMethodBacktraceDummyScope(RubyModule clazz, String name, StaticScope staticScope)
public void postMethodBacktraceOnly()
public void postMethodBacktraceDummyScope()
public void prepareTopLevel(RubyClass objectClass, IRubyObject topSelf)
public void preNodeEval(RubyModule rubyClass, IRubyObject self, String name)
public void preNodeEval(RubyModule rubyClass, IRubyObject self)
public void postNodeEval()
public void preExecuteUnder(RubyModule executeUnderClass, Block block)
public void postExecuteUnder()
public void preMproc()
public void postMproc()
public void preTrace()
public void postTrace()
public Frame preForBlock(Binding binding, RubyModule klass)
public Frame preYieldSpecificBlock(Binding binding, StaticScope scope, RubyModule klass)
public Frame preYieldLightBlock(Binding binding, DynamicScope emptyScope, RubyModule klass)
public Frame preYieldNoScope(Binding binding, RubyModule klass)
public void preEvalScriptlet(DynamicScope scope)
public void postEvalScriptlet()
public void postYieldNoScope(Frame lastFrame)
public void preScopedBody(DynamicScope scope)
public void postScopedBody()
public boolean isWithinTrace()
Ruby.callEventHooks(ThreadContext, RubyEvent, String, int, String, org.jruby.runtime.builtin.IRubyObject)
public void setWithinTrace(boolean isWithinTrace)
isWithinTrace
- true is soRuby.callEventHooks(ThreadContext, RubyEvent, String, int, String, org.jruby.runtime.builtin.IRubyObject)
public Binding currentBinding()
public Binding currentBinding(IRubyObject self)
self
- the self object to usepublic Binding currentBinding(IRubyObject self, Visibility visibility)
self
- the self object to usevisibility
- the visibility to usepublic Binding currentBinding(IRubyObject self, DynamicScope scope)
self
- the self object to usescope
- the scope to usepublic Binding currentBinding(IRubyObject self, Visibility visibility, DynamicScope scope)
self
- the self object to usevisibility
- the visibility to usescope
- the scope to use@Deprecated public Binding previousBinding()
@Deprecated public Binding previousBinding(IRubyObject self)
self
- the self object to usepublic ProfileCollection getProfileCollection()
public void startProfiling()
public void stopProfiling()
public boolean isProfiling()
public int profileEnter(int nextMethod)
public int profileEnter(String name, DynamicMethod nextMethod)
public int profileExit(int nextMethod, long startTime)
public Set<RecursiveComparator.Pair> getRecursiveSet()
public void setRecursiveSet(Set<RecursiveComparator.Pair> recursiveSet)
@Deprecated public void setFile(String file)
@Deprecated public RubyDateFormat getRubyDateFormat()
Copyright © 2001-2015 JRuby. All Rights Reserved.