Hi Levente,

    try out the latest VMs.  They don't fix the bugs, but do change the symptoms.  e.g. in

c := [ 3 + PartialContinuationNotification signal ]
        on: PartialContinuationNotification
        do: [ :not | not continuation ].
c value: 4. "==> 7"

there is now an MNU of #+ since 3 has been replaced by a MethodContext.

So if I could ask you could dig in again, that would help.

thanks!

best,
Eliot

2011/4/25 Levente Uzonyi <leves@elte.hu>
 
On Sun, 24 Apr 2011, Eliot Miranda wrote:

Great catch Levente.  I'll try and track this down asap.

Great, thanks. I found that primitive 148 (#shallowCopy) doesn't copy the pc and the temporaries (indexable fields). But there are some other interesting cases, where the number of indexable fields are different. To reproduce this issue, replace ContextPart >> #copyTo: with the following:

copyTo: aContext
       "Copy self and my sender chain down to, but not including, aContext.  End of copied chain will have nil sender."

       | copy |
       self == aContext ifTrue: [ ^nil ].
       copy := self copy.
       "Cog doesn't copy the pc, so copy it here."
       copy pc: pc.
       copy basicSize = self basicSize ifFalse: [ self halt ].
       sender ifNotNil: [ copy privSender: (sender copyTo: aContext) ].
       ^copy

Then evaluate

c := [ 3 + [ :k | k ] shift ] reset.

in the workspace in the image I prepared. Two halts will appear after each other (proceed after the first). In the first case the size of the copy is smaller than the original, in the second case it's larger.


Levente