[Vm-dev] A stab at explaining Spur

Clément Bera bera.clement at gmail.com
Fri Aug 14 08:53:25 UTC 2015

Hello Stefan, Ryan and all,

I checked the paper where I read it (unfortunately it was rejected) and the
exact sentence was:

*In some implementations (e.g. Dart [22] and PyPy [3]), object header and
attribute storage can be separated, so the attribute storage can be
relocated in order to grow. *

*[3]C. F. Bolz. Efficiently implementing objects with maps
2010. [22]F. Schneider. Compiling dart to efficient machine code

When I read F. Boltz. post, it looks like to me that in Pypy each instance
of a class has a pointer to its map and its storage. The storage seems to
be at a different location than the object's header and holds the instance
variable values. To me it sounds very much like the object is 'split' to be
able to grow the storage if a new instance variable is added for a specific
instance. Accessing an object instance variable requires an extra
indirection through the storage pointer. Is there something I miss there ?
It looks like the paper we wrote with Eliot could definitely apply there in
order to speed up instance variable access by removing the indirection to
the storage.

In the talk compiling dart to efficient machine code, one section deals
about Javascript and V8. Objects are described in V8 (slide 29) as having a
pointer to their Map, their properties and their elements, which to me
sounds similar to Cincom Smalltalk design (the object header is separated
from the value of the instance variables). However the talk then discusses
the Dart implementation and it's not the case there. I guess I got confused
as the talk is about Dart but this part of the talk is about Javascript.

I am waiting for other people comments but to me it looks like the memory
representation where the object's header is separated from the the object's
fields is used in Javascript V8 and Pypy, as explained in the 2 references,
and that they could benefit from our implementation.

2015-08-14 9:51 GMT+02:00 Stefan Marr <smalltalk at stefan-marr.de>:

> Hi Clément:
> > On 14 Aug 2015, at 08:41, Clément Bera <bera.clement at gmail.com> wrote:
> >
> > 2015-08-14 4:29 GMT+02:00 Ryan Macnak <rmacnak at gmail.com>:
> >
> >> On Thu, Aug 13, 2015 at 1:19 AM, Clément Bera <bera.clement at gmail.com>
> wrote:
> >> I heard recently that the implementation used by Cincom Smalltalk,
> splitting the object in 2 (header + fields), is also used in Pypy and the
> Dart VM as Python and Dart allow the user to add instance variables to
> objects at runtime which leads to the same problem.
> > Objects are not split in the Dart VM, and it does not support adding
> instance variables or otherwise changing classes at runtime. Objects have a
> single-word header with a class index, size information and GC bits.
> Identity hashes are not often used in Dart, so they are kept in a side
> table.
> >
> > And I put "accept" on a paper that was claiming that... Damned. Any clue
> about Pypy ?
> PyPy uses maps ala Self, but objects are not ‘split’.
> It is more or less the same as with V8, which also uses maps aka hidden
> classes.
> Best regards
> Stefan
> --
> Stefan Marr
> Johannes Kepler Universität Linz
> http://stefan-marr.de/research/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20150814/68add857/attachment.htm

More information about the Vm-dev mailing list