[FIX] Re: Looking at compiler inline...

Alan Grimes alangrimes at starpower.net
Thu Apr 8 20:12:20 UTC 2004


Attached is a fix to the built-in method "preDecrement" which was 
generating wrong code.

Tim Rowledge wrote:

>>I looked at how inlining works and made a few discoveries.
>>    
>>
>[snip]
>Alan you really need to read the code; there is an entire inlining
>phase in the CCodeGenerator - hell there's an entire protocol!
>  
>

I am well aware of that.
I was discussing how the compiler treats a certain smalltalk directive. 
If you recall, when we last talked about inlining we discussed making 
gcc do the inlining. I had proposed that we honor the "self inline: 
true." statements. The last message was merely my status report on that 
project.

> That's how it is designed. It uses the Smalltalk compiler to produce
>
>compiler methods and converts those into TMethods. Writing a C compiler
>in Smalltalk is surely doable but pointless in my opinion - aside from
>other considerations we need a better Slang translator not a C
>compiler. 
>

What is Slang? Is there a URL? (It's not on SM)


-------------- next part --------------
'From Squeak3.6 of ''6 October 2003'' [latest update: #5429] on 8 April 2004 at 3:34:06 pm'!

!CCodeGenerator methodsFor: 'C translation' stamp: 'ATG 4/8/2004 15:03'!
generatePreDecrement: msgNode on: aStream indent: level
	"Generate the C code for this message onto the given stream."

	| varNode |
	varNode _ msgNode receiver.
	varNode isVariable
		ifFalse: [ self error: 'preDecrement can only be applied to variables' ].
	aStream nextPutAll: '--'.
	aStream nextPutAll: (self returnPrefixFromVariable: varNode name).
! !


More information about the Squeak-dev mailing list