|
@@ -592,25 +592,16 @@ var self=this;
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
-var $4,$3,$2,$1;
|
|
|
+var $1;
|
|
|
$1=$recv($recv($recv(anIRReturn)._isInlined())._not())._and_((function(){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
|
-$4=$recv(anIRReturn)._instructions();
|
|
|
-
|
|
|
-$ctx2.sendIdx["instructions"]=1;
|
|
|
-
|
|
|
-$3=$recv($4)._single();
|
|
|
-
|
|
|
-$ctx2.sendIdx["single"]=1;
|
|
|
-
|
|
|
-$2=$recv($3)._isSend();
|
|
|
-return $recv($2)._and_((function(){
|
|
|
+return $recv($recv($recv($recv(anIRReturn)._instructions())._single())._isSend())._and_((function(){
|
|
|
|
|
|
return $core.withContext(function($ctx3) {
|
|
|
|
|
|
-return self._shouldInlineSend_($recv($recv(anIRReturn)._instructions())._single());
|
|
|
+return self._shouldInlineSend_($recv(anIRReturn)._expression());
|
|
|
|
|
|
}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
|
|
|
|
|
@@ -629,10 +620,10 @@ return $1;
|
|
|
},
|
|
|
|
|
|
args: ["anIRReturn"],
|
|
|
-source: "shouldInlineReturn: anIRReturn\x0a\x09^ anIRReturn isInlined not and: [\x0a\x09\x09anIRReturn instructions single isSend and: [\x0a\x09\x09\x09self shouldInlineSend: (anIRReturn instructions single) ]]",
|
|
|
+source: "shouldInlineReturn: anIRReturn\x0a\x09^ anIRReturn isInlined not and: [\x0a\x09\x09anIRReturn instructions single isSend and: [\x0a\x09\x09\x09self shouldInlineSend: anIRReturn expression ]]",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["and:", "not", "isInlined", "isSend", "single", "instructions", "shouldInlineSend:"]
|
|
|
+messageSends: ["and:", "not", "isInlined", "isSend", "single", "instructions", "shouldInlineSend:", "expression"]
|
|
|
}),
|
|
|
$globals.IRInliner);
|
|
|
|
|
@@ -1248,7 +1239,7 @@ $recv($1)._nextPutStatementWith_((function(){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
|
-return self._visit_($recv($recv(anIRInlinedReturn)._instructions())._single());
|
|
|
+return self._visit_($recv(anIRInlinedReturn)._expression());
|
|
|
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
|
|
@@ -1263,10 +1254,10 @@ return self;
|
|
|
},
|
|
|
|
|
|
args: ["anIRInlinedReturn"],
|
|
|
-source: "visitIRInlinedNonLocalReturn: anIRInlinedReturn\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self visit: anIRInlinedReturn instructions single ].\x0a\x09self stream nextPutNonLocalReturnWith: [ ]",
|
|
|
+source: "visitIRInlinedNonLocalReturn: anIRInlinedReturn\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self visit: anIRInlinedReturn expression ].\x0a\x09self stream nextPutNonLocalReturnWith: [ ]",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["nextPutStatementWith:", "stream", "visit:", "single", "instructions", "nextPutNonLocalReturnWith:"]
|
|
|
+messageSends: ["nextPutStatementWith:", "stream", "visit:", "expression", "nextPutNonLocalReturnWith:"]
|
|
|
}),
|
|
|
$globals.IRInliningJSTranslator);
|
|
|
|
|
@@ -1279,7 +1270,7 @@ var self=this;
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
-self._visit_($recv($recv(anIRInlinedReturn)._instructions())._single());
|
|
|
+self._visit_($recv(anIRInlinedReturn)._expression());
|
|
|
return self;
|
|
|
|
|
|
}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedReturn:",{anIRInlinedReturn:anIRInlinedReturn},$globals.IRInliningJSTranslator)});
|
|
@@ -1287,10 +1278,10 @@ return self;
|
|
|
},
|
|
|
|
|
|
args: ["anIRInlinedReturn"],
|
|
|
-source: "visitIRInlinedReturn: anIRInlinedReturn\x0a\x09self visit: anIRInlinedReturn instructions single",
|
|
|
+source: "visitIRInlinedReturn: anIRInlinedReturn\x0a\x09self visit: anIRInlinedReturn expression",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["visit:", "single", "instructions"]
|
|
|
+messageSends: ["visit:", "expression"]
|
|
|
}),
|
|
|
$globals.IRInliningJSTranslator);
|
|
|
|
|
@@ -1578,7 +1569,7 @@ var inlinedClosure,sequence,statements;
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
-var $1,$2,$3,$5,$6,$4,$7,$9,$11,$13,$14,$15,$12,$10,$17,$19,$20,$18,$16,$8,$23,$22,$24,$21,$25,$28,$27,$26;
|
|
|
+var $1,$2,$3,$5,$6,$4,$7,$9,$11,$13,$14,$15,$12,$10,$17,$19,$20,$18,$16,$8,$23,$22,$24,$21,$25,$27,$26;
|
|
|
inlinedClosure=self._inlinedClosure();
|
|
|
$1=inlinedClosure;
|
|
|
$2=$recv(anIRClosure)._scope();
|
|
@@ -1700,9 +1691,6 @@ $recv(inlinedClosure)._add_(sequence);
|
|
|
$ctx1.sendIdx["add:"]=6;
|
|
|
|
|
|
statements=$recv($recv(anIRClosure)._sequence())._instructions();
|
|
|
-
|
|
|
-$ctx1.sendIdx["instructions"]=1;
|
|
|
-
|
|
|
$recv(statements)._ifNotEmpty_((function(){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
@@ -1739,12 +1727,11 @@ return $recv($24)._isBlockReturn();
|
|
|
}));
|
|
|
if($core.assert($21)){
|
|
|
$25=sequence;
|
|
|
-$28=$recv(statements)._last();
|
|
|
+$27=$recv(statements)._last();
|
|
|
|
|
|
$ctx2.sendIdx["last"]=3;
|
|
|
|
|
|
-$27=$recv($28)._instructions();
|
|
|
-$26=$recv($27)._single();
|
|
|
+$26=$recv($27)._expression();
|
|
|
return $recv($25)._add_($26);
|
|
|
|
|
|
$ctx2.sendIdx["add:"]=8;
|
|
@@ -1763,10 +1750,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 instructions single ]\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 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",
|
|
|
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", "single"]
|
|
|
+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"]
|
|
|
}),
|
|
|
$globals.IRSendInliner);
|
|
|
|
|
@@ -2337,13 +2324,8 @@ var return_;
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
-var $1;
|
|
|
return_=self._inlinedReturn();
|
|
|
-$1=$recv(anIRReturn)._instructions();
|
|
|
-
|
|
|
-$ctx1.sendIdx["instructions"]=1;
|
|
|
-
|
|
|
-$recv($1)._do_((function(each){
|
|
|
+$recv($recv(anIRReturn)._instructions())._do_((function(each){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
|
|
|
@@ -2353,7 +2335,7 @@ return $recv(return_)._add_(each);
|
|
|
|
|
|
}));
|
|
|
$recv(anIRReturn)._replaceWith_(return_);
|
|
|
-self._inlineSend_($recv($recv(return_)._instructions())._single());
|
|
|
+self._inlineSend_($recv(return_)._expression());
|
|
|
return return_;
|
|
|
|
|
|
}, function($ctx1) {$ctx1.fill(self,"inlineReturn:",{anIRReturn:anIRReturn,return_:return_},$globals.IRReturnInliner)});
|
|
@@ -2361,10 +2343,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 instructions single.\x0a\x09^ return",
|
|
|
+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",
|
|
|
referencedClasses: [],
|
|
|
|
|
|
-messageSends: ["inlinedReturn", "do:", "instructions", "add:", "replaceWith:", "inlineSend:", "single"]
|
|
|
+messageSends: ["inlinedReturn", "do:", "instructions", "add:", "replaceWith:", "inlineSend:", "expression"]
|
|
|
}),
|
|
|
$globals.IRReturnInliner);
|
|
|
|