first window, yay! Re: [Vm-dev] VM Maker: VMMaker.oscog-eem.399.mcz

Eliot Miranda eliot.miranda at gmail.com
Tue Oct 22 17:03:13 UTC 2013


Hi Mario,


On Mon, Oct 21, 2013 at 4:15 PM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:

>
>
>
>>
>>
>>> - Are #become: and #becomeForward: optimized for the case where both
>>> objects use the same amount of memory?
>>
>>
>> Yes.  This case simply swaps contents and adjusts the remembered table
>> accordingly.  Tim also suggested optimizing the other case, copying into
>> the smaller object and only allocating one extra clone, which I'll
>> implement soon.
>>
>
> Just curious....This "simply swaps contents" isn't only for #become: ? Or
> there is a way to do something to avoid updating pointers for
> #becomeForward as well?
>

Forwarding is the case one needs for becomeForward:.  Think about the
semantics; references to object A must change to be references to object B.
 object B must be unchanged.  object A can be collected.  So one either
forwards object A to object B or sweeps the heap replacing references to
object A with references to object B.  There is no opportunity to swap
contents with becomeForward:.  Do you agree?


 Maybe there is something related about lazy become / forwarding pointers /
> proxies or whatever that could help?
>

Yes, forwarding means all the system has to do is change object A into a
forwarder to object B.  That's what Spur does.  No heap sweep.  It just (*)
changes the class and format of object A to say "I'm a forwarder" and
replaces the first slot with a reference to object B.

(*) in fact, it must then do more; ensuring that nothing along the
superclass chain of any class in use is forwarded, because otherwise the VM
would have to check for forwarding pointers when doing message lookup.  But
this is a small subset of the heap to scan, all reachable from the class
table.

HTH,
Eliot


> Thanks,
>
>
>>
>>
>>>
>>>
>>>
>>> Levente
>>>
>>>
>>> On Sat, 21 Sep 2013, btc at openinworld.com wrote:
>>>
>>>
>>>> commits at source.squeak.org wrote:
>>>>
>>>>>  Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
>>>>> http://source.squeak.org/**VMMaker/VMMaker.oscog-eem.399.**mcz<http://source.squeak.org/VMMaker/VMMaker.oscog-eem.399.mcz>
>>>>>
>>>>> ==================== Summary ====================
>>>>>
>>>>> Name: VMMaker.oscog-eem.399
>>>>> Author: eem
>>>>> Time: 20 September 2013, 6:28:56.308 pm
>>>>> UUID: 89f8fefe-b59d-42d7-9c11-**7f848d0e5131
>>>>> Ancestors: VMMaker.oscog-eem.398
>>>>>
>>>>> A few isIntegerObject:'s => isImmediate:'s in primitives.
>>>>>
>>>>> More protocol.
>>>>>
>>>>> The Spur VM now draws its first window!!
>>>>>
>>>>>
>>>>>  A cheer goes up in the crowd of interested spectators.
>>>> Probably lots still to do, but its a nice concrete milestone.
>>>> Contributing is beyond me at this time, so I especially like to thank
>>>> you for this important initiative.
>>>>
>>>> cheers -ben
>>>>
>>>>
>>
>>
>> --
>> best,
>> Eliot
>>
>>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20131022/90fec648/attachment.htm


More information about the Vm-dev mailing list