The Trunk: Kernel-ar.266.mcz

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

The Trunk: Kernel-ar.266.mcz

commits-2
Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ar.266.mcz

==================== Summary ====================

Name: Kernel-ar.266
Author: ar
Time: 13 October 2009, 7:41 am
UUID: f651d6ae-0be3-a54b-9166-43f4b0abaa88
Ancestors: Kernel-ul.264, Kernel-ul.265

Merging Kernel-ul.264,  Kernel-ul.265:

- removed unnecessary #fixTemps send
- removed Float >> #shallowCopy. Primitive 148 seems to handle this correcly.

=============== Diff against Kernel-nice.263 ===============

Item was changed:
  ----- Method: BlockClosure>>postCopy (in category 'copying') -----
  postCopy
  "To render a copy safe we need to provide a new outerContext that
  cannot be returned from and a copy of any remoteTemp vectors.
  When a block is active it makes no reference to state in its nested
  contexts (this is the whole point of the indirect temps scheme; any
  indirect state is either copied or in indirect temp vectors.  So we
  need to substitute a dummy outerContext and copy the copiedValues,
  copying anything looking like a remote temp vector.  if we accidentally
  copy an Array that isn't actually an indirect temp vector we do extra work
  but don't break anything."
 
  outerContext := MethodContext
  sender: nil
  receiver: outerContext receiver
  method: outerContext method
+ arguments: #()!
- arguments: #().
- self fixTemps!

Item was removed:
- ----- Method: Float>>shallowCopy (in category 'copying') -----
- shallowCopy
-
- ^self - 0.0!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-ar.266.mcz

Nicolas Cellier
Hehe,  Float shallowCopy was just an attempt to solve a subtle bug
with a subtle solution...
I knew this was absolutely not necessary, super do it just well, and I
approve your rough fix !

Nicolas


2009/10/14  <[hidden email]>:

> Andreas Raab uploaded a new version of Kernel to project The Trunk:
> http://source.squeak.org/trunk/Kernel-ar.266.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-ar.266
> Author: ar
> Time: 13 October 2009, 7:41 am
> UUID: f651d6ae-0be3-a54b-9166-43f4b0abaa88
> Ancestors: Kernel-ul.264, Kernel-ul.265
>
> Merging Kernel-ul.264,  Kernel-ul.265:
>
> - removed unnecessary #fixTemps send
> - removed Float >> #shallowCopy. Primitive 148 seems to handle this correcly.
>
> =============== Diff against Kernel-nice.263 ===============
>
> Item was changed:
>  ----- Method: BlockClosure>>postCopy (in category 'copying') -----
>  postCopy
>        "To render a copy safe we need to provide a new outerContext that
>         cannot be returned from and a copy of any remoteTemp vectors.
>         When a block is active it makes no reference to state in its nested
>         contexts (this is the whole point of the indirect temps scheme; any
>         indirect state is either copied or in indirect temp vectors.  So we
>         need to substitute a dummy outerContext and copy the copiedValues,
>         copying anything looking like a remote temp vector.  if we accidentally
>         copy an Array that isn't actually an indirect temp vector we do extra work
>         but don't break anything."
>
>        outerContext := MethodContext
>                                                sender: nil
>                                                receiver: outerContext receiver
>                                                method: outerContext method
> +                                               arguments: #()!
> -                                               arguments: #().
> -       self fixTemps!
>
> Item was removed:
> - ----- Method: Float>>shallowCopy (in category 'copying') -----
> - shallowCopy
> -
> -       ^self - 0.0!
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-ar.266.mcz

Eliot Miranda-2
In reply to this post by commits-2
So what semantics do people think BlockClosure>>copy should have?  I think I wasn't thinking when I wrote the original of the method below.  It seems to me that all one needs is to do shallowCopy.  Returning from a copy of a block seems fine. The first method return form a method wins.  e.g. [^1] copy value should still return.  Makes no sense for it to throw an error.  So the right resolution is simply to delete postCopy.

On Tue, Oct 13, 2009 at 7:41 PM, <[hidden email]> wrote:
Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ar.266.mcz

==================== Summary ====================

Name: Kernel-ar.266
Author: ar
Time: 13 October 2009, 7:41 am
UUID: f651d6ae-0be3-a54b-9166-43f4b0abaa88
Ancestors: Kernel-ul.264, Kernel-ul.265

Merging Kernel-ul.264,  Kernel-ul.265:

- removed unnecessary #fixTemps send
- removed Float >> #shallowCopy. Primitive 148 seems to handle this correcly.

=============== Diff against Kernel-nice.263 ===============

Item was changed:
 ----- Method: BlockClosure>>postCopy (in category 'copying') -----
 postCopy
       "To render a copy safe we need to provide a new outerContext that
        cannot be returned from and a copy of any remoteTemp vectors.
        When a block is active it makes no reference to state in its nested
        contexts (this is the whole point of the indirect temps scheme; any
        indirect state is either copied or in indirect temp vectors.  So we
        need to substitute a dummy outerContext and copy the copiedValues,
        copying anything looking like a remote temp vector.  if we accidentally
        copy an Array that isn't actually an indirect temp vector we do extra work
        but don't break anything."

       outerContext := MethodContext
                                               sender: nil
                                               receiver: outerContext receiver
                                               method: outerContext method
+                                               arguments: #()!
-                                               arguments: #().
-       self fixTemps!

Item was removed:
- ----- Method: Float>>shallowCopy (in category 'copying') -----
- shallowCopy
-
-       ^self - 0.0!





Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-ar.266.mcz

Nicolas Cellier
Agree, the shallowCopy should simply work.

2009/10/14 Eliot Miranda <[hidden email]>:

> So what semantics do people think BlockClosure>>copy should have?  I think I
> wasn't thinking when I wrote the original of the method below.  It seems to
> me that all one needs is to do shallowCopy.  Returning from a copy of a
> block seems fine. The first method return form a method wins.  e.g. [^1]
> copy value should still return.  Makes no sense for it to throw an error.
>  So the right resolution is simply to delete postCopy.
> On Tue, Oct 13, 2009 at 7:41 PM, <[hidden email]> wrote:
>>
>> Andreas Raab uploaded a new version of Kernel to project The Trunk:
>> http://source.squeak.org/trunk/Kernel-ar.266.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Kernel-ar.266
>> Author: ar
>> Time: 13 October 2009, 7:41 am
>> UUID: f651d6ae-0be3-a54b-9166-43f4b0abaa88
>> Ancestors: Kernel-ul.264, Kernel-ul.265
>>
>> Merging Kernel-ul.264,  Kernel-ul.265:
>>
>> - removed unnecessary #fixTemps send
>> - removed Float >> #shallowCopy. Primitive 148 seems to handle this
>> correcly.
>>
>> =============== Diff against Kernel-nice.263 ===============
>>
>> Item was changed:
>>  ----- Method: BlockClosure>>postCopy (in category 'copying') -----
>>  postCopy
>>        "To render a copy safe we need to provide a new outerContext that
>>         cannot be returned from and a copy of any remoteTemp vectors.
>>         When a block is active it makes no reference to state in its
>> nested
>>         contexts (this is the whole point of the indirect temps scheme;
>> any
>>         indirect state is either copied or in indirect temp vectors.  So
>> we
>>         need to substitute a dummy outerContext and copy the copiedValues,
>>         copying anything looking like a remote temp vector.  if we
>> accidentally
>>         copy an Array that isn't actually an indirect temp vector we do
>> extra work
>>         but don't break anything."
>>
>>        outerContext := MethodContext
>>                                                sender: nil
>>                                                receiver: outerContext
>> receiver
>>                                                method: outerContext method
>> +                                               arguments: #()!
>> -                                               arguments: #().
>> -       self fixTemps!
>>
>> Item was removed:
>> - ----- Method: Float>>shallowCopy (in category 'copying') -----
>> - shallowCopy
>> -
>> -       ^self - 0.0!
>>
>>
>
>
>
>
>