Back: Collection-testing collections Up: Base classes Forward: CompiledBlock class-instance creation   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.37 CompiledBlock

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

1.37.1 CompiledBlock class: instance creation  (class)
1.37.2 CompiledBlock: accessing  (instance)
1.37.3 CompiledBlock: basic  (instance)
1.37.4 CompiledBlock: printing  (instance)
1.37.5 CompiledBlock: saving and loading  (instance)


1.37.1 CompiledBlock class: instance creation

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.


1.37.2 CompiledBlock: accessing

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

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


1.37.3 CompiledBlock: basic

= 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


1.37.4 CompiledBlock: printing

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


1.37.5 CompiledBlock: saving and loading

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.



Back: CompiledBlock-printing Up: CompiledBlock Forward: CompiledCode   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on February, 22 2012 using texi2html