|
@@ -665,7 +665,43 @@ $globals.IRInliner);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
-selector: "transformNonLocalReturn:",
|
|
|
+selector: "visitIRAssignment:",
|
|
|
+protocol: 'visiting',
|
|
|
+fn: function (anIRAssignment){
|
|
|
+var self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+var $1;
|
|
|
+$1=self._shouldInlineAssignment_(anIRAssignment);
|
|
|
+if($core.assert($1)){
|
|
|
+return $recv(self._assignmentInliner())._inlineAssignment_(anIRAssignment);
|
|
|
+} else {
|
|
|
+return (
|
|
|
+
|
|
|
+$ctx1.supercall = true,
|
|
|
+
|
|
|
+($globals.IRInliner.superclass||$boot.nilAsClass).fn.prototype._visitIRAssignment_.apply($recv(self), [anIRAssignment]));
|
|
|
+
|
|
|
+$ctx1.supercall = false;
|
|
|
+
|
|
|
+};
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment},$globals.IRInliner)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: ["anIRAssignment"],
|
|
|
+source: "visitIRAssignment: anIRAssignment\x0a\x09^ (self shouldInlineAssignment: anIRAssignment)\x0a\x09\x09ifTrue: [ self assignmentInliner inlineAssignment: anIRAssignment ]\x0a\x09\x09ifFalse: [ super visitIRAssignment: anIRAssignment ]",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: ["ifTrue:ifFalse:", "shouldInlineAssignment:", "inlineAssignment:", "assignmentInliner", "visitIRAssignment:"]
|
|
|
+}),
|
|
|
+$globals.IRInliner);
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "visitIRNonLocalReturn:",
|
|
|
protocol: 'visiting',
|
|
|
fn: function (anIRNonLocalReturn){
|
|
|
var self=this;
|
|
@@ -716,77 +752,18 @@ $ctx1.supercall = false;
|
|
|
|
|
|
return $7;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"transformNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn,localReturn:localReturn},$globals.IRInliner)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn,localReturn:localReturn},$globals.IRInliner)});
|
|
|
|
|
|
},
|
|
|
|
|
|
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 dagChildren do: [ :each |\x0a\x09\x09\x09localReturn add: each ].\x0a\x09\x09anIRNonLocalReturn replaceWith: localReturn.\x0a\x09\x09^ localReturn ].\x0a\x09^ super visitIRNonLocalReturn: anIRNonLocalReturn",
|
|
|
+source: "visitIRNonLocalReturn: anIRNonLocalReturn\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:", "dagChildren", "add:", "replaceWith:", "visitIRNonLocalReturn:"]
|
|
|
}),
|
|
|
$globals.IRInliner);
|
|
|
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "visitIRAssignment:",
|
|
|
-protocol: 'visiting',
|
|
|
-fn: function (anIRAssignment){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-var $1;
|
|
|
-$1=self._shouldInlineAssignment_(anIRAssignment);
|
|
|
-if($core.assert($1)){
|
|
|
-return $recv(self._assignmentInliner())._inlineAssignment_(anIRAssignment);
|
|
|
-} else {
|
|
|
-return (
|
|
|
-
|
|
|
-$ctx1.supercall = true,
|
|
|
-
|
|
|
-($globals.IRInliner.superclass||$boot.nilAsClass).fn.prototype._visitIRAssignment_.apply($recv(self), [anIRAssignment]));
|
|
|
-
|
|
|
-$ctx1.supercall = false;
|
|
|
-
|
|
|
-};
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment},$globals.IRInliner)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["anIRAssignment"],
|
|
|
-source: "visitIRAssignment: anIRAssignment\x0a\x09^ (self shouldInlineAssignment: anIRAssignment)\x0a\x09\x09ifTrue: [ self assignmentInliner inlineAssignment: anIRAssignment ]\x0a\x09\x09ifFalse: [ super visitIRAssignment: anIRAssignment ]",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: ["ifTrue:ifFalse:", "shouldInlineAssignment:", "inlineAssignment:", "assignmentInliner", "visitIRAssignment:"]
|
|
|
-}),
|
|
|
-$globals.IRInliner);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "visitIRNonLocalReturn:",
|
|
|
-protocol: 'visiting',
|
|
|
-fn: function (anIRNonLocalReturn){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-return self._transformNonLocalReturn_(anIRNonLocalReturn);
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn},$globals.IRInliner)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["anIRNonLocalReturn"],
|
|
|
-source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09^ self transformNonLocalReturn: anIRNonLocalReturn",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: ["transformNonLocalReturn:"]
|
|
|
-}),
|
|
|
-$globals.IRInliner);
|
|
|
-
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "visitIRReturn:",
|
|
@@ -1218,46 +1195,6 @@ messageSends: ["nextPutIf:then:else:", "stream", "nextPutAll:", "visit:", "first
|
|
|
}),
|
|
|
$globals.IRInliningJSTranslator);
|
|
|
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "visitIRInlinedNonLocalReturn:",
|
|
|
-protocol: 'visiting',
|
|
|
-fn: function (anIRInlinedReturn){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-var $1;
|
|
|
-$1=self._stream();
|
|
|
-
|
|
|
-$ctx1.sendIdx["stream"]=1;
|
|
|
-
|
|
|
-$recv($1)._nextPutStatementWith_((function(){
|
|
|
-
|
|
|
-return $core.withContext(function($ctx2) {
|
|
|
-
|
|
|
-return self._visit_($recv(anIRInlinedReturn)._expression());
|
|
|
-
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
-
|
|
|
-}));
|
|
|
-$recv(self._stream())._nextPutNonLocalReturnWith_((function(){
|
|
|
-
|
|
|
-}));
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedNonLocalReturn:",{anIRInlinedReturn:anIRInlinedReturn},$globals.IRInliningJSTranslator)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["anIRInlinedReturn"],
|
|
|
-source: "visitIRInlinedNonLocalReturn: anIRInlinedReturn\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self visit: anIRInlinedReturn expression ].\x0a\x09self stream nextPutNonLocalReturnWith: [ ]",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: ["nextPutStatementWith:", "stream", "visit:", "expression", "nextPutNonLocalReturnWith:"]
|
|
|
-}),
|
|
|
-$globals.IRInliningJSTranslator);
|
|
|
-
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "visitIRInlinedReturn:",
|
|
@@ -1566,7 +1503,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,$27,$26;
|
|
|
+var $1,$2,$3,$5,$6,$4,$7,$9,$11,$13,$14,$15,$12,$10,$17,$19,$20,$18,$16,$8;
|
|
|
inlinedClosure=self._inlinedClosure();
|
|
|
$1=inlinedClosure;
|
|
|
$2=$recv(anIRClosure)._scope();
|
|
@@ -1704,38 +1641,7 @@ $ctx3.sendIdx["add:"]=7;
|
|
|
}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,4)});
|
|
|
|
|
|
}));
|
|
|
-$23=$recv(statements)._last();
|
|
|
-
|
|
|
-$ctx2.sendIdx["last"]=1;
|
|
|
-
|
|
|
-$22=$recv($23)._isReturn();
|
|
|
-$21=$recv($22)._and_((function(){
|
|
|
-
|
|
|
-return $core.withContext(function($ctx3) {
|
|
|
-
|
|
|
-$24=$recv(statements)._last();
|
|
|
-
|
|
|
-$ctx3.sendIdx["last"]=2;
|
|
|
-
|
|
|
-return $recv($24)._isBlockReturn();
|
|
|
-
|
|
|
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)});
|
|
|
-
|
|
|
-}));
|
|
|
-if($core.assert($21)){
|
|
|
-$25=sequence;
|
|
|
-$27=$recv(statements)._last();
|
|
|
-
|
|
|
-$ctx2.sendIdx["last"]=3;
|
|
|
-
|
|
|
-$26=$recv($27)._expression();
|
|
|
-return $recv($25)._add_($26);
|
|
|
-
|
|
|
-$ctx2.sendIdx["add:"]=8;
|
|
|
-
|
|
|
-} else {
|
|
|
-return $recv(sequence)._add_($recv(statements)._last());
|
|
|
-};
|
|
|
+return $recv(sequence)._add_($recv($recv(statements)._last())._asInlinedBlockResult());
|
|
|
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
|
|
|
|
|
@@ -1747,10 +1653,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 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",
|
|
|
+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 change local returns into result value itself\x22\x0a\x09\x09sequence add: statements last asInlinedBlockResult ].\x0a\x0a\x09^ inlinedClosure",
|
|
|
referencedClasses: ["IRTempDeclaration", "IRAssignment", "IRVariable", "AliasVar"],
|
|
|
|
|
|
-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"]
|
|
|
+messageSends: ["inlinedClosure", "scope:", "scope", "parent:", "parent", "do:", "tempDeclarations", "add:", "inlinedSequence", "arguments", "name:", "new", "yourself", "variable:", "dagChildren", "sequence", "ifNotEmpty:", "allButLast", "asInlinedBlockResult", "last"]
|
|
|
}),
|
|
|
$globals.IRSendInliner);
|
|
|
|
|
@@ -2193,12 +2099,12 @@ selector: "inlineClosure:",
|
|
|
protocol: 'inlining',
|
|
|
fn: function (anIRClosure){
|
|
|
var self=this;
|
|
|
-var inlinedClosure,statements;
|
|
|
+var closure,statements;
|
|
|
|
|
|
return $core.withContext(function($ctx1) {
|
|
|
|
|
|
var $2,$1,$3,$5,$4;
|
|
|
-inlinedClosure=(
|
|
|
+closure=(
|
|
|
|
|
|
$ctx1.supercall = true,
|
|
|
|
|
@@ -2206,7 +2112,7 @@ $ctx1.supercall = true,
|
|
|
|
|
|
$ctx1.supercall = false;
|
|
|
|
|
|
-statements=$recv($recv(inlinedClosure)._sequence())._dagChildren();
|
|
|
+statements=$recv($recv(closure)._sequence())._dagChildren();
|
|
|
$recv(statements)._ifNotEmpty_((function(){
|
|
|
|
|
|
return $core.withContext(function($ctx2) {
|
|
@@ -2215,7 +2121,7 @@ $2=$recv(statements)._last();
|
|
|
|
|
|
$ctx2.sendIdx["last"]=1;
|
|
|
|
|
|
-$1=$recv($2)._canBeAssigned();
|
|
|
+$1=$recv($2)._yieldsValue();
|
|
|
if($core.assert($1)){
|
|
|
$3=$recv(statements)._last();
|
|
|
|
|
@@ -2234,17 +2140,17 @@ return $recv($3)._replaceWith_($4);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
|
|
|
}));
|
|
|
-return inlinedClosure;
|
|
|
+return closure;
|
|
|
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,inlinedClosure:inlinedClosure,statements:statements},$globals.IRAssignmentInliner)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,closure:closure,statements:statements},$globals.IRAssignmentInliner)});
|
|
|
|
|
|
},
|
|
|
|
|
|
args: ["anIRClosure"],
|
|
|
-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",
|
|
|
+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 yieldsValue 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^ closure",
|
|
|
referencedClasses: ["IRAssignment"],
|
|
|
|
|
|
-messageSends: ["inlineClosure:", "dagChildren", "sequence", "ifNotEmpty:", "ifTrue:", "canBeAssigned", "last", "replaceWith:", "add:", "new", "left", "assignment", "copy", "yourself"]
|
|
|
+messageSends: ["inlineClosure:", "dagChildren", "sequence", "ifNotEmpty:", "ifTrue:", "yieldsValue", "last", "replaceWith:", "add:", "new", "left", "assignment", "copy", "yourself"]
|
|
|
}),
|
|
|
$globals.IRAssignmentInliner);
|
|
|
|
|
@@ -2282,8 +2188,8 @@ $2=$recv(statements)._last();
|
|
|
|
|
|
$ctx2.sendIdx["last"]=1;
|
|
|
|
|
|
-$1=$recv($2)._isReturn();
|
|
|
-if(!$core.assert($1)){
|
|
|
+$1=$recv($2)._yieldsValue();
|
|
|
+if($core.assert($1)){
|
|
|
$3=$recv(statements)._last();
|
|
|
|
|
|
$ctx2.sendIdx["last"]=2;
|
|
@@ -2304,10 +2210,10 @@ return closure;
|
|
|
},
|
|
|
|
|
|
args: ["anIRClosure"],
|
|
|
-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",
|
|
|
+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 yieldsValue ifTrue: [\x0a\x09\x09\x09statements 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:", "dagChildren", "sequence", "ifNotEmpty:", "ifFalse:", "isReturn", "last", "replaceWith:", "add:", "new", "copy", "yourself"]
|
|
|
+messageSends: ["inlineClosure:", "dagChildren", "sequence", "ifNotEmpty:", "ifTrue:", "yieldsValue", "last", "replaceWith:", "add:", "new", "copy", "yourself"]
|
|
|
}),
|
|
|
$globals.IRReturnInliner);
|
|
|
|
|
@@ -2469,4 +2375,45 @@ $core.addClass('InliningError', $globals.SemanticError, [], 'Compiler-Inlining')
|
|
|
$globals.InliningError.comment="Instances of InliningError are signaled when using an `InliningCodeGenerator`in a `Compiler`.";
|
|
|
|
|
|
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "asInlinedBlockResult",
|
|
|
+protocol: '*Compiler-Inlining',
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+return self._expression();
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"asInlinedBlockResult",{},$globals.IRBlockReturn)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "asInlinedBlockResult\x0a\x09^ self expression",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: ["expression"]
|
|
|
+}),
|
|
|
+$globals.IRBlockReturn);
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "asInlinedBlockResult",
|
|
|
+protocol: '*Compiler-Inlining',
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+return self;
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "asInlinedBlockResult\x0a\x09^ self",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: []
|
|
|
+}),
|
|
|
+$globals.IRInstruction);
|
|
|
+
|
|
|
});
|