|
@@ -105,20 +105,18 @@ selector: "aliasTemporally:",
|
|
|
protocol: "visiting",
|
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
args: ["aCollection"],
|
|
|
-source: "aliasTemporally: aCollection\x0a\x09\x22https://lolg.it/amber/amber/issues/296\x0a\x09\x0a\x09If a node is aliased, all preceding ones are aliased as well.\x0a\x09The tree is iterated twice. First we get the aliasing dependency,\x0a\x09then the aliasing itself is done\x22\x0a\x0a\x09| threshold shouldAlias |\x0a\x09threshold := aCollection reversed\x0a\x09\x09detect: [ :each | each subtreeNeedsAliasing ]\x0a\x09\x09ifNone: [ ^ self visitAll: aCollection ].\x0a\x0a\x09shouldAlias := true.\x0a\x09^ aCollection collect: [ :each |\x0a\x09\x09shouldAlias\x0a\x09\x09\x09ifTrue: [ each == threshold ifTrue: [ shouldAlias := false ]. self alias: each ]\x0a\x09\x09\x09ifFalse: [ self visit: each ] ]",
|
|
|
+source: "aliasTemporally: aCollection\x0a\x09\x22https://lolg.it/amber/amber/issues/296\x0a\x09\x0a\x09If a node is aliased, all preceding ones are aliased as well.\x0a\x09The tree is iterated twice. First we get the aliasing dependency,\x0a\x09then the aliasing itself is done\x22\x0a\x0a\x09| threshold shouldAlias |\x0a\x09threshold := aCollection reversed\x0a\x09\x09detect: [ :each | each subtreeNeedsAliasing ] ifNone: [ nil ].\x0a\x09threshold ifNil: [ ^ self visitAll: aCollection ].\x0a\x0a\x09shouldAlias := true.\x0a\x09^ aCollection collect: [ :each |\x0a\x09\x09shouldAlias\x0a\x09\x09\x09ifTrue: [ each == threshold ifTrue: [ shouldAlias := false ]. self alias: each ]\x0a\x09\x09\x09ifFalse: [ self visit: each ] ]",
|
|
|
referencedClasses: [],
|
|
|
//>>excludeEnd("ide");
|
|
|
pragmas: [],
|
|
|
-messageSends: ["detect:ifNone:", "reversed", "subtreeNeedsAliasing", "visitAll:", "collect:", "ifTrue:ifFalse:", "ifTrue:", "==", "alias:", "visit:"]
|
|
|
+messageSends: ["detect:ifNone:", "reversed", "subtreeNeedsAliasing", "ifNil:", "visitAll:", "collect:", "ifTrue:ifFalse:", "ifTrue:", "==", "alias:", "visit:"]
|
|
|
}, function ($methodClass){ return function (aCollection){
|
|
|
var self=this,$self=this;
|
|
|
var threshold,shouldAlias;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-var $1,$2;
|
|
|
-var $early={};
|
|
|
-try {
|
|
|
+var $1,$2,$3,$receiver;
|
|
|
threshold=$recv($recv(aCollection)._reversed())._detect_ifNone_((function(each){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx2) {
|
|
@@ -128,23 +126,24 @@ return $recv(each)._subtreeNeedsAliasing();
|
|
|
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
}),(function(){
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-return $core.withContext(function($ctx2) {
|
|
|
-//>>excludeEnd("ctx");
|
|
|
-throw $early=[$self._visitAll_(aCollection)];
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
|
|
|
-//>>excludeEnd("ctx");
|
|
|
+return nil;
|
|
|
+
|
|
|
}));
|
|
|
+$1=threshold;
|
|
|
+if(($receiver = $1) == null || $receiver.a$nil){
|
|
|
+return $self._visitAll_(aCollection);
|
|
|
+} else {
|
|
|
+$1;
|
|
|
+}
|
|
|
shouldAlias=true;
|
|
|
return $recv(aCollection)._collect_((function(each){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
-$1=shouldAlias;
|
|
|
-if($core.assert($1)){
|
|
|
-$2=$recv(each).__eq_eq(threshold);
|
|
|
+$2=shouldAlias;
|
|
|
if($core.assert($2)){
|
|
|
+$3=$recv(each).__eq_eq(threshold);
|
|
|
+if($core.assert($3)){
|
|
|
shouldAlias=false;
|
|
|
shouldAlias;
|
|
|
}
|
|
@@ -153,11 +152,9 @@ return $self._alias_(each);
|
|
|
return $self._visit_(each);
|
|
|
}
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
}));
|
|
|
-}
|
|
|
-catch(e) {if(e===$early)return e[0]; throw e}
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"aliasTemporally:",{aCollection:aCollection,threshold:threshold,shouldAlias:shouldAlias})});
|
|
|
//>>excludeEnd("ctx");
|
|
@@ -5905,7 +5902,7 @@ selector: "asReceiver",
|
|
|
protocol: "*Compiler-IR",
|
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
args: [],
|
|
|
-source: "asReceiver\x0a\x09self class receiverNames\x0a\x09\x09at: self name\x0a\x09\x09ifPresent: [ :newName | ^ self copy name: newName; yourself ]\x0a\x09\x09ifAbsent: [ ^ self ]",
|
|
|
+source: "asReceiver\x0a\x09^ self class receiverNames\x0a\x09\x09at: self name\x0a\x09\x09ifPresent: [ :newName | self copy name: newName; yourself ]\x0a\x09\x09ifAbsent: [ self ]",
|
|
|
referencedClasses: [],
|
|
|
//>>excludeEnd("ide");
|
|
|
pragmas: [],
|
|
@@ -5916,25 +5913,20 @@ var self=this,$self=this;
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
var $1;
|
|
|
-var $early={};
|
|
|
-try {
|
|
|
-$recv($recv($self._class())._receiverNames())._at_ifPresent_ifAbsent_($self._name(),(function(newName){
|
|
|
+return $recv($recv($self._class())._receiverNames())._at_ifPresent_ifAbsent_($self._name(),(function(newName){
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
//>>excludeEnd("ctx");
|
|
|
$1=$self._copy();
|
|
|
$recv($1)._name_(newName);
|
|
|
-throw $early=[$recv($1)._yourself()];
|
|
|
+return $recv($1)._yourself();
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({newName:newName},$ctx1,1)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
}),(function(){
|
|
|
-throw $early=[self];
|
|
|
+return self;
|
|
|
|
|
|
}));
|
|
|
-return self;
|
|
|
-}
|
|
|
-catch(e) {if(e===$early)return e[0]; throw e}
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
}, function($ctx1) {$ctx1.fill(self,"asReceiver",{})});
|
|
|
//>>excludeEnd("ctx");
|