Browse Source

Compiler: cleaner super receiver handling.

Herby Vojčík 4 years ago
parent
commit
dbc29ce2b5
4 changed files with 4 additions and 26 deletions
  1. 3 3
      lang/src/Compiler-IR.js
  2. 1 1
      lang/src/Compiler-IR.st
  3. 0 18
      lang/src/Compiler-Semantic.js
  4. 0 4
      lang/src/Compiler-Semantic.st

+ 3 - 3
lang/src/Compiler-IR.js

@@ -4535,11 +4535,11 @@ selector: "visitSuperSend:",
 protocol: "visiting",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRSend"],
-source: "visitSuperSend: anIRSend\x0a\x09self stream nextPutSupercallFor: anIRSend with: [\x0a\x09\x09self stream\x0a\x09\x09\x09nextPutAll: anIRSend receiver variable lookupAsJavaScriptSource, '.';\x0a\x09\x09\x09nextPutAll: anIRSend javaScriptSelector, '.call'.\x0a\x09\x09self\x0a\x09\x09\x09visitInstructionList: {anIRSend receiver}, anIRSend arguments\x0a\x09\x09\x09enclosedBetween: '(' and: ')' ]",
+source: "visitSuperSend: anIRSend\x0a\x09self stream nextPutSupercallFor: anIRSend with: [\x0a\x09\x09self stream\x0a\x09\x09\x09nextPutAll: anIRSend receiver variable lookupAsJavaScriptSource, '.';\x0a\x09\x09\x09nextPutAll: anIRSend javaScriptSelector, '.call'.\x0a\x09\x09self\x0a\x09\x09\x09visitInstructionList: {anIRSend receiver asReceiver}, anIRSend arguments\x0a\x09\x09\x09enclosedBetween: '(' and: ')' ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["nextPutSupercallFor:with:", "stream", "nextPutAll:", ",", "lookupAsJavaScriptSource", "variable", "receiver", "javaScriptSelector", "visitInstructionList:enclosedBetween:and:", "arguments"]
+messageSends: ["nextPutSupercallFor:with:", "stream", "nextPutAll:", ",", "lookupAsJavaScriptSource", "variable", "receiver", "javaScriptSelector", "visitInstructionList:enclosedBetween:and:", "asReceiver", "arguments"]
 }, function ($methodClass){ return function (anIRSend){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -4574,7 +4574,7 @@ $7=$recv($recv(anIRSend)._javaScriptSelector()).__comma(".call");
 $ctx2.sendIdx[","]=2;
 //>>excludeEnd("ctx");
 $recv($2)._nextPutAll_($7);
-return $self._visitInstructionList_enclosedBetween_and_($recv([$recv(anIRSend)._receiver()]).__comma($recv(anIRSend)._arguments()),"(",")");
+return $self._visitInstructionList_enclosedBetween_and_($recv([$recv($recv(anIRSend)._receiver())._asReceiver()]).__comma($recv(anIRSend)._arguments()),"(",")");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
 //>>excludeEnd("ctx");

+ 1 - 1
lang/src/Compiler-IR.st

@@ -1097,7 +1097,7 @@ visitSuperSend: anIRSend
 			nextPutAll: anIRSend receiver variable lookupAsJavaScriptSource, '.';
 			nextPutAll: anIRSend javaScriptSelector, '.call'.
 		self
-			visitInstructionList: {anIRSend receiver}, anIRSend arguments
+			visitInstructionList: {anIRSend receiver asReceiver}, anIRSend arguments
 			enclosedBetween: '(' and: ')' ]
 ! !
 

+ 0 - 18
lang/src/Compiler-Semantic.js

@@ -1665,24 +1665,6 @@ $core.addClass("SuperVar", $globals.PseudoVar, [], "Compiler-Semantic");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.SuperVar.comment="I am a 'super' pseudo variable.";
 //>>excludeEnd("ide");
-$core.addMethod(
-$core.method({
-selector: "alias",
-protocol: "accessing",
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "alias\x0a\x09^ '$self'",
-referencedClasses: [],
-//>>excludeEnd("ide");
-pragmas: [],
-messageSends: []
-}, function ($methodClass){ return function (){
-var self=this,$self=this;
-return "$self";
-
-}; }),
-$globals.SuperVar);
-
 $core.addMethod(
 $core.method({
 selector: "isSuper",

+ 0 - 4
lang/src/Compiler-Semantic.st

@@ -407,10 +407,6 @@ I am a 'super' pseudo variable.!
 
 !SuperVar methodsFor: 'accessing'!
 
-alias
-	^ '$self'
-!
-
 lookupAsJavaScriptSource
 	^ '($methodClass.superclass||$boot.nilAsClass).fn.prototype'
 ! !