The Trunk: Kernel-eem.1367.mcz

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

The Trunk: Kernel-eem.1367.mcz

commits-2
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1367.mcz

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

Name: Kernel-eem.1367
Author: eem
Time: 1 February 2021, 6:57:09.713484 pm
UUID: def9aaa1-eb71-4da5-8f86-85856d9b88ad
Ancestors: Kernel-eem.1366

Fix mistake in the previous commit.  Thanks Levente!

=============== Diff against Kernel-eem.1366 ===============

Item was changed:
  ----- Method: Context>>isPrimFailToken: (in category 'private') -----
+ isPrimFailToken: contextOrPrimFailToken
+ "Answer if contextOrPrimFailToken, which will either be a Context object or
+ a primitive fail token (a tuple of the PrimitiveFailToken unique object and
+ a primitive failure code), is the latter. This should only be used with the
+ (possibly indirect) results of Context>>doPrimitive:method:receiver:args:"
+ ^contextOrPrimFailToken isArray
+  and: [contextOrPrimFailToken size = 2
+  and: [(contextOrPrimFailToken at: 1) == PrimitiveFailToken]]!
- isPrimFailToken: anObject
- ^(self objectClass: anObject) isArray
-  and: [anObject size = 2
-  and: [(anObject at: 1) == PrimitiveFailToken]]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-eem.1367.mcz

Christoph Thiede

Hi Eliot,


thanks for the fix! Sorry for raising the same question again, but wouldn't it still be safer to dispense with the #isArray call here? It allows the simulated code to break out of the simulation by overriding #isArray anywhere. I think I posted a proof of concept here: http://forum.world.st/The-Trunk-Kernel-eem-1366-mcz-tp5126558p5126713.html :-)


Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 2. Februar 2021 03:57:12
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: Kernel-eem.1367.mcz
 
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1367.mcz

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

Name: Kernel-eem.1367
Author: eem
Time: 1 February 2021, 6:57:09.713484 pm
UUID: def9aaa1-eb71-4da5-8f86-85856d9b88ad
Ancestors: Kernel-eem.1366

Fix mistake in the previous commit.  Thanks Levente!

=============== Diff against Kernel-eem.1366 ===============

Item was changed:
  ----- Method: Context>>isPrimFailToken: (in category 'private') -----
+ isPrimFailToken: contextOrPrimFailToken
+        "Answer if contextOrPrimFailToken, which will either be a Context object or
+         a primitive fail token (a tuple of the PrimitiveFailToken unique object and
+         a primitive failure code), is the latter. This should only be used with the
+         (possibly indirect) results of Context>>doPrimitive:method:receiver:args:"
+        ^contextOrPrimFailToken isArray
+          and: [contextOrPrimFailToken size = 2
+          and: [(contextOrPrimFailToken at: 1) == PrimitiveFailToken]]!
- isPrimFailToken: anObject
-        ^(self objectClass: anObject) isArray
-          and: [anObject size = 2
-          and: [(anObject at: 1) == PrimitiveFailToken]]!




Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-eem.1367.mcz

Eliot Miranda-2
Hi Christoph,

On Mar 2, 2021, at 5:17 AM, Thiede, Christoph <[hidden email]> wrote:



Hi Eliot,


thanks for the fix! Sorry for raising the same question again, but wouldn't it still be safer to dispense with the #isArray call here? It allows the simulated code to break out of the simulation by overriding #isArray anywhere.


As I understand it no.  The clue is in the variable name.  contextOrPrimFailToken can only ever be a Context or an Array, so the send of isArray serves only to quickly differentiate between a Context and an Array.  The message doesn’t get sent to any other kinds of object at that point so the concern that other classes may define isArray does not apply here.

I think I posted a proof of concept here: http://forum.world.st/The-Trunk-Kernel-eem-1366-mcz-tp5126558p5126713.html :-)


Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 2. Februar 2021 03:57:12
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: Kernel-eem.1367.mcz
 
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1367.mcz

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

Name: Kernel-eem.1367
Author: eem
Time: 1 February 2021, 6:57:09.713484 pm
UUID: def9aaa1-eb71-4da5-8f86-85856d9b88ad
Ancestors: Kernel-eem.1366

Fix mistake in the previous commit.  Thanks Levente!

=============== Diff against Kernel-eem.1366 ===============

Item was changed:
  ----- Method: Context>>isPrimFailToken: (in category 'private') -----
+ isPrimFailToken: contextOrPrimFailToken
+        "Answer if contextOrPrimFailToken, which will either be a Context object or
+         a primitive fail token (a tuple of the PrimitiveFailToken unique object and
+         a primitive failure code), is the latter. This should only be used with the
+         (possibly indirect) results of Context>>doPrimitive:method:receiver:args:"
+        ^contextOrPrimFailToken isArray
+          and: [contextOrPrimFailToken size = 2
+          and: [(contextOrPrimFailToken at: 1) == PrimitiveFailToken]]!
- isPrimFailToken: anObject
-        ^(self objectClass: anObject) isArray
-          and: [anObject size = 2
-          and: [(anObject at: 1) == PrimitiveFailToken]]!





Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-eem.1367.mcz

Christoph Thiede

Hi Eliot,


then I think there is an issue with the argument name. In #callPrimitive:, for example, it is named more specifically, maybePrimFailToken. In #doPrimitive:method:receiver:args:, we may feed it with the result of #tryPrimitive:withArgs: which can be anything, not only a context or fail token.


Here is a second example:


Object subclass: #ContextHack

instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'CT-Experiments'.
ContextHack class compile: 'isArray
self error: #hacked'.
ContextHack new class "through"


Best,
Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]>
Gesendet: Dienstag, 2. März 2021 16:27 Uhr
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Trunk: Kernel-eem.1367.mcz
 
Hi Christoph,

On Mar 2, 2021, at 5:17 AM, Thiede, Christoph <[hidden email]> wrote:



Hi Eliot,


thanks for the fix! Sorry for raising the same question again, but wouldn't it still be safer to dispense with the #isArray call here? It allows the simulated code to break out of the simulation by overriding #isArray anywhere.


As I understand it no.  The clue is in the variable name.  contextOrPrimFailToken can only ever be a Context or an Array, so the send of isArray serves only to quickly differentiate between a Context and an Array.  The message doesn’t get sent to any other kinds of object at that point so the concern that other classes may define isArray does not apply here.

I think I posted a proof of concept here: http://forum.world.st/The-Trunk-Kernel-eem-1366-mcz-tp5126558p5126713.html :-)


Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 2. Februar 2021 03:57:12
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: Kernel-eem.1367.mcz
 
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1367.mcz

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

Name: Kernel-eem.1367
Author: eem
Time: 1 February 2021, 6:57:09.713484 pm
UUID: def9aaa1-eb71-4da5-8f86-85856d9b88ad
Ancestors: Kernel-eem.1366

Fix mistake in the previous commit.  Thanks Levente!

=============== Diff against Kernel-eem.1366 ===============

Item was changed:
  ----- Method: Context>>isPrimFailToken: (in category 'private') -----
+ isPrimFailToken: contextOrPrimFailToken
+        "Answer if contextOrPrimFailToken, which will either be a Context object or
+         a primitive fail token (a tuple of the PrimitiveFailToken unique object and
+         a primitive failure code), is the latter. This should only be used with the
+         (possibly indirect) results of Context>>doPrimitive:method:receiver:args:"
+        ^contextOrPrimFailToken isArray
+          and: [contextOrPrimFailToken size = 2
+          and: [(contextOrPrimFailToken at: 1) == PrimitiveFailToken]]!
- isPrimFailToken: anObject
-        ^(self objectClass: anObject) isArray
-          and: [anObject size = 2
-          and: [(anObject at: 1) == PrimitiveFailToken]]!





Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-eem.1367.mcz

Eliot Miranda-2


On Mar 2, 2021, at 8:21 AM, Thiede, Christoph <[hidden email]> wrote:



Hi Eliot,


then I think there is an issue with the argument name. In #callPrimitive:, for example, it is named more specifically, maybePrimFailToken. In #doPrimitive:method:receiver:args:, we may feed it with the result of #tryPrimitive:withArgs: which can be anything, not only a context or fail token.


Here is a second example:


Object subclass: #ContextHack

instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'CT-Experiments'.
ContextHack class compile: 'isArray
self error: #hacked'.
ContextHack new class "through"

I still think that this is fuss over nothing.  Even if the system did keep running with a Context that answered true to isArray it would have to have a stack pointer of 2 and a first arg/temp that was the PrimFailToken.  You yourself complained of the performance of testing for the PrimFailToken.  isArray is faster than objectClass == Array. We haven’t seen any issues with this.  I suggest that if it ain’t broke we don’t fix it.


Best,
Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]>
Gesendet: Dienstag, 2. März 2021 16:27 Uhr
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Trunk: Kernel-eem.1367.mcz
 
Hi Christoph,

On Mar 2, 2021, at 5:17 AM, Thiede, Christoph <[hidden email]> wrote:



Hi Eliot,


thanks for the fix! Sorry for raising the same question again, but wouldn't it still be safer to dispense with the #isArray call here? It allows the simulated code to break out of the simulation by overriding #isArray anywhere.


As I understand it no.  The clue is in the variable name.  contextOrPrimFailToken can only ever be a Context or an Array, so the send of isArray serves only to quickly differentiate between a Context and an Array.  The message doesn’t get sent to any other kinds of object at that point so the concern that other classes may define isArray does not apply here.

I think I posted a proof of concept here: http://forum.world.st/The-Trunk-Kernel-eem-1366-mcz-tp5126558p5126713.html :-)


Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 2. Februar 2021 03:57:12
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: Kernel-eem.1367.mcz
 
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1367.mcz

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

Name: Kernel-eem.1367
Author: eem
Time: 1 February 2021, 6:57:09.713484 pm
UUID: def9aaa1-eb71-4da5-8f86-85856d9b88ad
Ancestors: Kernel-eem.1366

Fix mistake in the previous commit.  Thanks Levente!

=============== Diff against Kernel-eem.1366 ===============

Item was changed:
  ----- Method: Context>>isPrimFailToken: (in category 'private') -----
+ isPrimFailToken: contextOrPrimFailToken
+        "Answer if contextOrPrimFailToken, which will either be a Context object or
+         a primitive fail token (a tuple of the PrimitiveFailToken unique object and
+         a primitive failure code), is the latter. This should only be used with the
+         (possibly indirect) results of Context>>doPrimitive:method:receiver:args:"
+        ^contextOrPrimFailToken isArray
+          and: [contextOrPrimFailToken size = 2
+          and: [(contextOrPrimFailToken at: 1) == PrimitiveFailToken]]!
- isPrimFailToken: anObject
-        ^(self objectClass: anObject) isArray
-          and: [anObject size = 2
-          and: [(anObject at: 1) == PrimitiveFailToken]]!






Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-eem.1367.mcz

Christoph Thiede

Hi Eliot,


I have just found another bug that is caused by this change:

You cannot debug MirrorPrimitiveTest >> #testMirrorClass any longer - more in general, you cannot debug "ProtoObject new" any longer, because the return value of primitiveNew does not understand #isArray.

I think this is very clearly a bug? :-)


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]>
Gesendet: Dienstag, 2. März 2021 18:05:37
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Trunk: Kernel-eem.1367.mcz
 


On Mar 2, 2021, at 8:21 AM, Thiede, Christoph <[hidden email]> wrote:



Hi Eliot,


then I think there is an issue with the argument name. In #callPrimitive:, for example, it is named more specifically, maybePrimFailToken. In #doPrimitive:method:receiver:args:, we may feed it with the result of #tryPrimitive:withArgs: which can be anything, not only a context or fail token.


Here is a second example:


Object subclass: #ContextHack

instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'CT-Experiments'.
ContextHack class compile: 'isArray
self error: #hacked'.
ContextHack new class "through"

I still think that this is fuss over nothing.  Even if the system did keep running with a Context that answered true to isArray it would have to have a stack pointer of 2 and a first arg/temp that was the PrimFailToken.  You yourself complained of the performance of testing for the PrimFailToken.  isArray is faster than objectClass == Array. We haven’t seen any issues with this.  I suggest that if it ain’t broke we don’t fix it.


Best,
Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]>
Gesendet: Dienstag, 2. März 2021 16:27 Uhr
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Trunk: Kernel-eem.1367.mcz
 
Hi Christoph,

On Mar 2, 2021, at 5:17 AM, Thiede, Christoph <[hidden email]> wrote:



Hi Eliot,


thanks for the fix! Sorry for raising the same question again, but wouldn't it still be safer to dispense with the #isArray call here? It allows the simulated code to break out of the simulation by overriding #isArray anywhere.


As I understand it no.  The clue is in the variable name.  contextOrPrimFailToken can only ever be a Context or an Array, so the send of isArray serves only to quickly differentiate between a Context and an Array.  The message doesn’t get sent to any other kinds of object at that point so the concern that other classes may define isArray does not apply here.

I think I posted a proof of concept here: http://forum.world.st/The-Trunk-Kernel-eem-1366-mcz-tp5126558p5126713.html :-)


Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 2. Februar 2021 03:57:12
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: Kernel-eem.1367.mcz
 
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1367.mcz

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

Name: Kernel-eem.1367
Author: eem
Time: 1 February 2021, 6:57:09.713484 pm
UUID: def9aaa1-eb71-4da5-8f86-85856d9b88ad
Ancestors: Kernel-eem.1366

Fix mistake in the previous commit.  Thanks Levente!

=============== Diff against Kernel-eem.1366 ===============

Item was changed:
  ----- Method: Context>>isPrimFailToken: (in category 'private') -----
+ isPrimFailToken: contextOrPrimFailToken
+        "Answer if contextOrPrimFailToken, which will either be a Context object or
+         a primitive fail token (a tuple of the PrimitiveFailToken unique object and
+         a primitive failure code), is the latter. This should only be used with the
+         (possibly indirect) results of Context>>doPrimitive:method:receiver:args:"
+        ^contextOrPrimFailToken isArray
+          and: [contextOrPrimFailToken size = 2
+          and: [(contextOrPrimFailToken at: 1) == PrimitiveFailToken]]!
- isPrimFailToken: anObject
-        ^(self objectClass: anObject) isArray
-          and: [anObject size = 2
-          and: [(anObject at: 1) == PrimitiveFailToken]]!






Carpe Squeak!