<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Great idea! As a side-effect, there will also be less noise when debugging some block invocation. :-)</p>
<p>Why did you choose numArgs = 2 for the fast lane, was this a random choice only, or did you do some measurements to find out which number of arguments is most commonly passed?</p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">
<div class="x__rp_U4 x_ms-font-weight-regular x_ms-font-color-neutralDark x_rpHighlightAllClass x_rpHighlightBodyClass" id="x_Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="x_divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="x_Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><br>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Best,</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Christoph</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Donnerstag, 29. Oktober 2020 03:13:04<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Trunk: Kernel-eem.1355.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Eliot Miranda uploaded a new version of Kernel to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Kernel-eem.1355.mcz">http://source.squeak.org/trunk/Kernel-eem.1355.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-eem.1355<br>
Author: eem<br>
Time: 28 October 2020, 6:16:21.972202 pm<br>
UUID: 14e40036-578b-4645-88e4-77be34a6d96b<br>
Ancestors: Kernel-eem.1354<br>
<br>
Speed-up cull:[cull:*] by supplying the primitive to handle teh case where the number of block arguments matches the number of arguments to cull:[cull:].<br>
Nuke the obsolete pre-closure simulation code for block closure activation.<br>
<br>
=============== Diff against Kernel-eem.1354 ===============<br>
<br>
Item was changed:<br>
  ----- Method: BlockClosure>>cull: (in category 'evaluating') -----<br>
  cull: firstArg<br>
         "Activate the receiver, with one or zero arguments."<br>
+        <primitive: 202> "Handle the one argument case primitively"<br>
-        <br>
         numArgs >= 1 ifTrue: [ ^self value: firstArg ].<br>
         ^self value!<br>
<br>
Item was changed:<br>
  ----- Method: BlockClosure>>cull:cull: (in category 'evaluating') -----<br>
  cull: firstArg cull: secondArg<br>
         "Activate the receiver, with two or less arguments."<br>
+        <primitive: 203> "Handle the two argument case primitively"<br>
-        <br>
         numArgs >= 2 ifTrue: [ ^self value: firstArg value: secondArg ].        <br>
         numArgs = 1 ifTrue: [ ^self value: firstArg ].<br>
         ^self value!<br>
<br>
Item was changed:<br>
  ----- Method: BlockClosure>>cull:cull:cull: (in category 'evaluating') -----<br>
  cull: firstArg cull: secondArg cull: thirdArg<br>
         "Activate the receiver, with three or less arguments."<br>
+        <primitive: 204> "Handle the two argument case primitively"<br>
-        <br>
         numArgs >= 2 ifTrue: [ <br>
                 numArgs >= 3 ifTrue: [ ^self value: firstArg value: secondArg value: thirdArg ].<br>
                 ^self value: firstArg value: secondArg ].<br>
         numArgs = 1 ifTrue: [ ^self value: firstArg ].<br>
         ^self value!<br>
<br>
Item was changed:<br>
  ----- Method: BlockClosure>>cull:cull:cull:cull: (in category 'evaluating') -----<br>
  cull: firstArg cull: secondArg cull: thirdArg cull: fourthArg<br>
         "Activate the receiver, with four or less arguments."<br>
+        <primitive: 205> "Handle the two argument case primitively"<br>
-        <br>
         numArgs >= 3 ifTrue: [<br>
                 numArgs >= 4 ifTrue: [<br>
                         ^self value: firstArg value: secondArg value: thirdArg value: fourthArg ].<br>
                 ^self value: firstArg value: secondArg value: thirdArg ].<br>
         numArgs = 2 ifTrue: [ ^self value: firstArg value: secondArg ]. <br>
         numArgs = 1 ifTrue: [ ^self value: firstArg ].<br>
         ^self value!<br>
<br>
Item was changed:<br>
  ----- Method: BlockClosure>>value (in category 'evaluating') -----<br>
  value<br>
         "Activate the receiver, creating a closure activation (Context)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the copied values to the activation as its copied<br>
          temps. Primitive. Essential."<br>
         <primitive: 201><br>
-        | newContext |<br>
         numArgs ~= 0 ifTrue:<br>
                 [self numArgsError: 0].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
Item was changed:<br>
  ----- Method: BlockClosure>>value: (in category 'evaluating') -----<br>
  value: firstArg<br>
         "Activate the receiver, creating a closure activation (Context)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the argument and copied values to the activation<br>
          as its argument and copied temps. Primitive. Essential."<br>
         <primitive: 202><br>
-        | newContext |<br>
         numArgs ~= 1 ifTrue:<br>
                 [self numArgsError: 1].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        newContext at: 1 put: firstArg.<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
Item was changed:<br>
  ----- Method: BlockClosure>>value:value: (in category 'evaluating') -----<br>
  value: firstArg value: secondArg<br>
         "Activate the receiver, creating a closure activation (Context)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the arguments and copied values to the activation<br>
          as its arguments and copied temps. Primitive. Essential."<br>
         <primitive: 203><br>
-        | newContext |<br>
         numArgs ~= 2 ifTrue:<br>
                 [self numArgsError: 2].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        newContext at: 1 put: firstArg.<br>
-                        newContext at: 2 put: secondArg.<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
Item was changed:<br>
  ----- Method: BlockClosure>>value:value:value: (in category 'evaluating') -----<br>
  value: firstArg value: secondArg value: thirdArg<br>
         "Activate the receiver, creating a closure activation (Context)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the arguments and copied values to the activation<br>
          as its arguments and copied temps. Primitive. Essential."<br>
         <primitive: 204><br>
-        | newContext |<br>
         numArgs ~= 3 ifTrue:<br>
                 [self numArgsError: 3].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        newContext at: 1 put: firstArg.<br>
-                        newContext at: 2 put: secondArg.<br>
-                        newContext at: 3 put: thirdArg.<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
Item was changed:<br>
  ----- Method: BlockClosure>>value:value:value:value: (in category 'evaluating') -----<br>
  value: firstArg value: secondArg value: thirdArg value: fourthArg<br>
         "Activate the receiver, creating a closure activation (Context)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the arguments and copied values to the activation<br>
          as its arguments and copied temps. Primitive. Essential."<br>
         <primitive: 205><br>
-        | newContext |<br>
         numArgs ~= 4 ifTrue:<br>
                 [self numArgsError: 4].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        newContext at: 1 put: firstArg.<br>
-                        newContext at: 2 put: secondArg.<br>
-                        newContext at: 3 put: thirdArg.<br>
-                        newContext at: 4 put: fourthArg.<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
Item was changed:<br>
  ----- Method: BlockClosure>>value:value:value:value:value: (in category 'evaluating') -----<br>
  value: firstArg value: secondArg value: thirdArg value: fourthArg value: fifthArg<br>
         "Activate the receiver, creating a closure activation (Context)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the arguments and copied values to the activation<br>
          as its arguments and copied temps. Primitive. Essential."<br>
         <primitive: 205><br>
-        | newContext |<br>
         numArgs ~= 5 ifTrue:<br>
                 [self numArgsError: 5].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        newContext at: 1 put: firstArg.<br>
-                        newContext at: 2 put: secondArg.<br>
-                        newContext at: 3 put: thirdArg.<br>
-                        newContext at: 4 put: fourthArg.<br>
-                        newContext at: 5 put: fifthArg.<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
Item was changed:<br>
  ----- Method: BlockClosure>>valueWithArguments: (in category 'evaluating') -----<br>
  valueWithArguments: anArray<br>
         "Activate the receiver, creating a closure activation (Context)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the arguments in an anArray and copied values to<br>
          the activation as its arguments and copied temps. Primitive. Essential."<br>
         <primitive: 206><br>
-        | newContext |<br>
         numArgs ~= anArray size ifTrue:<br>
                 [self numArgsError: anArray size].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        1 to: numArgs do:<br>
-                                [:i| newContext at: i put: (anArray at: i)].<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
Item was added:<br>
+ ----- Method: FullBlockClosure>>cull: (in category 'evaluating') -----<br>
+ cull: firstArg<br>
+        "Activate the receiver, with one or zero arguments."<br>
+        <primitive: 207> "Handle the one argument case primitively"<br>
+        numArgs >= 1 ifTrue: [ ^self value: firstArg ].<br>
+        ^self value!<br>
<br>
Item was added:<br>
+ ----- Method: FullBlockClosure>>cull:cull: (in category 'evaluating') -----<br>
+ cull: firstArg cull: secondArg<br>
+        "Activate the receiver, with two or less arguments."<br>
+        <primitive: 207> "Handle the two argument case primitively"<br>
+        numArgs >= 2 ifTrue: [ ^self value: firstArg value: secondArg ].        <br>
+        numArgs = 1 ifTrue: [ ^self value: firstArg ].<br>
+        ^self value!<br>
<br>
Item was added:<br>
+ ----- Method: FullBlockClosure>>cull:cull:cull: (in category 'evaluating') -----<br>
+ cull: firstArg cull: secondArg cull: thirdArg<br>
+        "Activate the receiver, with three or less arguments."<br>
+        <primitive: 207> "Handle the three argument case primitively"<br>
+        numArgs >= 2 ifTrue:<br>
+                [numArgs >= 3 ifTrue:<br>
+                        [^self value: firstArg value: secondArg value: thirdArg].<br>
+                ^self value: firstArg value: secondArg].<br>
+        numArgs = 1 ifTrue:<br>
+                [^self value: firstArg].<br>
+        ^self value!<br>
<br>
Item was added:<br>
+ ----- Method: FullBlockClosure>>cull:cull:cull:cull: (in category 'evaluating') -----<br>
+ cull: firstArg cull: secondArg cull: thirdArg cull: fourthArg<br>
+        "Activate the receiver, with four or less arguments."<br>
+        <primitive: 207> "Handle the four argument case primitively"<br>
+        numArgs >= 3 ifTrue:<br>
+                [numArgs >= 4 ifTrue:<br>
+                        [^self value: firstArg value: secondArg value: thirdArg value: fourthArg].<br>
+                ^self value: firstArg value: secondArg value: thirdArg].<br>
+        numArgs = 2 ifTrue:<br>
+                [^self value: firstArg value: secondArg].<br>
+        numArgs = 1 ifTrue:<br>
+                [^self value: firstArg].<br>
+        ^self value!<br>
<br>
Item was changed:<br>
  ----- Method: FullBlockClosure>>value (in category 'evaluating') -----<br>
  value<br>
         "Activate the receiver, creating a closure activation (MethodContext)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the copied values to the activation as its copied<br>
          temps. Primitive. Essential."<br>
         <primitive: 207><br>
-        | newContext |<br>
         numArgs ~= 0 ifTrue:<br>
                 [self numArgsError: 0].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
Item was changed:<br>
  ----- Method: FullBlockClosure>>value: (in category 'evaluating') -----<br>
  value: firstArg<br>
         "Activate the receiver, creating a closure activation (MethodContext)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the argument and copied values to the activation<br>
          as its argument and copied temps. Primitive. Essential."<br>
         <primitive: 207><br>
-        | newContext |<br>
         numArgs ~= 1 ifTrue:<br>
                 [self numArgsError: 1].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        newContext at: 1 put: firstArg.<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
Item was changed:<br>
  ----- Method: FullBlockClosure>>value:value: (in category 'evaluating') -----<br>
  value: firstArg value: secondArg<br>
         "Activate the receiver, creating a closure activation (MethodContext)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the arguments and copied values to the activation<br>
          as its arguments and copied temps. Primitive. Essential."<br>
         <primitive: 207><br>
-        | newContext |<br>
         numArgs ~= 2 ifTrue:<br>
                 [self numArgsError: 2].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        newContext at: 1 put: firstArg.<br>
-                        newContext at: 2 put: secondArg.<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
Item was changed:<br>
  ----- Method: FullBlockClosure>>value:value:value: (in category 'evaluating') -----<br>
  value: firstArg value: secondArg value: thirdArg<br>
         "Activate the receiver, creating a closure activation (MethodContext)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the arguments and copied values to the activation<br>
          as its arguments and copied temps. Primitive. Essential."<br>
         <primitive: 207><br>
-        | newContext |<br>
         numArgs ~= 3 ifTrue:<br>
                 [self numArgsError: 3].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        newContext at: 1 put: firstArg.<br>
-                        newContext at: 2 put: secondArg.<br>
-                        newContext at: 3 put: thirdArg.<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
Item was changed:<br>
  ----- Method: FullBlockClosure>>value:value:value:value: (in category 'evaluating') -----<br>
  value: firstArg value: secondArg value: thirdArg value: fourthArg<br>
         "Activate the receiver, creating a closure activation (MethodContext)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the arguments and copied values to the activation<br>
          as its arguments and copied temps. Primitive. Essential."<br>
         <primitive: 207><br>
-        | newContext |<br>
         numArgs ~= 4 ifTrue:<br>
                 [self numArgsError: 4].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        newContext at: 1 put: firstArg.<br>
-                        newContext at: 2 put: secondArg.<br>
-                        newContext at: 3 put: thirdArg.<br>
-                        newContext at: 4 put: fourthArg.<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
Item was changed:<br>
  ----- Method: FullBlockClosure>>value:value:value:value:value: (in category 'evaluating') -----<br>
  value: firstArg value: secondArg value: thirdArg value: fourthArg value: fifthArg<br>
         "Activate the receiver, creating a closure activation (MethodContext)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the arguments and copied values to the activation<br>
          as its arguments and copied temps. Primitive. Essential."<br>
         <primitive: 207><br>
-        | newContext |<br>
         numArgs ~= 5 ifTrue:<br>
                 [self numArgsError: 5].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        newContext at: 1 put: firstArg.<br>
-                        newContext at: 2 put: secondArg.<br>
-                        newContext at: 3 put: thirdArg.<br>
-                        newContext at: 4 put: fourthArg.<br>
-                        newContext at: 5 put: fifthArg.<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
Item was changed:<br>
  ----- Method: FullBlockClosure>>valueWithArguments: (in category 'evaluating') -----<br>
  valueWithArguments: anArray<br>
         "Activate the receiver, creating a closure activation (MethodContext)<br>
          whose closure is the receiver and whose caller is the sender of this<br>
          message. Supply the arguments in an anArray and copied values to<br>
          the activation as its arguments and copied temps. Primitive. Essential."<br>
         <primitive: 208><br>
-        | newContext |<br>
         numArgs ~= anArray size ifTrue:<br>
                 [self numArgsError: anArray size].<br>
+        ^self primitiveFailed!<br>
-        false<br>
-                ifTrue: "Old code to simulate the closure value primitive on VMs that lack it."<br>
-                        [newContext := self asContextWithSender: thisContext sender.<br>
-                        1 to: numArgs do:<br>
-                                [:i| newContext at: i put: (anArray at: i)].<br>
-                        thisContext privSender: newContext]<br>
-                ifFalse: [self primitiveFailed]!<br>
<br>
<br>
</div>
</span></font>
</body>
</html>