Browse Source

Simplify code.

Herbert Vojčík 7 years ago
parent
commit
1519e33bca
4 changed files with 8 additions and 95 deletions
  1. 6 43
      src/Compiler-IR.js
  2. 2 7
      src/Compiler-IR.st
  3. 0 40
      src/Compiler-Inlining.js
  4. 0 5
      src/Compiler-Inlining.st

+ 6 - 43
src/Compiler-IR.js

@@ -3953,34 +3953,21 @@ var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=self._stream();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["stream"]=1;
-//>>excludeEnd("ctx");
-$recv($1)._nextPutSequenceWith_((function(){
+$recv($recv(anIRSequence)._dagChildren())._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return $recv($recv(anIRSequence)._dagChildren())._do_((function(each){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx3) {
-//>>excludeEnd("ctx");
 return $recv(self._stream())._nextPutStatementWith_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx4) {
+return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 return self._visit_(each);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)});
-//>>excludeEnd("ctx");
-}));
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
 //>>excludeEnd("ctx");
 }));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
 return self;
@@ -3990,10 +3977,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRSequence"],
-source: "visitIRSequence: anIRSequence\x0a\x09self stream nextPutSequenceWith: [\x0a\x09\x09anIRSequence dagChildren do: [ :each |\x0a\x09\x09\x09self stream nextPutStatementWith: [ self visit: each ] ] ]",
+source: "visitIRSequence: anIRSequence\x0a\x09anIRSequence dagChildren do: [ :each |\x0a\x09\x09self stream nextPutStatementWith: [ self visit: each ] ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["nextPutSequenceWith:", "stream", "do:", "dagChildren", "nextPutStatementWith:", "visit:"]
+messageSends: ["do:", "dagChildren", "nextPutStatementWith:", "stream", "visit:"]
 }),
 $globals.IRJSTranslator);
 
@@ -5431,30 +5418,6 @@ messageSends: ["nextPutAll:", "lf", "alias", "scope", "asJavascript", "selector"
 }),
 $globals.JSStream);
 
-$core.addMethod(
-$core.method({
-selector: "nextPutSequenceWith:",
-protocol: 'streaming',
-fn: function (aBlock){
-var self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-$recv(aBlock)._value();
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"nextPutSequenceWith:",{aBlock:aBlock},$globals.JSStream)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aBlock"],
-source: "nextPutSequenceWith: aBlock\x0a\x09aBlock value",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["value"]
-}),
-$globals.JSStream);
-
 $core.addMethod(
 $core.method({
 selector: "nextPutStatementWith:",

+ 2 - 7
src/Compiler-IR.st

@@ -961,9 +961,8 @@ visitIRSend: anIRSend
 !
 
 visitIRSequence: anIRSequence
-	self stream nextPutSequenceWith: [
-		anIRSequence dagChildren do: [ :each |
-			self stream nextPutStatementWith: [ self visit: each ] ] ]
+	anIRSequence dagChildren do: [ :each |
+		self stream nextPutStatementWith: [ self visit: each ] ]
 !
 
 visitIRTempDeclaration: anIRTempDeclaration
@@ -1238,10 +1237,6 @@ nextPutSendIndexFor: anIRSend
 		nextPutAll: '//>>excludeEnd("ctx")'
 !
 
-nextPutSequenceWith: aBlock
-	aBlock value
-!
-
 nextPutStatementWith: aBlock
 	self omitSemicolon: false.
 	aBlock value.

+ 0 - 40
src/Compiler-Inlining.js

@@ -1077,46 +1077,6 @@ messageSends: ["nextPutIf:then:else:", "stream", "nextPutAll:", "visit:", "first
 }),
 $globals.IRInliningJSTranslator);
 
-$core.addMethod(
-$core.method({
-selector: "visitIRInlinedSequence:",
-protocol: 'visiting',
-fn: function (anIRInlinedSequence){
-var self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-$recv($recv(anIRInlinedSequence)._dagChildren())._do_((function(each){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $recv(self._stream())._nextPutStatementWith_((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx3) {
-//>>excludeEnd("ctx");
-return self._visit_(each);
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
-//>>excludeEnd("ctx");
-}));
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
-//>>excludeEnd("ctx");
-}));
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:",{anIRInlinedSequence:anIRInlinedSequence},$globals.IRInliningJSTranslator)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["anIRInlinedSequence"],
-source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09anIRInlinedSequence dagChildren do: [ :each |\x0a\x09\x09self stream nextPutStatementWith: [ self visit: each ]]",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["do:", "dagChildren", "nextPutStatementWith:", "stream", "visit:"]
-}),
-$globals.IRInliningJSTranslator);
-
 
 
 $core.addClass('IRSendInliner', $globals.Object, ['send', 'translator'], 'Compiler-Inlining');

+ 0 - 5
src/Compiler-Inlining.st

@@ -257,11 +257,6 @@ visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse
 			self stream nextPutAll: ')' ]
 		then: [ self visit: anIRInlinedIfTrueIfFalse dagChildren second ]
 		else: [ self visit: anIRInlinedIfTrueIfFalse dagChildren third ]
-!
-
-visitIRInlinedSequence: anIRInlinedSequence
-	anIRInlinedSequence dagChildren do: [ :each |
-		self stream nextPutStatementWith: [ self visit: each ]]
 ! !
 
 Object subclass: #IRSendInliner