[squeak-dev] About generating compiled method(s)
eliot.miranda at gmail.com
Thu Dec 10 23:58:43 UTC 2009
On Thu, Dec 10, 2009 at 3:40 PM, Igor Stasenko <siguctua at gmail.com> wrote:
> This question is mostly to Eliot,
> since he the last who dare to touch the Compiler deeply..
> My concern is use pattern:
> method := methodNode generate: #(0 0 0 0).
> ^method copyWithTempsFromMethodNode: methodNode
> the point of nitpicking is the need of generating a dummy
> CompiledMethod instance,
> which used for nothing else than making a copy and attachment of temp
> And, the question, is there a way to skip generating the dummy
> compiled method and just do:
> method := methodNode generateWithTempNames.
> method := methodNode generate: (methodNode tempsTrailer).
I think so, but is it worth-while? The temp names can only be generated
correctly once the closure analysis is done, see ensureClosureAnalysisDone
in generate:. So you'd have to pass in a flag to generate: saying you
wanted to append temps, compute the temps after ensureClosureAnalysisDone,
derive how many bytes they would compress to, and add that to the size of
the method being computed. But that would open up details of the
compression scheme to the generate: method. But saving one instantiation
amongst hundreds, perhaps thousands, in an average compile is probably not
I expect that more worth-while would be to rip out my hack of Dan's hack
compression algorithm for temp names and replace it with the use of gzip,
which is built into the system and does a far better job than my
modification of Dan's scheme.
> Best regards,
> Igor Stasenko AKA sig.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev