Back: CompiledBlock-saving and loading Up: Base classes Forward: CompiledCode class-cache flushing   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.38 CompiledCode

Defined in namespace Smalltalk
Superclass: ArrayedCollection
Category: Language-Implementation
I represent code that has been compiled. I am an abstract superclass for blocks and methods

1.38.1 CompiledCode class: cache flushing  (class)
1.38.2 CompiledCode class: instance creation  (class)
1.38.3 CompiledCode class: tables  (class)
1.38.4 CompiledCode: accessing  (instance)
1.38.5 CompiledCode: basic  (instance)
1.38.6 CompiledCode: copying  (instance)
1.38.7 CompiledCode: debugging  (instance)
1.38.8 CompiledCode: decoding bytecodes  (instance)
1.38.9 CompiledCode: literals - iteration  (instance)
1.38.10 CompiledCode: security  (instance)
1.38.11 CompiledCode: testing accesses  (instance)
1.38.12 CompiledCode: translation  (instance)


1.38.1 CompiledCode class: cache flushing

flushTranslatorCache
Answer any kind of cache mantained by a just-in-time code translator in the virtual machine (if any). Do nothing for now.


1.38.2 CompiledCode class: instance creation

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

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


1.38.3 CompiledCode class: tables

bytecodeInfoTable
Return a ByteArray which defines some properties of the bytecodes. For each bytecode, 4 bytes are reserved. The fourth byte is a flag byte: bit 7 means that the argument is a line number to be used in creating the bytecode->line number map.

The first three have a meaning only for those bytecodes that represent a combination of operations: the combination can be BC1 ARG BC2 OPERAND if the fourth byte's bit 0 = 0 or BC1 OPERAND BC2 ARG if the fourth byte's bit 0 = 1

where BC1 is the first byte, BC2 is the second, ARG is the third and OPERAND is the bytecode argument as it appears in the bytecode stream.

specialSelectors
Answer an array of message names that don't need to be in literals to be sent in a method. Their position here reflects their integer code in bytecode.

specialSelectorsNumArgs
Answer a harmoniously-indexed array of arities for the messages answered by #specialSelectors.


1.38.4 CompiledCode: accessing

at: anIndex put: aBytecode
Store aBytecode as the anIndex-th bytecode

blockAt: anIndex
Answer the CompiledBlock attached to the anIndex-th literal, assuming that the literal is a CompiledBlock or a BlockClosure.

bytecodeAt: anIndex
Answer the anIndex-th bytecode

bytecodeAt: anIndex put: aBytecode
Store aBytecode as the anIndex-th bytecode

flags
Private - Answer the optimization flags for the receiver

isAnnotated
Answer `false'.

literalAt: anIndex
Answer the anIndex-th literal

literalAt: anInteger put: aValue
Store aValue as the anIndex-th literal

literals
Answer the literals referenced by my code or any CompiledCode instances I own.

method
Answer the parent method for the receiver, or self if it is a method.

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 for the receiver

numLiterals
Answer the number of literals for the receiver

numTemps
Answer the number of temporaries for the receiver

primitive
Answer the primitive called 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.

stackDepth
Answer the number of stack slots needed for the receiver


1.38.5 CompiledCode: basic

= aMethod
Answer whether the receiver and aMethod are equal

hash
Answer an hash value for the receiver

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.38.6 CompiledCode: copying

deepCopy
Answer a deep copy of the receiver


1.38.7 CompiledCode: debugging

examineOn: aStream
Print the contents of the receiver in a verbose way.


1.38.8 CompiledCode: decoding bytecodes

dispatchTo: anObject with: param
Disassemble the bytecodes and tell anObject about them in the form of message sends. param is given as an argument to every message send.


1.38.9 CompiledCode: literals - iteration

allLiteralSymbolsDo: aBlock
As with #allLiteralsDo:, but only call aBlock with found Symbols.

allLiteralsDo: aBlock
Walk my literals, descending into Arrays and Messages, invoking aBlock with each touched object.

literalsDo: aBlock
Invoke aBlock with each object immediately in my list of literals.


1.38.10 CompiledCode: security

verify
Verify the bytecodes for the receiver, and raise an exception if the verification process failed.


1.38.11 CompiledCode: testing accesses

accesses: instVarIndex
Answer whether the receiver accesses the instance variable with the given index

assigns: instVarIndex
Answer whether the receiver writes to the instance variable with the given index

containsLiteral: anObject
Answer if the receiver contains a literal which is equal to anObject.

hasBytecode: byte between: firstIndex and: lastIndex
Answer whether the receiver includes the `byte' bytecode in any of the indices between firstIndex and lastIndex.

jumpDestinationAt: anIndex forward: aBoolean
Answer where the jump at bytecode index `anIndex' lands

reads: instVarIndex
Answer whether the receiver reads the instance variable with the given index

refersTo: anObject
Answer whether the receiver refers to the given object

sendsToSuper
Answer whether the receiver includes a send to super.

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


1.38.12 CompiledCode: translation

discardTranslation
Flush the just-in-time translated code for the receiver (if any).



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


This document was generated on July, 23 2009 using texi2html