[squeak-dev] Re: Why you need new Method trailers? :)

Igor Stasenko siguctua at gmail.com
Mon Dec 21 01:27:52 UTC 2009

A little more.

I made an experiment with compressing a method sources into trailers.

(you need to file in a changeset (trailer-fixes-extensions.1.cs )

What i did is:

CompiledMethod allInstancesDo: [:m | m dropSourcePointer ]

It takes a while (compressing sources).

A more faster way is to do same in workspace:

old := CompiledMethod allInstances select: [ :each | each trailer
hasSourcePointer ].
new := old collect: [ :each |
	each copyWithTrailerBytes: (CompiledMethodTrailer new sourceCode:
each getSource) ].
old elementsForwardIdentityTo: new.

Image size: 26,192,916 bytes

Image size: 33,348,596 bytes

difference: 7,155,680 bytes.

But this means, that your image doesn't have to use .sources file, which is
17,584,724 bytes long
as well as .changes
11,745,139 bytes long..

of course, stripping like this, will leave you without method stamps.. :)

Best regards,
Igor Stasenko AKA sig.

More information about the Squeak-dev mailing list