Works in SqueakVM but not Cog

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Works in SqueakVM but not Cog

Igor Stasenko
 
| newNil |
newNil := UndefinedObject basicNew.
nil becomeForward: newNil.
(Array new: 1) first == newNil

In Cog it just hangs VM (under Mac)

Any ideas how to fix that?


--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: Works in SqueakVM but not Cog

Eliot Miranda-2
 


On Mon, Dec 13, 2010 at 12:01 PM, Andreas Raab <[hidden email]> wrote:

On 12/13/2010 11:52 AM, Igor Stasenko wrote:
The problem i that we want to swap special objects array. And there
are two approaches:

1  - create a full object memory , which is a copy of existing objects
(but not everything, just selected pieces). This means that there will
be two 'nils' and therefore need a working #become: for swapping.

2  - mark a set of objects for inclusion in 'new' image, and throw
away the rest via stubbing. So, this approach avoids copying, but also
it doesn't allows to hold two object memories in object memory at same
time (host and baby one).

There are at least two more options:

(3) Write a primitive that replaces the special objects array and includes a set of classes to be updated (this would include all the literals).


which would give Cog the opportunity to void its code cache, hence  avoiding its limitations w.r.t. nil true false and the character table.

good approach  
 

(4) A variant on the above would make all these classes be compact and have them switch implicitly by replacing the compact classes array in the splObjs.

yes; as long as this is primitive Cog can intercept and react apropriately.

cheers
Eliot 


Cheers,
 - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Works in SqueakVM but not Cog

Igor Stasenko

On 13 December 2010 21:30, Eliot Miranda <[hidden email]> wrote:

>
>
>
> On Mon, Dec 13, 2010 at 12:01 PM, Andreas Raab <[hidden email]> wrote:
>>
>> On 12/13/2010 11:52 AM, Igor Stasenko wrote:
>>>
>>> The problem i that we want to swap special objects array. And there
>>> are two approaches:
>>>
>>> 1  - create a full object memory , which is a copy of existing objects
>>> (but not everything, just selected pieces). This means that there will
>>> be two 'nils' and therefore need a working #become: for swapping.
>>>
>>> 2  - mark a set of objects for inclusion in 'new' image, and throw
>>> away the rest via stubbing. So, this approach avoids copying, but also
>>> it doesn't allows to hold two object memories in object memory at same
>>> time (host and baby one).
>>
>> There are at least two more options:
>>
>> (3) Write a primitive that replaces the special objects array and includes a set of classes to be updated (this would include all the literals).
>
>
> which would give Cog the opportunity to void its code cache, hence  avoiding its limitations w.r.t. nil true false and the character table.
> good approach

Yep. But this requires modifying VM, which guys trying to avoid right now.

@Benjamin, i hope you watching this thread.
It would be good if you leave a comment(s) , because i don't know much
details about it and your current needs.
And only want to help.


--
Best regards,
Igor Stasenko AKA sig.