Browse Source

Extract writeActualSuperSend:.

Herby Vojčík 5 years ago
parent
commit
90cd83ac32
2 changed files with 68 additions and 34 deletions
  1. 55 28
      lang/src/Compiler-IR.js
  2. 13 6
      lang/src/Compiler-IR.st

+ 55 - 28
lang/src/Compiler-IR.js

@@ -4632,7 +4632,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$4,$3,$2,$5,$6,$7;
+var $1,$4,$3,$2,$5;
 $1=$self._stream();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["stream"]=1;
@@ -4681,66 +4681,93 @@ $recv($1)._lf();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["lf"]=4;
 //>>excludeEnd("ctx");
-$5="(".__comma($recv($self._currentClass())._asJavaScriptSource());
+$self._writeActualSuperSend_(anIRSend);
+$5=$self._stream();
+$recv($5)._nextPutAll_(");");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx[","]=2;
+$ctx1.sendIdx["nextPutAll:"]=5;
 //>>excludeEnd("ctx");
-$recv($1)._nextPutAll_($5);
+$recv($5)._lf();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["nextPutAll:"]=5;
+$ctx1.sendIdx["lf"]=5;
 //>>excludeEnd("ctx");
-$recv($1)._nextPutAll_(".superclass||$boot.nilAsClass).fn.prototype.");
+$recv($5)._nextPutAll_("//>>excludeStart(\x22ctx\x22, pragmas.excludeDebugContexts);");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["nextPutAll:"]=6;
 //>>excludeEnd("ctx");
-$6=$recv($recv(anIRSend)._javaScriptSelector()).__comma(".apply(");
+$recv($5)._lf();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx[","]=3;
+$ctx1.sendIdx["lf"]=6;
 //>>excludeEnd("ctx");
-$recv($1)._nextPutAll_($6);
+$recv($5)._nextPutAll_($recv($recv($recv(anIRSend)._scope())._alias()).__comma(".supercall = false;"));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["nextPutAll:"]=7;
 //>>excludeEnd("ctx");
-$recv($1)._nextPutAll_("$self, ");
+$recv($5)._lf();
+$recv($5)._nextPutAll_("//>>excludeEnd(\x22ctx\x22);");
+return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["nextPutAll:"]=8;
+}, function($ctx1) {$ctx1.fill(self,"visitSuperSend:",{anIRSend:anIRSend})});
 //>>excludeEnd("ctx");
-$self._visitInstructionList_enclosedBetween_and_($recv(anIRSend)._arguments(),"[","]");
-$7=$self._stream();
-$recv($7)._nextPutAll_("));");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anIRSend"],
+source: "visitSuperSend: anIRSend\x0a\x09self stream\x0a\x09\x09nextPutAll: '('; lf;\x0a\x09\x09nextPutAll: '//>>excludeStart(\x22ctx\x22, pragmas.excludeDebugContexts);'; lf;\x0a\x09\x09nextPutAll: anIRSend scope alias, '.supercall = true,'; lf;\x0a\x09\x09nextPutAll: '//>>excludeEnd(\x22ctx\x22);'; lf.\x0a\x09self writeActualSuperSend: anIRSend.\x0a\x09self stream \x0a\x09\x09nextPutAll: ');'; lf;\x0a\x09\x09nextPutAll: '//>>excludeStart(\x22ctx\x22, pragmas.excludeDebugContexts);'; lf;\x0a\x09\x09nextPutAll: anIRSend scope alias, '.supercall = false;'; lf;\x0a\x09\x09nextPutAll: '//>>excludeEnd(\x22ctx\x22);'",
+referencedClasses: [],
+//>>excludeEnd("ide");
+pragmas: [],
+messageSends: ["nextPutAll:", "stream", "lf", ",", "alias", "scope", "writeActualSuperSend:"]
+}),
+$globals.IRJSTranslator);
+
+$core.addMethod(
+$core.method({
+selector: "writeActualSuperSend:",
+protocol: "visiting",
+fn: function (anIRSend){
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["nextPutAll:"]=9;
+return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv($7)._lf();
+var $1,$2;
+$1=$self._stream();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["lf"]=5;
+$ctx1.sendIdx["stream"]=1;
 //>>excludeEnd("ctx");
-$recv($7)._nextPutAll_("//>>excludeStart(\x22ctx\x22, pragmas.excludeDebugContexts);");
+$2="(".__comma($recv($self._currentClass())._asJavaScriptSource());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["nextPutAll:"]=10;
+$ctx1.sendIdx[","]=1;
 //>>excludeEnd("ctx");
-$recv($7)._lf();
+$recv($1)._nextPutAll_($2);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["lf"]=6;
+$ctx1.sendIdx["nextPutAll:"]=1;
 //>>excludeEnd("ctx");
-$recv($7)._nextPutAll_($recv($recv($recv(anIRSend)._scope())._alias()).__comma(".supercall = false;"));
+$recv($1)._nextPutAll_(".superclass||$boot.nilAsClass).fn.prototype.");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["nextPutAll:"]=11;
+$ctx1.sendIdx["nextPutAll:"]=2;
+//>>excludeEnd("ctx");
+$recv($1)._nextPutAll_($recv($recv(anIRSend)._javaScriptSelector()).__comma(".apply("));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["nextPutAll:"]=3;
+//>>excludeEnd("ctx");
+$recv($1)._nextPutAll_("$self, ");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["nextPutAll:"]=4;
 //>>excludeEnd("ctx");
-$recv($7)._lf();
-$recv($7)._nextPutAll_("//>>excludeEnd(\x22ctx\x22);");
+$self._visitInstructionList_enclosedBetween_and_($recv(anIRSend)._arguments(),"[","]");
+$recv($self._stream())._nextPutAll_(")");
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"visitSuperSend:",{anIRSend:anIRSend})});
+}, function($ctx1) {$ctx1.fill(self,"writeActualSuperSend:",{anIRSend:anIRSend})});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRSend"],
-source: "visitSuperSend: anIRSend\x0a\x09self stream\x0a\x09\x09nextPutAll: '('; lf;\x0a\x09\x09nextPutAll: '//>>excludeStart(\x22ctx\x22, pragmas.excludeDebugContexts);'; lf;\x0a\x09\x09nextPutAll: anIRSend scope alias, '.supercall = true,'; lf;\x0a\x09\x09nextPutAll: '//>>excludeEnd(\x22ctx\x22);'; lf;\x0a\x09\x09nextPutAll: '(', self currentClass asJavaScriptSource;\x0a\x09\x09nextPutAll: '.superclass||$boot.nilAsClass).fn.prototype.';\x0a\x09\x09nextPutAll: anIRSend javaScriptSelector, '.apply(';\x0a\x09\x09nextPutAll: '$self, '.\x0a\x09self\x0a\x09\x09visitInstructionList: anIRSend arguments\x0a\x09\x09enclosedBetween: '[' and: ']'.\x0a\x09self stream \x0a\x09\x09nextPutAll: '));'; lf;\x0a\x09\x09nextPutAll: '//>>excludeStart(\x22ctx\x22, pragmas.excludeDebugContexts);'; lf;\x0a\x09\x09nextPutAll: anIRSend scope alias, '.supercall = false;'; lf;\x0a\x09\x09nextPutAll: '//>>excludeEnd(\x22ctx\x22);'",
+source: "writeActualSuperSend: anIRSend\x0a\x09self stream\x0a\x09\x09nextPutAll: '(', self currentClass asJavaScriptSource;\x0a\x09\x09nextPutAll: '.superclass||$boot.nilAsClass).fn.prototype.';\x0a\x09\x09nextPutAll: anIRSend javaScriptSelector, '.apply(';\x0a\x09\x09nextPutAll: '$self, '.\x0a\x09self\x0a\x09\x09visitInstructionList: anIRSend arguments\x0a\x09\x09enclosedBetween: '[' and: ']'.\x0a\x09self stream\x0a\x09\x09nextPutAll: ')'",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["nextPutAll:", "stream", "lf", ",", "alias", "scope", "asJavaScriptSource", "currentClass", "javaScriptSelector", "visitInstructionList:enclosedBetween:and:", "arguments"]
+messageSends: ["nextPutAll:", "stream", ",", "asJavaScriptSource", "currentClass", "javaScriptSelector", "visitInstructionList:enclosedBetween:and:", "arguments"]
 }),
 $globals.IRJSTranslator);
 

+ 13 - 6
lang/src/Compiler-IR.st

@@ -1071,7 +1071,17 @@ visitSuperSend: anIRSend
 		nextPutAll: '('; lf;
 		nextPutAll: '//>>excludeStart("ctx", pragmas.excludeDebugContexts);'; lf;
 		nextPutAll: anIRSend scope alias, '.supercall = true,'; lf;
-		nextPutAll: '//>>excludeEnd("ctx");'; lf;
+		nextPutAll: '//>>excludeEnd("ctx");'; lf.
+	self writeActualSuperSend: anIRSend.
+	self stream 
+		nextPutAll: ');'; lf;
+		nextPutAll: '//>>excludeStart("ctx", pragmas.excludeDebugContexts);'; lf;
+		nextPutAll: anIRSend scope alias, '.supercall = false;'; lf;
+		nextPutAll: '//>>excludeEnd("ctx");'
+!
+
+writeActualSuperSend: anIRSend
+	self stream
 		nextPutAll: '(', self currentClass asJavaScriptSource;
 		nextPutAll: '.superclass||$boot.nilAsClass).fn.prototype.';
 		nextPutAll: anIRSend javaScriptSelector, '.apply(';
@@ -1079,11 +1089,8 @@ visitSuperSend: anIRSend
 	self
 		visitInstructionList: anIRSend arguments
 		enclosedBetween: '[' and: ']'.
-	self stream 
-		nextPutAll: '));'; lf;
-		nextPutAll: '//>>excludeStart("ctx", pragmas.excludeDebugContexts);'; lf;
-		nextPutAll: anIRSend scope alias, '.supercall = false;'; lf;
-		nextPutAll: '//>>excludeEnd("ctx");'
+	self stream
+		nextPutAll: ')'
 ! !
 
 Object subclass: #JSStream