[squeak-dev] The Trunk: Kernel-ct.1439.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Wed Dec 29 06:17:09 UTC 2021


Hi Christoph --

Please treat this as an example of why the Inbox exists. Thank you for having it reverted so quickly.

Best,
Marcel
Am 29.12.2021 03:21:34 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:
Hi Eliot,

I'm dreadfully sorry, I have completely misjudged the role of this protocol - I have mistaken them for some kind of convenience protocol to avoid message dispatching, and because the patch did not affect existing code and was covered by tests that worked for me on multiple platforms, I wrongly assumed that it would be a harmless change, so I did not want to place the burden on anyone else to merge it. I now understand that this was a bad idea and have reverted both Kernel-ct.1439 and Tests-ct.470. I am sorry to miss your expectations and will double-check whenever I skip the inbox for any future patches to critical domains. It is hard for me to estimate the need for review correctly; I will be more cautious now.

> the failure code for objectIsReadOnly: is non sense

Does this critique apply to Object >> #isReadOnlyObject as well? I wonder how a getter primitive can fail (except for older VMs that do not support write barriers).

Best,
Christoph
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Eliot Miranda <eliot.miranda at gmail.com>
Gesendet: Mittwoch, 29. Dezember 2021 02:32:27
An: The general-purpose Squeak developers list
Cc: packages at lists.squeakfoundation.org
Betreff: Re: [squeak-dev] The Trunk: Kernel-ct.1439.mcz
 
you need to revert this and start putting such extensions in your own  package.  This code is a) wrong (the failure code for objectIsReadOnly: is non sense), and b) unnecessary for Kernel. If you want to program at the interface between the system and the VM you *must* understand the VM architecture.  This code *will not work* without VM modifications.  This code displays a misunderstanding of, for example, the read-only bit. 

On Tue, Dec 28, 2021 at 4:47 PM <commits at source.squeak.org [mailto:commits at source.squeak.org]> wrote:

Christoph Thiede uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ct.1439.mcz [http://source.squeak.org/trunk/Kernel-ct.1439.mcz]

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

Name: Kernel-ct.1439
Author: ct
Time: 29 December 2021, 1:47:06.285067 am
UUID: f55ab880-48e4-7946-b734-58afc7d03b57
Ancestors: Kernel-ct.1438, Kernel-ct.1404

Adds mirror primitives for primitiveGetImmutability (primitive 163/#isReadOnlyObject), primitiveSetImmutability (primitive 164/#setIsReadOnlyObject:), and primitiveClone (primitive 148/#shallowCopy).

=============== Diff against Kernel-ct.1438 ===============

Item was added:
+ ----- Method: Context>>object:setIsReadOnly: (in category 'mirror primitives') -----
+ object: anObject setIsReadOnly: aBoolean
+       "Set the read-only flag of the argument anObject to the given value aBoolean and answer the previous value of the flag, without sending a message to anObject. This mimics the action of the VM when an object is set as read-only or writeable. See Object >> #setIsReadOnlyObject:."
+
+       <primitive: 164 error: ec>
+       self primitiveFailed!

Item was added:
+ ----- Method: Context>>objectClone: (in category 'mirror primitives') -----
+ objectClone: anObject
+       "Answer a copy the argument anObject which share's the original's instance variables, without sending it a message. This mimics the action of the VM when it clones an object.
+        Used to simulate the execution machinery by, for example, the debugger.
+        Primitive.  See Object documentation whatIsAPrimitive."
+
+       <primitive: 148>
+       self primitiveFailed!

Item was added:
+ ----- Method: Context>>objectIsReadOnly: (in category 'mirror primitives') -----
+ objectIsReadOnly: anObject
+       "Answer if the argument is read-only without sending it a message. This mimics the action of the VM when an object is tested for writeability. See Object >> #isReadOnlyObject."
+
+       <primitive: 163 error: ec>
+       ^ (self objectClass: anObject) isImmediateClass!





--

_,,,^..^,,,_

best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211229/6e248297/attachment.html>


More information about the Squeak-dev mailing list