[FIX][VM][2] SLANG zapping warning messages fum does not return int, or variable foo not used

John M McIntosh johnmci at smalltalkconsulting.com
Fri Nov 29 07:14:21 UTC 2002


GCC is generates a lot more warnings. So I'm issuing some corrections  
to the voidIsVoidNotInt change set.

I had to add self cCode: 'return' inSmalltalk: [^self] in a lot more  
places, to allow a guard clause to return early without a value, or on  
a failure to terminate early. The GCC compiler was kind enough to  
complain a lot more than Code Warrior did.

I also realized that GCC 2.95.x for the powerpc is still quite stupid  
with global structure code  and  when you refer to foo->someField it  
loads the value for foo, then the offset in most cases. However having   
"register struct foo * foo = &fum;" in each method that uses fum,  
causes the compiler to load the address of fum into a working register,  
then on average you require one less instruction per reference to a  
field in fum. Some thinking and fiddling was required to identify  
methods that use a global structure so it would only insert the  
statement if needed so I avoid warnings about unused variable foo.

This results in about a 5% improvement on the macro benchmarks (Both  
for os-x and classic os-9). (or as much as 6% for a full GC).
We throw away about 8K of load instructions, good to see that on a 604e  
and a G3 removal of these instructions do make a difference.



--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===
-------------- next part --------------
A non-text attachment was scrubbed...
Name: voidIsVoidNotInt.5.cs.gz
Type: application/x-gzip
Size: 25042 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20021128/a129a57b/voidIsVoidNotInt.5.cs.bin


More information about the Squeak-dev mailing list