|
@@ -12,7 +12,7 @@ $globals.IRInlinedAssignment.comment="I represent an inlined assignment instruct
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "accept:",
|
|
|
+selector: "acceptDagVisitor:",
|
|
|
protocol: 'visiting',
|
|
|
fn: function (aVisitor){
|
|
|
var self=this;
|
|
@@ -21,12 +21,12 @@ return $core.withContext(function($ctx1) {
|
|
|
|
|
|
return $recv(aVisitor)._visitIRInlinedAssignment_(self);
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedAssignment)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedAssignment)});
|
|
|
|
|
|
},
|
|
|
|
|
|
args: ["aVisitor"],
|
|
|
-source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedAssignment: self",
|
|
|
+source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitIRInlinedAssignment: self",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
messageSends: ["visitIRInlinedAssignment:"]
|
|
@@ -59,7 +59,7 @@ $globals.IRInlinedClosure.comment="I represent an inlined closure instruction.";
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "accept:",
|
|
|
+selector: "acceptDagVisitor:",
|
|
|
protocol: 'visiting',
|
|
|
fn: function (aVisitor){
|
|
|
var self=this;
|
|
@@ -69,12 +69,12 @@ return $core.withContext(function($ctx1) {
|
|
|
$recv(aVisitor)._visitIRInlinedClosure_(self);
|
|
|
return self;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedClosure)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedClosure)});
|
|
|
|
|
|
},
|
|
|
|
|
|
args: ["aVisitor"],
|
|
|
-source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedClosure: self",
|
|
|
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitIRInlinedClosure: self",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
messageSends: ["visitIRInlinedClosure:"]
|
|
@@ -107,7 +107,7 @@ $globals.IRInlinedReturn.comment="I represent an inlined local return instructio
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "accept:",
|
|
|
+selector: "acceptDagVisitor:",
|
|
|
protocol: 'visiting',
|
|
|
fn: function (aVisitor){
|
|
|
var self=this;
|
|
@@ -116,12 +116,12 @@ return $core.withContext(function($ctx1) {
|
|
|
|
|
|
return $recv(aVisitor)._visitIRInlinedReturn_(self);
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedReturn)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedReturn)});
|
|
|
|
|
|
},
|
|
|
|
|
|
args: ["aVisitor"],
|
|
|
-source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedReturn: self",
|
|
|
+source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitIRInlinedReturn: self",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
messageSends: ["visitIRInlinedReturn:"]
|
|
@@ -154,7 +154,7 @@ $globals.IRInlinedSend.comment="I am the abstract super class of inlined message
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "accept:",
|
|
|
+selector: "acceptDagVisitor:",
|
|
|
protocol: 'visiting',
|
|
|
fn: function (aVisitor){
|
|
|
var self=this;
|
|
@@ -164,12 +164,12 @@ return $core.withContext(function($ctx1) {
|
|
|
$recv(aVisitor)._visitInlinedSend_(self);
|
|
|
return self;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedSend)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedSend)});
|
|
|
|
|
|
},
|
|
|
|
|
|
args: ["aVisitor"],
|
|
|
-source: "accept: aVisitor\x0a\x09aVisitor visitInlinedSend: self",
|
|
|
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitInlinedSend: self",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
messageSends: ["visitInlinedSend:"]
|
|
@@ -220,7 +220,7 @@ $globals.IRInlinedIfFalse.comment="I represent an inlined `#ifFalse:` message se
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "accept:",
|
|
|
+selector: "acceptDagVisitor:",
|
|
|
protocol: 'visiting',
|
|
|
fn: function (aVisitor){
|
|
|
var self=this;
|
|
@@ -230,12 +230,12 @@ return $core.withContext(function($ctx1) {
|
|
|
$recv(aVisitor)._visitIRInlinedIfFalse_(self);
|
|
|
return self;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedIfFalse)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedIfFalse)});
|
|
|
|
|
|
},
|
|
|
|
|
|
args: ["aVisitor"],
|
|
|
-source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfFalse: self",
|
|
|
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitIRInlinedIfFalse: self",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
messageSends: ["visitIRInlinedIfFalse:"]
|
|
@@ -250,7 +250,7 @@ $globals.IRInlinedIfNilIfNotNil.comment="I represent an inlined `#ifNil:ifNotNil
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "accept:",
|
|
|
+selector: "acceptDagVisitor:",
|
|
|
protocol: 'visiting',
|
|
|
fn: function (aVisitor){
|
|
|
var self=this;
|
|
@@ -260,12 +260,12 @@ return $core.withContext(function($ctx1) {
|
|
|
$recv(aVisitor)._visitIRInlinedIfNilIfNotNil_(self);
|
|
|
return self;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedIfNilIfNotNil)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedIfNilIfNotNil)});
|
|
|
|
|
|
},
|
|
|
|
|
|
args: ["aVisitor"],
|
|
|
-source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfNilIfNotNil: self",
|
|
|
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitIRInlinedIfNilIfNotNil: self",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
messageSends: ["visitIRInlinedIfNilIfNotNil:"]
|
|
@@ -350,7 +350,7 @@ $globals.IRInlinedIfTrue.comment="I represent an inlined `#ifTrue:` message send
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "accept:",
|
|
|
+selector: "acceptDagVisitor:",
|
|
|
protocol: 'visiting',
|
|
|
fn: function (aVisitor){
|
|
|
var self=this;
|
|
@@ -360,12 +360,12 @@ return $core.withContext(function($ctx1) {
|
|
|
$recv(aVisitor)._visitIRInlinedIfTrue_(self);
|
|
|
return self;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedIfTrue)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedIfTrue)});
|
|
|
|
|
|
},
|
|
|
|
|
|
args: ["aVisitor"],
|
|
|
-source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrue: self",
|
|
|
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrue: self",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
messageSends: ["visitIRInlinedIfTrue:"]
|
|
@@ -380,7 +380,7 @@ $globals.IRInlinedIfTrueIfFalse.comment="I represent an inlined `#ifTrue:ifFalse
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "accept:",
|
|
|
+selector: "acceptDagVisitor:",
|
|
|
protocol: 'visiting',
|
|
|
fn: function (aVisitor){
|
|
|
var self=this;
|
|
@@ -390,12 +390,12 @@ return $core.withContext(function($ctx1) {
|
|
|
$recv(aVisitor)._visitIRInlinedIfTrueIfFalse_(self);
|
|
|
return self;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedIfTrueIfFalse)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedIfTrueIfFalse)});
|
|
|
|
|
|
},
|
|
|
|
|
|
args: ["aVisitor"],
|
|
|
-source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrueIfFalse: self",
|
|
|
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrueIfFalse: self",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
messageSends: ["visitIRInlinedIfTrueIfFalse:"]
|
|
@@ -410,7 +410,7 @@ $globals.IRInlinedSequence.comment="I represent a (block) sequence inside an inl
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "accept:",
|
|
|
+selector: "acceptDagVisitor:",
|
|
|
protocol: 'visiting',
|
|
|
fn: function (aVisitor){
|
|
|
var self=this;
|
|
@@ -420,12 +420,12 @@ return $core.withContext(function($ctx1) {
|
|
|
$recv(aVisitor)._visitIRInlinedSequence_(self);
|
|
|
return self;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedSequence)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedSequence)});
|
|
|
|
|
|
},
|
|
|
|
|
|
args: ["aVisitor"],
|
|
|
-source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedSequence: self",
|
|
|
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitIRInlinedSequence: self",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
messageSends: ["visitIRInlinedSequence:"]
|
|
@@ -694,7 +694,7 @@ $6=$recv($globals.IRReturn)._new();
|
|
|
$recv($6)._scope_($recv(anIRNonLocalReturn)._scope());
|
|
|
localReturn=$recv($6)._yourself();
|
|
|
localReturn;
|
|
|
-$recv($recv(anIRNonLocalReturn)._instructions())._do_((function(each){
|
|
|
+$recv($recv(anIRNonLocalReturn)._dagChildren())._do_((function(each){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
@@ -721,10 +721,10 @@ return $7;
|
|
|
},
|
|
|
|
|
|
args: ["anIRNonLocalReturn"],
|
|
|
-source: "transformNonLocalReturn: anIRNonLocalReturn\x0a\x09\x22Replace a non local return into a local return\x22\x0a\x0a\x09| localReturn |\x0a\x09anIRNonLocalReturn scope canInlineNonLocalReturns ifTrue: [\x0a\x09\x09anIRNonLocalReturn scope methodScope removeNonLocalReturn: anIRNonLocalReturn scope.\x0a\x09\x09localReturn := IRReturn new\x0a\x09\x09\x09scope: anIRNonLocalReturn scope;\x0a\x09\x09\x09yourself.\x0a\x09\x09anIRNonLocalReturn instructions do: [ :each |\x0a\x09\x09\x09localReturn add: each ].\x0a\x09\x09anIRNonLocalReturn replaceWith: localReturn.\x0a\x09\x09^ localReturn ].\x0a\x09^ super visitIRNonLocalReturn: anIRNonLocalReturn",
|
|
|
+source: "transformNonLocalReturn: anIRNonLocalReturn\x0a\x09\x22Replace a non local return into a local return\x22\x0a\x0a\x09| localReturn |\x0a\x09anIRNonLocalReturn scope canInlineNonLocalReturns ifTrue: [\x0a\x09\x09anIRNonLocalReturn scope methodScope removeNonLocalReturn: anIRNonLocalReturn scope.\x0a\x09\x09localReturn := IRReturn new\x0a\x09\x09\x09scope: anIRNonLocalReturn scope;\x0a\x09\x09\x09yourself.\x0a\x09\x09anIRNonLocalReturn dagChildren do: [ :each |\x0a\x09\x09\x09localReturn add: each ].\x0a\x09\x09anIRNonLocalReturn replaceWith: localReturn.\x0a\x09\x09^ localReturn ].\x0a\x09^ super visitIRNonLocalReturn: anIRNonLocalReturn",
|
|
|
referencedClasses: ["IRReturn"],
|
|
|
|
|
|
-messageSends: ["ifTrue:", "canInlineNonLocalReturns", "scope", "removeNonLocalReturn:", "methodScope", "scope:", "new", "yourself", "do:", "instructions", "add:", "replaceWith:", "visitIRNonLocalReturn:"]
|
|
|
+messageSends: ["ifTrue:", "canInlineNonLocalReturns", "scope", "removeNonLocalReturn:", "methodScope", "scope:", "new", "yourself", "do:", "dagChildren", "add:", "replaceWith:", "visitIRNonLocalReturn:"]
|
|
|
}),
|
|
|
$globals.IRInliner);
|
|
|
|
|
@@ -907,15 +907,7 @@ return $recv($recv(each)._name())._asVariableName();
|
|
|
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
|
|
|
|
|
|
})));
|
|
|
-$recv($recv(anIRInlinedClosure)._instructions())._do_((function(each){
|
|
|
-
|
|
|
-return $core.withContext(function($ctx2) {
|
|
|
-
|
|
|
-return self._visit_(each);
|
|
|
-
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
|
|
|
-
|
|
|
-}));
|
|
|
+self._visitAll_($recv(anIRInlinedClosure)._dagChildren());
|
|
|
return self;
|
|
|
|
|
|
}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:",{anIRInlinedClosure:anIRInlinedClosure},$globals.IRInliningJSTranslator)});
|
|
@@ -923,10 +915,10 @@ return self;
|
|
|
},
|
|
|
|
|
|
args: ["anIRInlinedClosure"],
|
|
|
-source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09self stream nextPutVars: (anIRInlinedClosure tempDeclarations collect: [ :each |\x0a\x09\x09each name asVariableName ]).\x0a\x09anIRInlinedClosure instructions do: [ :each |\x0a\x09\x09self visit: each ]",
|
|
|
+source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09self stream nextPutVars: (anIRInlinedClosure tempDeclarations collect: [ :each |\x0a\x09\x09each name asVariableName ]).\x0a\x09self visitAll: anIRInlinedClosure dagChildren",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["nextPutVars:", "stream", "collect:", "tempDeclarations", "asVariableName", "name", "do:", "instructions", "visit:"]
|
|
|
+messageSends: ["nextPutVars:", "stream", "collect:", "tempDeclarations", "asVariableName", "name", "visitAll:", "dagChildren"]
|
|
|
}),
|
|
|
$globals.IRInliningJSTranslator);
|
|
|
|
|
@@ -956,9 +948,9 @@ $recv($2)._nextPutAll_("!$core.assert(");
|
|
|
|
|
|
$ctx2.sendIdx["nextPutAll:"]=1;
|
|
|
|
|
|
-$4=$recv(anIRInlinedIfFalse)._instructions();
|
|
|
+$4=$recv(anIRInlinedIfFalse)._dagChildren();
|
|
|
|
|
|
-$ctx2.sendIdx["instructions"]=1;
|
|
|
+$ctx2.sendIdx["dagChildren"]=1;
|
|
|
|
|
|
$3=$recv($4)._first();
|
|
|
self._visit_($3);
|
|
@@ -973,7 +965,7 @@ return $recv(self._stream())._nextPutAll_(")");
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
|
-return self._visit_($recv($recv(anIRInlinedIfFalse)._instructions())._last());
|
|
|
+return self._visit_($recv($recv(anIRInlinedIfFalse)._dagChildren())._last());
|
|
|
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
|
|
|
|
|
@@ -985,10 +977,10 @@ return self;
|
|
|
},
|
|
|
|
|
|
args: ["anIRInlinedIfFalse"],
|
|
|
-source: "visitIRInlinedIfFalse: anIRInlinedIfFalse\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '!$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfFalse instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfFalse instructions last ]",
|
|
|
+source: "visitIRInlinedIfFalse: anIRInlinedIfFalse\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '!$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfFalse dagChildren first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfFalse dagChildren last ]",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["nextPutIf:then:", "stream", "nextPutAll:", "visit:", "first", "instructions", "last"]
|
|
|
+messageSends: ["nextPutIf:then:", "stream", "nextPutAll:", "visit:", "first", "dagChildren", "last"]
|
|
|
}),
|
|
|
$globals.IRInliningJSTranslator);
|
|
|
|
|
@@ -1029,9 +1021,9 @@ $recv($2)._nextPutAll_($3);
|
|
|
|
|
|
$ctx2.sendIdx["nextPutAll:"]=1;
|
|
|
|
|
|
-$6=$recv(anIRInlinedIfNilIfNotNil)._instructions();
|
|
|
+$6=$recv(anIRInlinedIfNilIfNotNil)._dagChildren();
|
|
|
|
|
|
-$ctx2.sendIdx["instructions"]=1;
|
|
|
+$ctx2.sendIdx["dagChildren"]=1;
|
|
|
|
|
|
$5=$recv($6)._first();
|
|
|
self._visit_($5);
|
|
@@ -1051,9 +1043,9 @@ return $recv($7)._nextPutAll_($8);
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
|
-$10=$recv(anIRInlinedIfNilIfNotNil)._instructions();
|
|
|
+$10=$recv(anIRInlinedIfNilIfNotNil)._dagChildren();
|
|
|
|
|
|
-$ctx2.sendIdx["instructions"]=2;
|
|
|
+$ctx2.sendIdx["dagChildren"]=2;
|
|
|
|
|
|
$9=$recv($10)._second();
|
|
|
return self._visit_($9);
|
|
@@ -1067,7 +1059,7 @@ $ctx2.sendIdx["visit:"]=2;
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
|
-return self._visit_($recv($recv(anIRInlinedIfNilIfNotNil)._instructions())._third());
|
|
|
+return self._visit_($recv($recv(anIRInlinedIfNilIfNotNil)._dagChildren())._third());
|
|
|
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
|
|
|
|
|
@@ -1079,10 +1071,10 @@ return self;
|
|
|
},
|
|
|
|
|
|
args: ["anIRInlinedIfNilIfNotNil"],
|
|
|
-source: "visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil\x0a\x09self stream\x0a\x09\x09nextPutIf: [\x0a\x09\x09\x09| recvVarName |\x0a\x09\x09\x09recvVarName := anIRInlinedIfNilIfNotNil receiverInternalVariableName.\x0a\x09\x09\x09self stream nextPutAll: '(', recvVarName, ' = '.\x0a\x09\x09\x09self visit: anIRInlinedIfNilIfNotNil instructions first.\x0a\x09\x09\x09self stream nextPutAll: ') == null || ', recvVarName, '.isNil' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfNilIfNotNil instructions second ]\x0a\x09\x09else: [ self visit: anIRInlinedIfNilIfNotNil instructions third ]",
|
|
|
+source: "visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil\x0a\x09self stream\x0a\x09\x09nextPutIf: [\x0a\x09\x09\x09| recvVarName |\x0a\x09\x09\x09recvVarName := anIRInlinedIfNilIfNotNil receiverInternalVariableName.\x0a\x09\x09\x09self stream nextPutAll: '(', recvVarName, ' = '.\x0a\x09\x09\x09self visit: anIRInlinedIfNilIfNotNil dagChildren first.\x0a\x09\x09\x09self stream nextPutAll: ') == null || ', recvVarName, '.isNil' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfNilIfNotNil dagChildren second ]\x0a\x09\x09else: [ self visit: anIRInlinedIfNilIfNotNil dagChildren third ]",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["nextPutIf:then:else:", "stream", "receiverInternalVariableName", "nextPutAll:", ",", "visit:", "first", "instructions", "second", "third"]
|
|
|
+messageSends: ["nextPutIf:then:else:", "stream", "receiverInternalVariableName", "nextPutAll:", ",", "visit:", "first", "dagChildren", "second", "third"]
|
|
|
}),
|
|
|
$globals.IRInliningJSTranslator);
|
|
|
|
|
@@ -1112,9 +1104,9 @@ $recv($2)._nextPutAll_("$core.assert(");
|
|
|
|
|
|
$ctx2.sendIdx["nextPutAll:"]=1;
|
|
|
|
|
|
-$4=$recv(anIRInlinedIfTrue)._instructions();
|
|
|
+$4=$recv(anIRInlinedIfTrue)._dagChildren();
|
|
|
|
|
|
-$ctx2.sendIdx["instructions"]=1;
|
|
|
+$ctx2.sendIdx["dagChildren"]=1;
|
|
|
|
|
|
$3=$recv($4)._first();
|
|
|
self._visit_($3);
|
|
@@ -1129,7 +1121,7 @@ return $recv(self._stream())._nextPutAll_(")");
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
|
-return self._visit_($recv($recv(anIRInlinedIfTrue)._instructions())._last());
|
|
|
+return self._visit_($recv($recv(anIRInlinedIfTrue)._dagChildren())._last());
|
|
|
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
|
|
|
|
|
@@ -1141,10 +1133,10 @@ return self;
|
|
|
},
|
|
|
|
|
|
args: ["anIRInlinedIfTrue"],
|
|
|
-source: "visitIRInlinedIfTrue: anIRInlinedIfTrue\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfTrue instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfTrue instructions last ]",
|
|
|
+source: "visitIRInlinedIfTrue: anIRInlinedIfTrue\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfTrue dagChildren first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfTrue dagChildren last ]",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["nextPutIf:then:", "stream", "nextPutAll:", "visit:", "first", "instructions", "last"]
|
|
|
+messageSends: ["nextPutIf:then:", "stream", "nextPutAll:", "visit:", "first", "dagChildren", "last"]
|
|
|
}),
|
|
|
$globals.IRInliningJSTranslator);
|
|
|
|
|
@@ -1174,9 +1166,9 @@ $recv($2)._nextPutAll_("$core.assert(");
|
|
|
|
|
|
$ctx2.sendIdx["nextPutAll:"]=1;
|
|
|
|
|
|
-$4=$recv(anIRInlinedIfTrueIfFalse)._instructions();
|
|
|
+$4=$recv(anIRInlinedIfTrueIfFalse)._dagChildren();
|
|
|
|
|
|
-$ctx2.sendIdx["instructions"]=1;
|
|
|
+$ctx2.sendIdx["dagChildren"]=1;
|
|
|
|
|
|
$3=$recv($4)._first();
|
|
|
self._visit_($3);
|
|
@@ -1191,9 +1183,9 @@ return $recv(self._stream())._nextPutAll_(")");
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
|
-$6=$recv(anIRInlinedIfTrueIfFalse)._instructions();
|
|
|
+$6=$recv(anIRInlinedIfTrueIfFalse)._dagChildren();
|
|
|
|
|
|
-$ctx2.sendIdx["instructions"]=2;
|
|
|
+$ctx2.sendIdx["dagChildren"]=2;
|
|
|
|
|
|
$5=$recv($6)._second();
|
|
|
return self._visit_($5);
|
|
@@ -1207,7 +1199,7 @@ $ctx2.sendIdx["visit:"]=2;
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
|
-return self._visit_($recv($recv(anIRInlinedIfTrueIfFalse)._instructions())._third());
|
|
|
+return self._visit_($recv($recv(anIRInlinedIfTrueIfFalse)._dagChildren())._third());
|
|
|
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
|
|
|
|
|
@@ -1219,10 +1211,10 @@ return self;
|
|
|
},
|
|
|
|
|
|
args: ["anIRInlinedIfTrueIfFalse"],
|
|
|
-source: "visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse\x0a\x09self stream\x0a\x09\x09nextPutIf: [\x0a\x09\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09\x09self visit: anIRInlinedIfTrueIfFalse instructions first.\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]\x0a\x09\x09else: [ self visit: anIRInlinedIfTrueIfFalse instructions third ]",
|
|
|
+source: "visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse\x0a\x09self stream\x0a\x09\x09nextPutIf: [\x0a\x09\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09\x09self visit: anIRInlinedIfTrueIfFalse dagChildren first.\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfTrueIfFalse dagChildren second ]\x0a\x09\x09else: [ self visit: anIRInlinedIfTrueIfFalse dagChildren third ]",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["nextPutIf:then:else:", "stream", "nextPutAll:", "visit:", "first", "instructions", "second", "third"]
|
|
|
+messageSends: ["nextPutIf:then:else:", "stream", "nextPutAll:", "visit:", "first", "dagChildren", "second", "third"]
|
|
|
}),
|
|
|
$globals.IRInliningJSTranslator);
|
|
|
|
|
@@ -1299,7 +1291,7 @@ var self=this;
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
-$recv($recv(anIRInlinedSequence)._instructions())._do_((function(each){
|
|
|
+$recv($recv(anIRInlinedSequence)._dagChildren())._do_((function(each){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
@@ -1323,10 +1315,10 @@ return self;
|
|
|
},
|
|
|
|
|
|
args: ["anIRInlinedSequence"],
|
|
|
-source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09anIRInlinedSequence instructions do: [ :each |\x0a\x09\x09self stream nextPutStatementWith: [ self visit: each ]]",
|
|
|
+source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09anIRInlinedSequence dagChildren do: [ :each |\x0a\x09\x09self stream nextPutStatementWith: [ self visit: each ]]",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["do:", "instructions", "nextPutStatementWith:", "stream", "visit:"]
|
|
|
+messageSends: ["do:", "dagChildren", "nextPutStatementWith:", "stream", "visit:"]
|
|
|
}),
|
|
|
$globals.IRInliningJSTranslator);
|
|
|
|
|
@@ -1695,7 +1687,7 @@ $recv(inlinedClosure)._add_(sequence);
|
|
|
|
|
|
$ctx1.sendIdx["add:"]=6;
|
|
|
|
|
|
-statements=$recv($recv(anIRClosure)._sequence())._instructions();
|
|
|
+statements=$recv($recv(anIRClosure)._sequence())._dagChildren();
|
|
|
$recv(statements)._ifNotEmpty_((function(){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
@@ -1755,10 +1747,10 @@ return inlinedClosure;
|
|
|
},
|
|
|
|
|
|
args: ["anIRClosure"],
|
|
|
-source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure sequence statements |\x0a\x0a\x09inlinedClosure := self inlinedClosure.\x0a\x09inlinedClosure \x0a\x09\x09scope: anIRClosure scope;\x0a\x09\x09parent: anIRClosure parent.\x0a\x0a\x09\x22Add the possible temp declarations\x22\x0a\x09anIRClosure tempDeclarations do: [ :each |\x0a\x09\x09\x09inlinedClosure add: each ].\x0a\x0a\x09\x22Add a block sequence\x22\x0a\x09sequence := self inlinedSequence.\x0a\x0a\x09\x22Map the closure arguments to the receiver of the message send\x22\x0a\x09anIRClosure arguments do: [ :each |\x0a\x09\x09inlinedClosure add: (IRTempDeclaration new name: each; yourself).\x0a\x09\x09sequence add: (IRAssignment new\x0a\x09\x09\x09add: (IRVariable new variable: (AliasVar new scope: inlinedClosure scope; name: each; yourself));\x0a\x09\x09\x09add: (IRVariable new variable: (AliasVar new scope: inlinedClosure scope; name: '$receiver'; yourself));\x0a\x09\x09\x09yourself) ].\x0a\x09\x09\x09\x0a\x09\x22To ensure the correct order of the closure instructions: first the temps then the sequence\x22\x0a\x09inlinedClosure add: sequence.\x0a\x0a\x09\x22Get all the statements\x22\x0a\x09statements := anIRClosure sequence instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements allButLast do: [ :each | sequence add: each ].\x0a\x0a\x09\x09\x22Inlined closures don't have implicit local returns\x22\x0a\x09\x09(statements last isReturn and: [ statements last isBlockReturn ])\x0a\x09\x09\x09ifTrue: [ sequence add: statements last expression ]\x0a\x09\x09\x09ifFalse: [ sequence add: statements last ] ].\x0a\x0a\x09^ inlinedClosure",
|
|
|
+source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure sequence statements |\x0a\x0a\x09inlinedClosure := self inlinedClosure.\x0a\x09inlinedClosure \x0a\x09\x09scope: anIRClosure scope;\x0a\x09\x09parent: anIRClosure parent.\x0a\x0a\x09\x22Add the possible temp declarations\x22\x0a\x09anIRClosure tempDeclarations do: [ :each |\x0a\x09\x09\x09inlinedClosure add: each ].\x0a\x0a\x09\x22Add a block sequence\x22\x0a\x09sequence := self inlinedSequence.\x0a\x0a\x09\x22Map the closure arguments to the receiver of the message send\x22\x0a\x09anIRClosure arguments do: [ :each |\x0a\x09\x09inlinedClosure add: (IRTempDeclaration new name: each; yourself).\x0a\x09\x09sequence add: (IRAssignment new\x0a\x09\x09\x09add: (IRVariable new variable: (AliasVar new scope: inlinedClosure scope; name: each; yourself));\x0a\x09\x09\x09add: (IRVariable new variable: (AliasVar new scope: inlinedClosure scope; name: '$receiver'; yourself));\x0a\x09\x09\x09yourself) ].\x0a\x09\x09\x09\x0a\x09\x22To ensure the correct order of the closure instructions: first the temps then the sequence\x22\x0a\x09inlinedClosure add: sequence.\x0a\x0a\x09\x22Get all the statements\x22\x0a\x09statements := anIRClosure sequence dagChildren.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements allButLast do: [ :each | sequence add: each ].\x0a\x0a\x09\x09\x22Inlined closures don't have implicit local returns\x22\x0a\x09\x09(statements last isReturn and: [ statements last isBlockReturn ])\x0a\x09\x09\x09ifTrue: [ sequence add: statements last expression ]\x0a\x09\x09\x09ifFalse: [ sequence add: statements last ] ].\x0a\x0a\x09^ inlinedClosure",
|
|
|
referencedClasses: ["IRTempDeclaration", "IRAssignment", "IRVariable", "AliasVar"],
|
|
|
|
|
|
-messageSends: ["inlinedClosure", "scope:", "scope", "parent:", "parent", "do:", "tempDeclarations", "add:", "inlinedSequence", "arguments", "name:", "new", "yourself", "variable:", "instructions", "sequence", "ifNotEmpty:", "allButLast", "ifTrue:ifFalse:", "and:", "isReturn", "last", "isBlockReturn", "expression"]
|
|
|
+messageSends: ["inlinedClosure", "scope:", "scope", "parent:", "parent", "do:", "tempDeclarations", "add:", "inlinedSequence", "arguments", "name:", "new", "yourself", "variable:", "dagChildren", "sequence", "ifNotEmpty:", "allButLast", "ifTrue:ifFalse:", "and:", "isReturn", "last", "isBlockReturn", "expression"]
|
|
|
}),
|
|
|
$globals.IRSendInliner);
|
|
|
|
|
@@ -2170,7 +2162,7 @@ return $core.withContext(function($ctx1) {
|
|
|
|
|
|
self._assignment_(anIRAssignment);
|
|
|
inlinedAssignment=$recv($globals.IRInlinedAssignment)._new();
|
|
|
-$recv($recv(anIRAssignment)._instructions())._do_((function(each){
|
|
|
+$recv($recv(anIRAssignment)._dagChildren())._do_((function(each){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
@@ -2188,10 +2180,10 @@ return inlinedAssignment;
|
|
|
},
|
|
|
|
|
|
args: ["anIRAssignment"],
|
|
|
-source: "inlineAssignment: anIRAssignment\x0a\x09| inlinedAssignment |\x0a\x09self assignment: anIRAssignment.\x0a\x09inlinedAssignment := IRInlinedAssignment new.\x0a\x09anIRAssignment instructions do: [ :each |\x0a\x09\x09inlinedAssignment add: each ].\x0a\x09anIRAssignment replaceWith: inlinedAssignment.\x0a\x09self inlineSend: inlinedAssignment right.\x0a\x09^ inlinedAssignment",
|
|
|
+source: "inlineAssignment: anIRAssignment\x0a\x09| inlinedAssignment |\x0a\x09self assignment: anIRAssignment.\x0a\x09inlinedAssignment := IRInlinedAssignment new.\x0a\x09anIRAssignment dagChildren do: [ :each |\x0a\x09\x09inlinedAssignment add: each ].\x0a\x09anIRAssignment replaceWith: inlinedAssignment.\x0a\x09self inlineSend: inlinedAssignment right.\x0a\x09^ inlinedAssignment",
|
|
|
referencedClasses: ["IRInlinedAssignment"],
|
|
|
|
|
|
-messageSends: ["assignment:", "new", "do:", "instructions", "add:", "replaceWith:", "inlineSend:", "right"]
|
|
|
+messageSends: ["assignment:", "new", "do:", "dagChildren", "add:", "replaceWith:", "inlineSend:", "right"]
|
|
|
}),
|
|
|
$globals.IRAssignmentInliner);
|
|
|
|
|
@@ -2214,7 +2206,7 @@ $ctx1.supercall = true,
|
|
|
|
|
|
$ctx1.supercall = false;
|
|
|
|
|
|
-statements=$recv($recv(inlinedClosure)._sequence())._instructions();
|
|
|
+statements=$recv($recv(inlinedClosure)._sequence())._dagChildren();
|
|
|
$recv(statements)._ifNotEmpty_((function(){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
@@ -2249,10 +2241,10 @@ return inlinedClosure;
|
|
|
},
|
|
|
|
|
|
args: ["anIRClosure"],
|
|
|
-source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure statements |\x0a\x0a\x09inlinedClosure := super inlineClosure: anIRClosure.\x0a\x09statements := inlinedClosure sequence instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last canBeAssigned ifTrue: [\x0a\x09\x09\x09statements last replaceWith: (IRAssignment new\x0a\x09\x09\x09\x09add: self assignment left;\x0a\x09\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09\x09yourself) ] ].\x0a\x0a\x09^ inlinedClosure",
|
|
|
+source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure statements |\x0a\x0a\x09inlinedClosure := super inlineClosure: anIRClosure.\x0a\x09statements := inlinedClosure sequence dagChildren.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last canBeAssigned ifTrue: [\x0a\x09\x09\x09statements last replaceWith: (IRAssignment new\x0a\x09\x09\x09\x09add: self assignment left;\x0a\x09\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09\x09yourself) ] ].\x0a\x0a\x09^ inlinedClosure",
|
|
|
referencedClasses: ["IRAssignment"],
|
|
|
|
|
|
-messageSends: ["inlineClosure:", "instructions", "sequence", "ifNotEmpty:", "ifTrue:", "canBeAssigned", "last", "replaceWith:", "add:", "new", "left", "assignment", "copy", "yourself"]
|
|
|
+messageSends: ["inlineClosure:", "dagChildren", "sequence", "ifNotEmpty:", "ifTrue:", "canBeAssigned", "last", "replaceWith:", "add:", "new", "left", "assignment", "copy", "yourself"]
|
|
|
}),
|
|
|
$globals.IRAssignmentInliner);
|
|
|
|
|
@@ -2281,7 +2273,7 @@ $ctx1.supercall = true,
|
|
|
|
|
|
$ctx1.supercall = false;
|
|
|
|
|
|
-statements=$recv($recv(closure)._sequence())._instructions();
|
|
|
+statements=$recv($recv(closure)._sequence())._dagChildren();
|
|
|
$recv(statements)._ifNotEmpty_((function(){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
@@ -2312,10 +2304,10 @@ return closure;
|
|
|
},
|
|
|
|
|
|
args: ["anIRClosure"],
|
|
|
-source: "inlineClosure: anIRClosure\x0a\x09| closure statements |\x0a\x0a\x09closure := super inlineClosure: anIRClosure.\x0a\x09statements := closure sequence instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last isReturn\x0a\x09\x09\x09ifFalse: [ statements last replaceWith: (IRReturn new\x0a\x09\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09\x09yourself)] ].\x0a\x0a\x09^ closure",
|
|
|
+source: "inlineClosure: anIRClosure\x0a\x09| closure statements |\x0a\x0a\x09closure := super inlineClosure: anIRClosure.\x0a\x09statements := closure sequence dagChildren.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last isReturn\x0a\x09\x09\x09ifFalse: [ statements last replaceWith: (IRReturn new\x0a\x09\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09\x09yourself)] ].\x0a\x0a\x09^ closure",
|
|
|
referencedClasses: ["IRReturn"],
|
|
|
|
|
|
-messageSends: ["inlineClosure:", "instructions", "sequence", "ifNotEmpty:", "ifFalse:", "isReturn", "last", "replaceWith:", "add:", "new", "copy", "yourself"]
|
|
|
+messageSends: ["inlineClosure:", "dagChildren", "sequence", "ifNotEmpty:", "ifFalse:", "isReturn", "last", "replaceWith:", "add:", "new", "copy", "yourself"]
|
|
|
}),
|
|
|
$globals.IRReturnInliner);
|
|
|
|
|
@@ -2330,7 +2322,7 @@ var return_;
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
return_=self._inlinedReturn();
|
|
|
-$recv($recv(anIRReturn)._instructions())._do_((function(each){
|
|
|
+$recv($recv(anIRReturn)._dagChildren())._do_((function(each){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
@@ -2348,10 +2340,10 @@ return return_;
|
|
|
},
|
|
|
|
|
|
args: ["anIRReturn"],
|
|
|
-source: "inlineReturn: anIRReturn\x0a\x09| return |\x0a\x09return := self inlinedReturn.\x0a\x09anIRReturn instructions do: [ :each |\x0a\x09\x09return add: each ].\x0a\x09anIRReturn replaceWith: return.\x0a\x09self inlineSend: return expression.\x0a\x09^ return",
|
|
|
+source: "inlineReturn: anIRReturn\x0a\x09| return |\x0a\x09return := self inlinedReturn.\x0a\x09anIRReturn dagChildren do: [ :each |\x0a\x09\x09return add: each ].\x0a\x09anIRReturn replaceWith: return.\x0a\x09self inlineSend: return expression.\x0a\x09^ return",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["inlinedReturn", "do:", "instructions", "add:", "replaceWith:", "inlineSend:", "expression"]
|
|
|
+messageSends: ["inlinedReturn", "do:", "dagChildren", "add:", "replaceWith:", "inlineSend:", "expression"]
|
|
|
}),
|
|
|
$globals.IRReturnInliner);
|
|
|
|