Category: Language-Implementation
Superclass: CompiledCode
I represent a block that has been compiled.

Method category index

instance creation (class)
accessing (instance)
basic (instance)
printing (instance)
saving and loading (instance)

instance creation (class)

new: numBytecodes header: anInteger method: outerMethod
Answer a new instance of the receiver with room for the given number of bytecodes and the given header.

numArgs: args numTemps: temps bytecodes: bytecodes depth: depth literals: literalArray

Answer an (almost) full fledged CompiledBlock. To make it complete, you must either set the new object's `method' variable, or put it into a BlockClosure and put the BlockClosure into a CompiledMethod's literals. The clean-ness of the block is automatically computed.

top


accessing (instance)

arguments
Not commented.

flags

Answer the `cleanness' of the block. 0 = clean; 1 = access to receiver variables and/or self; 2-30 = access to variables that are 1-29 contexts away; 31 = return from method or push thisContext

method

Answer the CompiledMethod in which the receiver lies

method: aCompiledMethod

Not commented.

methodClass

Answer the class in which the receiver is installed.

methodClass: methodClass

Set the receiver's class instance variable

numArgs

Answer the number of arguments passed to the receiver

numLiterals

Answer the number of literals for the receiver

numTemps

Answer the number of temporary variables used by the receiver

selector

Answer the selector through which the method is called

selector: aSymbol

Set the selector through which the method is called

sourceCodeLinesDelta

Answer the delta from the numbers in LINE_NUMBER bytecodes to source code line numbers.

sourceCodeMap

Answer an array which maps bytecode indices to source code line numbers. 0 values represent invalid instruction pointer indices.

stackDepth

Answer the number of stack slots needed for the receiver

temporaries

Not commented.

top


basic (instance)

= aMethod
Answer whether the receiver and aMethod are equal

methodCategory

Answer the method category

methodCategory: aCategory

Set the method category to the given string

methodSourceCode

Answer the method source code (a FileSegment or String or nil)

methodSourceFile

Answer the file where the method source code is stored

methodSourcePos

Answer the location where the method source code is stored in the methodSourceFile

methodSourceString

Answer the method source code as a string

top


printing (instance)

printOn: aStream
Print the receiver's class and selector on aStream

top


saving and loading (instance)

binaryRepresentationObject
This method is implemented to allow for a PluggableProxy to be used with CompiledBlocks. Answer a DirectedMessage which sends #blockAt: to the CompiledMethod containing the receiver.

top