|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.runtime.ThreadContext
public final class ThreadContext
Field Summary | |
---|---|
int |
callNumber
|
IRubyObject |
nil
|
Ruby |
runtime
|
RuntimeCache |
runtimeCache
|
Method Summary | |
---|---|
void |
callThreadPoll()
|
static void |
callThreadPoll(ThreadContext context)
|
Frame[] |
createBacktrace(int level,
boolean nativeException)
Create an Array with backtrace information. |
BacktraceElement[] |
createBacktrace2(int level,
boolean nativeException)
Create an Array with backtrace information. |
IRubyObject |
createCallerBacktrace(Ruby runtime,
int level)
Create an Array with backtrace information. |
static java.lang.String |
createRawBacktraceStringFromThrowable(java.lang.Throwable t)
|
Binding |
currentBinding()
Return a binding representing the current call's state |
Binding |
currentBinding(IRubyObject self)
Return a binding representing the current call's state but with a specified self |
Binding |
currentBinding(IRubyObject self,
DynamicScope scope)
Return a binding representing the current call's state but with the specified scope and self. |
Binding |
currentBinding(IRubyObject self,
Visibility visibility)
Return a binding representing the current call's state but with the specified visibility and self. |
Binding |
currentBinding(IRubyObject self,
Visibility visibility,
DynamicScope scope)
Return a binding representing the current call's state but with the specified visibility, scope, and self. |
protected void |
finalize()
|
RubyStackTraceElement[] |
gatherCallerBacktrace(int level)
|
static RubyStackTraceElement[] |
gatherRawBacktrace(Ruby runtime,
java.lang.StackTraceElement[] stackTrace)
|
RubyContinuation.Continuation |
getActiveCatch(java.lang.Object tag)
Find the active Continuation for the given tag. |
IRubyObject |
getConstant(java.lang.String internedName)
Used by the evaluator and the compiler to look up a constant by name |
boolean |
getConstantDefined(java.lang.String internedName)
|
Frame |
getCurrentFrame()
|
Frame |
getCurrentRubyFrame()
|
DynamicScope |
getCurrentScope()
|
int |
getCurrentTarget()
|
Visibility |
getCurrentVisibility()
|
IRubyObject |
getErrorInfo()
|
FiberLibrary.Fiber |
getFiber()
|
java.lang.String |
getFile()
|
Block |
getFrameBlock()
|
int |
getFrameCount()
|
int |
getFrameJumpTarget()
|
RubyModule |
getFrameKlazz()
|
java.lang.String |
getFrameName()
|
Frame[] |
getFrames(int delta)
|
IRubyObject |
getFrameSelf()
|
CallType |
getLastCallType()
|
IRubyObject |
getLastExitStatus()
|
Visibility |
getLastVisibility()
|
int |
getLine()
|
Frame |
getNextFrame()
|
Frame |
getPreviousFrame()
|
RubyModule |
getPreviousRubyClass()
|
DynamicScope |
getPreviousScope()
|
Visibility |
getPreviousVisibility()
|
IProfileData |
getProfileData()
Get the profile data for this thread (ThreadContext). |
RubyModule |
getRubyClass()
|
int |
getRubyFrameDelta()
|
Ruby |
getRuntime()
|
RubyThread |
getThread()
|
boolean |
isEventHooksEnabled()
|
boolean |
isJumpTargetAlive(int target,
int skipFrames)
Search the frame stack for the given JumpTarget. |
boolean |
isProfiling()
|
boolean |
isWithinDefined()
Is this thread actively in defined? at the moment. |
boolean |
isWithinTrace()
Is this thread actively tracing at this moment. |
static ThreadContext |
newContext(Ruby runtime)
|
void |
pollThreadEvents()
|
static void |
popBacktrace(ThreadContext context)
|
void |
popCatch()
|
void |
popFrame()
|
RubyModule |
popRubyClass()
|
void |
popScope()
|
void |
postBsfApply()
|
void |
postClassEval()
|
void |
postCompiledClass()
|
void |
postEvalScriptlet()
|
void |
postEvalWithBinding(Binding binding,
Frame lastFrame)
|
void |
postExecuteUnder()
|
void |
postExtensionLoad()
|
void |
postMethodBacktraceAndScope()
|
void |
postMethodBacktraceDummyScope()
|
void |
postMethodBacktraceOnly()
|
void |
postMethodFrameAndScope()
|
void |
postMethodFrameOnly()
|
void |
postMethodScopeOnly()
|
void |
postMproc()
|
void |
postNodeEval()
|
void |
postScopedBody()
|
void |
postScopeNode()
|
void |
postTrace()
|
void |
postYield(Binding binding,
Frame lastFrame)
|
void |
postYieldLight(Binding binding,
Frame lastFrame)
|
void |
postYieldNoScope(Frame lastFrame)
|
void |
preAdoptThread()
|
void |
preBsfApply(java.lang.String[] names)
|
void |
preClassEval(StaticScope staticScope,
RubyModule type)
|
void |
preCompiledClass(RubyModule type,
StaticScope staticScope)
|
void |
preCompiledClassDummyScope(RubyModule type,
StaticScope staticScope)
|
void |
preEvalScriptlet(DynamicScope scope)
|
Frame |
preEvalWithBinding(Binding binding)
|
void |
preExecuteUnder(RubyModule executeUnderClass,
Block block)
|
void |
preExtensionLoad(IRubyObject self)
|
Frame |
preForBlock(Binding binding,
RubyModule klass)
|
void |
preMethodBacktraceAndScope(java.lang.String name,
RubyModule clazz,
StaticScope staticScope)
|
void |
preMethodBacktraceDummyScope(RubyModule clazz,
java.lang.String name,
StaticScope staticScope)
|
void |
preMethodBacktraceOnly(java.lang.String name)
|
void |
preMethodFrameAndDummyScope(RubyModule clazz,
java.lang.String name,
IRubyObject self,
Block block,
StaticScope staticScope)
|
void |
preMethodFrameAndScope(RubyModule clazz,
java.lang.String name,
IRubyObject self,
Block block,
StaticScope staticScope)
|
void |
preMethodFrameOnly(RubyModule clazz,
java.lang.String name,
IRubyObject self,
Block block)
|
void |
preMethodNoFrameAndDummyScope(RubyModule clazz,
StaticScope staticScope)
|
void |
preMethodScopeOnly(RubyModule clazz,
StaticScope staticScope)
|
void |
preMproc()
|
void |
preNodeEval(RubyModule rubyClass,
IRubyObject self)
|
void |
preNodeEval(RubyModule rubyClass,
IRubyObject self,
java.lang.String name)
|
void |
prepareTopLevel(RubyClass objectClass,
IRubyObject topSelf)
|
void |
preRunThread(Frame[] currentFrames)
|
void |
preScopedBody(DynamicScope scope)
|
void |
preScopeNode(StaticScope staticScope)
|
void |
preTrace()
|
Binding |
previousBinding()
Return a binding representing the previous call's state |
Binding |
previousBinding(IRubyObject self)
Return a binding representing the previous call's state but with a specified self |
Frame |
preYieldLightBlock(Binding binding,
DynamicScope emptyScope,
RubyModule klass)
|
Frame |
preYieldNoScope(Binding binding,
RubyModule klass)
|
Frame |
preYieldSpecificBlock(Binding binding,
StaticScope scope,
RubyModule klass)
|
void |
printScope()
|
int |
profileEnter(int nextMethod)
|
int |
profileExit(int nextMethod,
long startTime)
|
static void |
pushBacktrace(ThreadContext context,
java.lang.String klass,
java.lang.String method,
ISourcePosition position)
|
static void |
pushBacktrace(ThreadContext context,
java.lang.String klass,
java.lang.String method,
java.lang.String file,
int line)
|
void |
pushCatch(RubyContinuation.Continuation catchTarget)
|
void |
pushFrame()
|
void |
pushRubyClass(RubyModule currentModule)
|
void |
pushScope(DynamicScope scope)
|
JumpException.ReturnJump |
returnJump(IRubyObject value)
|
IRubyObject |
setConstantInCurrent(java.lang.String internedName,
IRubyObject result)
Used by the evaluator and the compiler to set a constant by name This is for a null const decl |
IRubyObject |
setConstantInModule(java.lang.String internedName,
IRubyObject target,
IRubyObject result)
Used by the evaluator and the compiler to set a constant by name. |
IRubyObject |
setConstantInObject(java.lang.String internedName,
IRubyObject result)
Used by the evaluator and the compiler to set a constant by name This is for a Colon2 const decl |
void |
setCurrentVisibility(Visibility visibility)
|
IRubyObject |
setErrorInfo(IRubyObject errorInfo)
|
void |
setEventHooksEnabled(boolean flag)
|
void |
setFiber(FiberLibrary.Fiber fiber)
|
void |
setFile(java.lang.String file)
|
void |
setFileAndLine(ISourcePosition position)
|
void |
setFileAndLine(java.lang.String file,
int line)
|
void |
setLastCallStatus(CallType callType)
Returns the lastCallStatus. |
void |
setLastCallStatusAndVisibility(CallType callType,
Visibility visibility)
|
void |
setLastExitStatus(IRubyObject lastExitStatus)
|
void |
setLastVisibility(Visibility visibility)
|
void |
setLine(int line)
|
void |
setRubyFrameDelta(int newDelta)
|
void |
setThread(RubyThread thread)
|
void |
setWithinDefined(boolean isWithinDefined)
Set whether we are actively within defined? or not. |
void |
setWithinTrace(boolean isWithinTrace)
Set whether we are actively tracing or not on this thread. |
void |
startProfiling()
|
void |
stopProfiling()
|
void |
trace(RubyEvent event,
java.lang.String name,
RubyModule implClass)
|
void |
trace(RubyEvent event,
java.lang.String name,
RubyModule implClass,
java.lang.String file,
int line)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Ruby runtime
public final IRubyObject nil
public final RuntimeCache runtimeCache
public int callNumber
Method Detail |
---|
public static ThreadContext newContext(Ruby runtime)
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public final Ruby getRuntime()
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 DynamicScope getPreviousScope()
public void pushScope(DynamicScope scope)
public void popScope()
public RubyThread getThread()
public void setThread(RubyThread thread)
public FiberLibrary.Fiber getFiber()
public void setFiber(FiberLibrary.Fiber fiber)
public void pushCatch(RubyContinuation.Continuation catchTarget)
public void popCatch()
public RubyContinuation.Continuation getActiveCatch(java.lang.Object tag)
tag
- The interned string to search for
public void pushFrame()
public void popFrame()
public Frame getCurrentFrame()
public int getRubyFrameDelta()
public void setRubyFrameDelta(int newDelta)
public Frame getCurrentRubyFrame()
public Frame getNextFrame()
public Frame getPreviousFrame()
public int getFrameCount()
public Frame[] getFrames(int delta)
public static void pushBacktrace(ThreadContext context, java.lang.String klass, java.lang.String method, ISourcePosition position)
public static void pushBacktrace(ThreadContext context, java.lang.String klass, java.lang.String method, java.lang.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 searching
public java.lang.String getFrameName()
public IRubyObject getFrameSelf()
public int getFrameJumpTarget()
public RubyModule getFrameKlazz()
public Block getFrameBlock()
public java.lang.String getFile()
public int getLine()
public void setFile(java.lang.String file)
public void setLine(int line)
public void setFileAndLine(java.lang.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, java.lang.String name, RubyModule implClass)
public void trace(RubyEvent event, java.lang.String name, RubyModule implClass, java.lang.String file, int line)
public void pushRubyClass(RubyModule currentModule)
public RubyModule popRubyClass()
public RubyModule getRubyClass()
public RubyModule getPreviousRubyClass()
public boolean getConstantDefined(java.lang.String internedName)
public IRubyObject getConstant(java.lang.String internedName)
public IRubyObject setConstantInCurrent(java.lang.String internedName, IRubyObject result)
public IRubyObject setConstantInModule(java.lang.String internedName, IRubyObject target, IRubyObject result)
public IRubyObject setConstantInObject(java.lang.String internedName, IRubyObject result)
public IRubyObject createCallerBacktrace(Ruby runtime, int level)
runtime
- level
- nativeException
-
public RubyStackTraceElement[] gatherCallerBacktrace(int level)
public Frame[] createBacktrace(int level, boolean nativeException)
runtime
- level
- nativeException
-
public boolean isEventHooksEnabled()
public void setEventHooksEnabled(boolean flag)
public BacktraceElement[] createBacktrace2(int level, boolean nativeException)
runtime
- level
- nativeException
-
public static java.lang.String createRawBacktraceStringFromThrowable(java.lang.Throwable t)
public static RubyStackTraceElement[] gatherRawBacktrace(Ruby runtime, java.lang.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(java.lang.String[] names)
public void postBsfApply()
public void preMethodFrameAndScope(RubyModule clazz, java.lang.String name, IRubyObject self, Block block, StaticScope staticScope)
public void preMethodFrameAndDummyScope(RubyModule clazz, java.lang.String name, IRubyObject self, Block block, StaticScope staticScope)
public void preMethodNoFrameAndDummyScope(RubyModule clazz, StaticScope staticScope)
public void postMethodFrameAndScope()
public void preMethodFrameOnly(RubyModule clazz, java.lang.String name, IRubyObject self, Block block)
public void postMethodFrameOnly()
public void preMethodScopeOnly(RubyModule clazz, StaticScope staticScope)
public void postMethodScopeOnly()
public void preMethodBacktraceAndScope(java.lang.String name, RubyModule clazz, StaticScope staticScope)
public void postMethodBacktraceAndScope()
public void preMethodBacktraceOnly(java.lang.String name)
public void preMethodBacktraceDummyScope(RubyModule clazz, java.lang.String name, StaticScope staticScope)
public void postMethodBacktraceOnly()
public void postMethodBacktraceDummyScope()
public void prepareTopLevel(RubyClass objectClass, IRubyObject topSelf)
public void preNodeEval(RubyModule rubyClass, IRubyObject self, java.lang.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 preRunThread(Frame[] currentFrames)
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 Frame preEvalWithBinding(Binding binding)
public void postEvalWithBinding(Binding binding, Frame lastFrame)
public void postYield(Binding binding, Frame lastFrame)
public void postYieldLight(Binding binding, Frame lastFrame)
public void postYieldNoScope(Frame lastFrame)
public void preScopedBody(DynamicScope scope)
public void postScopedBody()
public boolean isWithinTrace()
org.jruby.Ruby#callTraceFunction(String, ISourcePosition, IRubyObject, String, IRubyObject)
public void setWithinTrace(boolean isWithinTrace)
isWithinTrace
- true is soorg.jruby.Ruby#callTraceFunction(String, ISourcePosition, IRubyObject, String, IRubyObject)
public boolean isWithinDefined()
public void setWithinDefined(boolean isWithinDefined)
isWithinDefined
- true if sopublic Binding currentBinding()
public Binding currentBinding(IRubyObject self)
self
- the self object to use
public Binding currentBinding(IRubyObject self, Visibility visibility)
self
- the self object to usevisibility
- the visibility to use
public Binding currentBinding(IRubyObject self, DynamicScope scope)
self
- the self object to usevisibility
- the scope to use
public Binding currentBinding(IRubyObject self, Visibility visibility, DynamicScope scope)
self
- the self object to usevisibility
- the visibility to usescope
- the scope to use
public Binding previousBinding()
public Binding previousBinding(IRubyObject self)
self
- the self object to use
public IProfileData getProfileData()
public int profileEnter(int nextMethod)
public int profileExit(int nextMethod, long startTime)
public void startProfiling()
public void stopProfiling()
public boolean isProfiling()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |