Why Interpreter isa ObjectMemory

Anthony Hannan ajh18 at cornell.edu
Sun Feb 24 08:11:32 UTC 2002


Tim Rowledge <tim at sumeru.stanford.edu> wrote:
>
> "PhiHo Hoang" <phiho.hoang at rogers.com> is claimed by the authorities to have written:
> > 	I read through the missing chapters of the Blue Book but miss
> > the point why Interpreter is a subclass of ObjectMemory.
>
> It makes it simpler to generate the single interp.c file.

Since message sends in Interpreter and ObjectMemory are translated to C
function calls, which does no receiver dispatching, the receiver always
has to be self, hence the choice to make ObjectMemory a superclass.  If
you separate ObjectMemory out to another object you will have to update
the CGenerator so it knows that message sends to objectMemory are just
regular function calls.  You will still have to maintain that
method names are unique across both Interpreter and ObjectMemory,
unless you put them in seperate C modules and utilize private functions.



More information about the Squeak-dev mailing list