Why does every method get sent a #methodClass:
stephane ducasse
stephane.ducasse at gmail.com
Wed Sep 27 06:46:10 UTC 2006
Tx!
This makes a lot of code much simpler and faster (the usual speed/
complexity/memory tradeoff).
> Equally important, the method class normalizes the format of
> CompiledMethod with respect to method properties. Before adding the
> method class for each method, methods with super-sends would store
> their properties in the next-to-last literal, those without in the
> last. Which is a pain to maintain. Plus, there are some situations
> where the ability to reason about the origin of a loose compiled
> method (e.g., one not stored in any method dictionary due to
> recompilation) is critical for being able to persist them correctly
> (like when you try to determine whether that compiled method will
> crash your system after loading it back in since it accesses iVars
> beyond the end of the object). All in all, I'm a big fan of these
> particular changes - they make many things trivial that would be
> somewhere between hard to near impossible otherwise. At the cost of
> four (if you could method properties eight) bytes per compiled
> method which -to me- seems a reasonable tradeoff in this case.
More information about the Squeak-dev
mailing list
|