Squeak Class Documentation category index | class index  
 
MethodContext
  category: Kernel-Methods
  superclass: ContextPart
  subclasses:

My instances hold all the dynamic state associated with the execution of a CompiledMethod. In addition to their inherited state, this includes the receiver, a method, and temporary space in the variable part of the context.

MethodContexts, though normal in their variable size, are actually only used in two sizes, small and large, which are determined by the temporary space required by the method being executed.

MethodContexts must only be created using the method newForMethod:. Note that it is impossible to determine the real object size of a MethodContext except by asking for the frameSize of its method. Any fields above the stack pointer (stackp) are truly invisible -- even (and especially!) to the garbage collector. Any store into stackp other than by the primitive method stackp: is potentially fatal.

instance methods
  accessing
  hasInstVarRef
home
method
receiver
removeSelf
tempAt:
tempAt:put:

  controlling
  answer:

  initialize-release
  restart
restartWith:

  printing
  printDetails:

  private
  instVarAt:put:
setSender:receiver:method:arguments:

  private-debugger
  cachedStackTop
cachesStack
hideFromDebugger

  private-exceptions
  cannotReturn:
isHandlerContext
isUnwindContext
receiver:

class methods
  instance creation
  sender:receiver:method:arguments:

instance methods
  accessing top  
 

hasInstVarRef

Answer whether the receiver references an instance variable.


 

home

Refer to the comment in ContextPart|home.


 

method

Answer the method of this context.


 

receiver

Refer to the comment in ContextPart|receiver.


 

removeSelf

Nil the receiver pointer and answer its former value.


 

tempAt:

Refer to the comment in ContextPart|tempAt:.


 

tempAt:put:

Refer to the comment in ContextPart|tempAt:put:.


  controlling top  
 

answer:

ar 3/6/2001: OBSOLETE. Must not be used. Will be removed VERY SOON.


  initialize-release top  
 

restart

Reinitialize the receiver so that it is in the state it was at its creation.


 

restartWith:

Reinitialize the receiver as though it had been for a different method.
Used by a Debugger when one of the methods to which it refers is
recompiled.


  printing top  
 

printDetails:

Put my class>>selector and instance variables and arguments and temporaries on the stream. Protect against errors during printing.


  private top  
 

instVarAt:put:

Primitive. Store a value into a fixed variable in the receiver. The
numbering of the variables corresponds to the named instance variables.
Fail if the index is not an Integer or is not the index of a fixed variable.
Answer the value stored as the result. Using this message violates the
principle that each object has sovereign control over the storing of
values into its instance variables. Essential. See Object documentation
whatIsAPrimitive.


 

setSender:receiver:method:arguments:

Create the receiver's initial state.


  private-debugger top  
 

cachedStackTop

WARNING - this method depends on a very dirty trick, viz. snitching information off the variable stack of a particular CompiledMethod. So if you add/remove a temp in BlockContext>>valueUninterruptably, this method will fail, probably with some horrible consequences I'd rather not think through just now ... assumption is that the variable declaration in that method looks like:
| sendingContext result homeSender |


 

cachesStack


 

hideFromDebugger


  private-exceptions top  
 

cannotReturn:


 

isHandlerContext

is this context for method that is marked?


 

isUnwindContext

is this context for method that is marked?


 

receiver:


class methods
  instance creation top  
 

sender:receiver:method:arguments:

Answer an instance of me with attributes set to the arguments.