Hello.. I'm pretty sure that squeak fairly severely overinlines, in that in some places, its a good idea to inline a function and in other places it is not a good idea, because inlining in the other places leads to code bloat.
As my first attempt at it, I've attempted to build an interpreter with NO inlining. I have succeeded, although, with three problems: 1. A lot more compiler warnings from casting from int to pointer. 2. ../src/unix/util/gnuify has a check for no inlining, and fails. This had to be removed.
3. The following function, the '******' line is wrong. I'm not sure how to fix this; I just hacked the generated C file.
context: thisCntx hasSender: aContext "Does thisCntx have aContext in its sender chain?" | s nilOop | self inline: true. thisCntx == aContext ifTrue: [^ false]. nilOop _ nilObj. s _ self fetchPointer: SenderIndex ofObject: thisCntx. [s == nilOop] whileFalse: [s == aContext ifTrue: [^ true]. s _ s self fetchPointer: SenderIndex ofObject: s]. *********************************************** ^ false
- The following function, the '******' line is wrong. I'm not sure how
to fix this; I just hacked the generated C file.
context: thisCntx hasSender: aContext "Does thisCntx have aContext in its sender chain?" | s nilOop | self inline: true. thisCntx == aContext ifTrue: [^ false]. nilOop _ nilObj. s _ self fetchPointer: SenderIndex ofObject: thisCntx. [s == nilOop] whileFalse: [s == aContext ifTrue: [^ true]. s _ s self fetchPointer: SenderIndex ofObject: s]. *********************************************** ^ false
Scott -
Good catch.
I didn't write this method, but I am certain it should read:
s _ self fetchPointer: SenderIndex ofObject: s].
The loop is simply crawling up the sender chain (as per the comment).
- Dan
Dan Ingalls wrote: [snip]
Scott -
Good catch.
I didn't write this method, but I am certain it should read:
s _ self fetchPointer: SenderIndex ofObject: s].
Yow! I _did_ originally write that method (although the version browser swears that the current version was edited by Andreas ) and I really hope I didn't write it like that. It most certainly should be as Dan suggested.
I'm going to stick with blaming Andreas; after all the version browser never lies :-). The problem should have been flagged somewhere along the line by the compiler asking if you really meant for 'self' to be a message to 's'! Of course, that now means that #self is in the list of known message names.
The inliner seems to remove all the extra stuff ok, so at least current vms are ok. Bug fix follows...
tim
- ../src/unix/util/gnuify has a check for no inlining, and fails. This
had to be removed.
I guess it's easy enough to fix, but just by the way the gnuify on my web site also survives a non-inlined interpreter. It just quietly cats the file back out in that case.
http://www.cc.gatech.edu/~lex/squeak/
-Lex
squeak-dev@lists.squeakfoundation.org