Squeak Class Documentation category index | class index  
 
InstructionStream
  category: Kernel-Methods
  superclass: Object
  subclasses: ContextPart Decompiler InstructionPrinter

My instances can interpret the byte-encoded Smalltalk instruction set. They maintain a program counter (pc) for streaming through CompiledMethods. My subclasses are Contexts, which inherit this capability. They store the return pointer in the instance variable sender, and the current position in their method in the instance variable pc. For other users, sender can hold a method to be similarly interpreted. The unclean re-use of sender to hold the method was to avoid a trivial subclass for the stand-alone scanning function.

instance methods
  decoding
  interpretJump
interpretNextInstructionFor:

  private
  interpretExtension:in:for:
method:pc:

  scanning
  addSelectorTo:
followingByte
method
nextByte
pc
scanFor:
skipBackBeforeJump
thirdByte

  testing
  willJumpIfFalse
willJumpIfTrue
willReallySend
willReturn
willSend
willStore
willStorePop

class methods
  class initialization
  initialize

  instance creation
  on:

instance methods
  decoding top  
 

interpretJump


 

interpretNextInstructionFor:

Send to the argument, client, a message that specifies the type of the
next instruction.


  private top  
 

interpretExtension:in:for:


 

method:pc:


  scanning top  
 

addSelectorTo:

If this instruction is a send, add its selector to set.


 

followingByte

Answer the next bytecode.


 

method

Answer the compiled method that supplies the receiver's bytecodes.


 

nextByte

Answer the next bytecode.


 

pc

Answer the index of the next bytecode.


 

scanFor:

Answer the index of the first bytecode for which scanBlock answer true
when supplied with that bytecode.


 

skipBackBeforeJump

Assuming that the receiver is positioned jast after a jump, skip back one or two bytes, depending on the size of the previous jump instruction.


 

thirdByte

Answer the next bytecode.


  testing top  
 

willJumpIfFalse

Answer whether the next bytecode is a jump-if-false.


 

willJumpIfTrue

Answer whether the next bytecode is a jump-if-true.


 

willReallySend

Answer whether the next bytecode is a real message-send,
not blockCopy:.


 

willReturn

Answer whether the next bytecode is a return.


 

willSend

Answer whether the next bytecode is a message-send.


 

willStore

Answer whether the next bytecode is a store or store-pop


 

willStorePop

Answer whether the next bytecode is a store-pop.


class methods
  class initialization top  
 

initialize

Initialize an array of special constants returned by single-bytecode returns.


  instance creation top  
 

on:

Answer an instance of me on the argument, method.