[squeak-dev] The Trunk: Kernel-nice.1390.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Apr 19 17:30:13 UTC 2021


Great, thank both of you! :-)


Best,

Christoph

<http://www.hpi.de/>
________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Montag, 19. April 2021 18:38:08
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: Kernel-nice.1390.mcz

Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.1390.mcz

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

Name: Kernel-nice.1390
Author: nice
Time: 19 April 2021, 6:37:54.360183 pm
UUID: 3ba56195-f0d4-454c-b3f7-d07e1eadcad7
Ancestors: Kernel-nice.1389

Fixes regression in Context >> #runSimulated:contextAtEachStep: when the message is sent to something else than thisContext.

This happens when tallying sends (see MessageTally class >> #tallySendsTo:inBlock:showTree: )

This commit integrates the change poposed in:
https://source.squeak.org/treated/Kernel-ct.1363.diff
which was a commented version of:
https://source.squeak.org/treated/Kernel-ct.1362.diff

Thanks Christoph for the fix!

Also implement #asContextWithSender: in Context so that testRunSimulatedContextAtEachStep continues to work.

Thanks Jaromir for the suggestion.

=============== Diff against Kernel-nice.1389 ===============

Item was added:
+ ----- Method: Context>>asContextWithSender: (in category 'closure support') -----
+ asContextWithSender: aContext
+        self privSender: aContext.
+        ^ self!

Item was changed:
  ----- Method: Context>>runSimulated:contextAtEachStep: (in category 'system simulation') -----
  runSimulated: aBlock contextAtEachStep: anotherBlock
         "Simulate the execution of the argument, aBlock, until it ends or is curtailed. If any exception is signaled during the execution, simulate it being handled on the present caller stack. Evaluate anotherBlock with the current context prior to each instruction executed. Answer the simulated value of aBlock."

         | current resume ensure |
         resume := false.
+        "Affect the context stack of the receiver during the simulation of aBlock."
+        current := aBlock asContextWithSender: self.
+        "Insert outer context denoting the end of the simulation."
+        ensure := (ensure := current) insertSender: (Context contextEnsure:
+                [resume := true.
+                ensure privSender: thisContext home sender]).
-        current := aBlock asContext.
-        ensure := current insertSender: (Context contextEnsure: [resume := true]).
-        ensure sender ifNil: [ensure privSender: self]. "For backward compatibility, do not fail if aBlock is dead."

         (anotherBlock numArgs = 0
                 ifTrue: ["optimized" [resume]]
                 ifFalse: ["stop execution on time, don't expose simulation details to caller"
                         [current == ensure or:
                                 ["Context >> #resume:"
                                 current size >= 2 and:
                                         [(current at: 2) == ensure]]]   ])
                 whileFalse:
                         [anotherBlock cull: current.
                         current := current step].

+        "Continue with the execution in the previous context."
         ^ current jump!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210419/927e511c/attachment.html>


More information about the Squeak-dev mailing list