[ENH][VM] Improved code generation (hopefully ;)

John M McIntosh johnmci at smalltalkconsulting.com
Tue Jul 8 07:14:25 UTC 2003


> John, Tim,
>
> > No all I did was download Squeak3.6a-5325 and update from
> > server, then update squeakmap, then install
> > VMMaker, then install your two changesets.
>
> Yes, I tried this and get the same result (should have checked before  
> but
> the changes were simple enough). Sooo .... how do I find out what  
> _exactly_
> has changed between 3.5 and 3.6alpha?
>
> Which raises an interesting general question: In this age of having
> everything at SqueakMap do we actually have a way of tracking changes
> between versions of packages? What I have here is a great example for  
> the
> kind of problem - I wasn't aware that _anything_ has changed in  
> VMMaker but
> apparently the changes were large enough to break everything I was  
> doing. So
> I have an urgent need to find out what and where things got changed.  
> How am
> I going to find out other than scanning (literally) thousands of lines  
> of
> code manually?
>
> Cheers,
> - Andreas


Well you can complain, thus trigging the thought that well the change  
is related to the VMMaker update
that came out in apri/may/june. So lets see, mmm a rewrite of global  
variable stuff. Mmm ok lets do some hunting.

Ah, found it.

You added a new TParseNode subclass, -> TInlineNode

Ah, it's missing a nodesVarCheckDo:
You need to add to

TInlineNode >>nodesVarCheckDo: aBlock
	method parseTree nodesDo: aBlock.
	aBlock value: self


Now, why is that here? Well it's  because the existing code somewhere  
somehow after doing the inlining has bogus references to variables  
within a method.  We inlined out variables, but they don't get deleted  
from the locals. In the past this led to compiler warnings about  
variables not used, which we cheerfully ignored.  At the time it seemed  
too difficult to understand why the locals aren't corrected, so  
TMethod>>zapBogusVariableReferences  I examine the parse tree, couldn't  
use nodesDo: that didn't traverse things correctly, thus I added  
nodeVarCheckDo:  which now counts variable usage, which is later used  
to decide if the register foo gets extruded based on global variable  
usage.  Plus used to delete non-used locals, because it's accurate.

Failure to have this in your new subclass resulted in the two local  
variables not being noticed, thus being
discarded.

--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===



More information about the Squeak-dev mailing list