Add an instVar to a class. Bytecode issue

Andreas Raab andreas.raab at gmx.de
Tue Apr 27 14:09:10 UTC 2004


> Is there a way to avoid a hierarchy recompilation when
> an instance variable is added to a class?

Depends on the precise meaning of "recompilation". If you are using it to
describe a "recompilation from source code", then yes, there is a way:

http://map1.squeakfoundation.org/sm/packagebyname/methodrecompiler

> In VW, with the parcel, all the methods present in the subclasses
> have the offset in the compiled methods adjusted.

To me, this is one of the possible meanings of "recompilation" (e.g.,
regeneration of a compiled method from arbitrary input - in this case, the
prior version of the method itself).

> Is it possible to do it in Squeak?

Yes. MethodRecompiler does precisely that.

> Will I encounter some big issue with that?

No more than usual - e.g., things might horribly crash in the case of blocks
but that's the situation we have already and apparently it isn't causing
major pains (or else I'd expect to have heard of it).

> Andreas, you once said you were working on this issue.
> What is your current plan/status?

Again, see the above package. I can't say whether it will work in 3.7 but
I've tried to update it for 3.6 (it was originally written for 3.0) so it
should work.

Cheers,
  - Andreas




More information about the Squeak-dev mailing list