Blue Book Implementation chapters online...

Eliot & Linda elcm at pacbell.net
Mon Jan 18 18:33:23 UTC 1999


Dwight,

> I have put Chapters 26-30 -- the Implementation -- of "Smalltalk-80: The
> Language and Its Implementation" (the famous and nearly impossible to
> find Blue Book) online at my site:
> 
>     http://users.ipa.net/~dwighth/

Great!  I took the liberty of putting a reference to this on the
VisualWorks Swiki at UIUC (brain.cs.uiuc.edu:8080/VisualWorks.1, off the
"Power Users" page.

> These still lack the figures, but I will be adding them shortly. I
> wanted to "unofficially" release them in their present not quite
> finished state so I could get some feedback. My site is equally rough,
> but will be subjected to a process of continual improvement.
> 
> Note: I have changed the left-arrow assignment operator to := to make
> the source code text cleaner (alternative representations of the left
> arrow were either ugly, didn't scale with the text, or were not portable
> across all common browers and fonts) and to make it agree with the
> normal "modern" Smalltalk conventions. I have also left each chapter as
> a single HTML page to allow easy printout for study.

There's an old bug in the following which didn't get fixed in the
reprint:

primitivePerformWithArgs 
          | thisReceiver performSelector argumentArray arrayClass
arraySize index | 
          argumentArray := self popStack. 
          arraySize := memory fetchWordLengthOf: argumentArray. 
          arrayClass := memory fetchClassOf: argumentArray. 
          self success: (stackPointer + arraySize) 
                         < (memory fetchWordLengthOf: activeContext). 
          self success: (arrayClass = ClassArrayPointer) 
          self success 
               ifTrue: [performSelector := messageSelector. 
                    messageSelector := self popStack. 
                    thisReceiver := self stackTop. 
                    argumentCount := arraySize. 
                    index := 1. 
                    [index <= argumentCount] 
                         whileTrue: [self push: (memory fetchPointer:
index - 1 
                                                 ofObject:
argumentArray). 
                              index := index + 1]. 
                    self lookupMethodInClass: (memory fetchClassOf:
thisReceiver). 
                    self success: (self argumentCountOf: newMethod) =
argumentCount. 
                    self success 
                         ifTrue: [self executeNewMethod] 
 > bug >                 ifFalse: [self unPop: argumentCount. 
                              self push: messageSelector. 
                              self push: argumentArray. 
                              argumentCount := 2. 
                              messageSelector := performSelector]] 
               ifFalse: [self unPop: 1]

"self unPop: argumentCount" should read "self pop: argumentCount".   The
primitive needs to pop the arguments pushed from the argument array if
the primitive fails here.
_______________,,,^..^,,,_______________
Eliot Miranda, ParcPlace





More information about the Squeak-dev mailing list