public final class ThreadContext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
callNumber |
boolean |
is19 |
IRubyObject |
nil |
Ruby |
runtime |
RuntimeCache |
runtimeCache |
Modifier and Type | Method and Description |
---|---|
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 for Kernel#caller
|
static java.lang.String |
createRawBacktraceStringFromThrowable(java.lang.Throwable t) |
RubyStackTraceElement[] |
createWarningBacktrace(Ruby runtime)
Create an Array with backtrace information for a built-in warning
|
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() |
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() |
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() |
ProfileData |
getProfileData()
Get the profile data for this thread (ThreadContext).
|
java.util.Set<RecursiveComparator.Pair> |
getRecursiveSet() |
RubyModule |
getRubyClass() |
RubyDateFormat |
getRubyDateFormat() |
int |
getRubyFrameDelta() |
Ruby |
getRuntime()
Retrieve the runtime associated with this context.
|
RubyThread |
getThread() |
boolean |
isEventHooksEnabled() |
boolean |
isJumpTargetAlive(int target,
int skipFrames)
Search the frame stack for the given JumpTarget.
|
boolean |
isProfiling() |
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 |
preMethodFrameAndClass(RubyModule implClass,
java.lang.String name,
IRubyObject self,
Block block,
StaticScope staticScope) |
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()
Deprecated.
|
Binding |
previousBinding(IRubyObject self)
Deprecated.
|
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 |
profileEnter(java.lang.String name,
DynamicMethod nextMethod) |
int |
profileExit(int nextMethod,
long startTime) |
static void |
pushBacktrace(ThreadContext context,
java.lang.String method,
ISourcePosition position) |
static void |
pushBacktrace(ThreadContext context,
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) |
boolean |
scopeExistsOnCallStack(StaticScope s)
Check if a static scope is present on the call stack.
|
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(Fiber fiber) |
void |
setFile(java.lang.String file)
Deprecated.
|
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 |
setRecursiveSet(java.util.Set<RecursiveComparator.Pair> recursiveSet) |
void |
setRubyFrameDelta(int newDelta) |
void |
setThread(RubyThread thread) |
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) |
public final Ruby runtime
public final IRubyObject nil
public final RuntimeCache runtimeCache
public final boolean is19
public int callNumber
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()
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 DynamicScope getPreviousScope()
public void pushScope(DynamicScope scope)
public void popScope()
public RubyThread getThread()
public RubyDateFormat getRubyDateFormat()
public void setThread(RubyThread thread)
public Fiber getFiber()
public void setFiber(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 forpublic 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 method, ISourcePosition position)
public static void pushBacktrace(ThreadContext context, 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 searchingpublic boolean scopeExistsOnCallStack(StaticScope s)
s
- the static scope to look forpublic 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 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
- public 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 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 preMethodFrameAndClass(RubyModule implClass, java.lang.String name, IRubyObject self, Block block, StaticScope staticScope)
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 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 ProfileData getProfileData()
public void startProfiling()
public void stopProfiling()
public boolean isProfiling()
public int profileEnter(int nextMethod)
public int profileEnter(java.lang.String name, DynamicMethod nextMethod)
public int profileExit(int nextMethod, long startTime)
public java.util.Set<RecursiveComparator.Pair> getRecursiveSet()
public void setRecursiveSet(java.util.Set<RecursiveComparator.Pair> recursiveSet)
@Deprecated public void setFile(java.lang.String file)
Copyright © 2002-2009 JRuby Team. All Rights Reserved.