Selaa lähdekoodia

IRClosure/IRMethod refactoring

Nicolas Petton 11 vuotta sitten
vanhempi
commit
04a8ef36fc
3 muutettua tiedostoa jossa 110 lisäystä ja 285 poistoa
  1. 41 107
      js/Compiler-IR.deploy.js
  2. 55 146
      js/Compiler-IR.js
  3. 14 32
      st/Compiler-IR.st

+ 41 - 107
js/Compiler-IR.deploy.js

@@ -849,20 +849,7 @@ smalltalk.IRScopedInstruction);
 
 
 
-smalltalk.addClass('IRClosure', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler-IR');
-smalltalk.addMethod(
-"_accept_",
-smalltalk.method({
-selector: "accept:",
-fn: function (aVisitor){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(aVisitor)._visitIRClosure_(self);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRClosure)})}
-}),
-smalltalk.IRClosure);
-
+smalltalk.addClass('IRClosureInstruction', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler-IR');
 smalltalk.addMethod(
 "_arguments",
 smalltalk.method({
@@ -877,9 +864,9 @@ $1=[];
 $1=$2;
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.IRClosure)})}
+}, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.IRClosureInstruction)})}
 }),
-smalltalk.IRClosure);
+smalltalk.IRClosureInstruction);
 
 smalltalk.addMethod(
 "_arguments_",
@@ -888,20 +875,9 @@ selector: "arguments:",
 fn: function (aCollection){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@arguments"]=aCollection;
-return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection}, smalltalk.IRClosure)})}
+return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection}, smalltalk.IRClosureInstruction)})}
 }),
-smalltalk.IRClosure);
-
-smalltalk.addMethod(
-"_isClosure",
-smalltalk.method({
-selector: "isClosure",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return true;
-}, function($ctx1) {$ctx1.fill(self,"isClosure",{}, smalltalk.IRClosure)})}
-}),
-smalltalk.IRClosure);
+smalltalk.IRClosureInstruction);
 
 smalltalk.addMethod(
 "_locals",
@@ -917,9 +893,9 @@ return smalltalk.withContext(function($ctx2) {
return _st(each)._name();
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"locals",{}, smalltalk.IRClosure)})}
+}, function($ctx1) {$ctx1.fill(self,"locals",{}, smalltalk.IRClosureInstruction)})}
 }),
-smalltalk.IRClosure);
+smalltalk.IRClosureInstruction);
 
 smalltalk.addMethod(
 "_scope_",
@@ -929,22 +905,9 @@ fn: function (aScope){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
 _st(aScope)._instruction_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.IRClosure)})}
+return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.IRClosureInstruction)})}
 }),
-smalltalk.IRClosure);
-
-smalltalk.addMethod(
-"_sequence",
-smalltalk.method({
-selector: "sequence",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st(self)._instructions())._last();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"sequence",{}, smalltalk.IRClosure)})}
-}),
-smalltalk.IRClosure);
+smalltalk.IRClosureInstruction);
 
 smalltalk.addMethod(
 "_tempDeclarations",
@@ -957,13 +920,13 @@ $1=_st(_st(self)._instructions())._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
return _st(each)._isTempDeclaration();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{}, smalltalk.IRClosure)})}
+}, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{}, smalltalk.IRClosureInstruction)})}
 }),
-smalltalk.IRClosure);
+smalltalk.IRClosureInstruction);
 
 
 
-smalltalk.addClass('IRMethod', smalltalk.IRScopedInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'arguments', 'internalVariables'], 'Compiler-IR');
+smalltalk.addClass('IRClosure', smalltalk.IRClosureInstruction, [], 'Compiler-IR');
 smalltalk.addMethod(
 "_accept_",
 smalltalk.method({
@@ -971,33 +934,49 @@ selector: "accept:",
 fn: function (aVisitor){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(aVisitor)._visitIRMethod_(self);
+$1=_st(aVisitor)._visitIRClosure_(self);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRMethod)})}
+}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRClosure)})}
 }),
-smalltalk.IRMethod);
+smalltalk.IRClosure);
 
 smalltalk.addMethod(
-"_arguments",
+"_isClosure",
 smalltalk.method({
-selector: "arguments",
+selector: "isClosure",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return true;
+}, function($ctx1) {$ctx1.fill(self,"isClosure",{}, smalltalk.IRClosure)})}
+}),
+smalltalk.IRClosure);
+
+smalltalk.addMethod(
+"_sequence",
+smalltalk.method({
+selector: "sequence",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=self["@arguments"];
+$1=_st(_st(self)._instructions())._last();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.IRMethod)})}
+}, function($ctx1) {$ctx1.fill(self,"sequence",{}, smalltalk.IRClosure)})}
 }),
-smalltalk.IRMethod);
+smalltalk.IRClosure);
+
+
 
+smalltalk.addClass('IRMethod', smalltalk.IRClosureInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'internalVariables'], 'Compiler-IR');
 smalltalk.addMethod(
-"_arguments_",
+"_accept_",
 smalltalk.method({
-selector: "arguments:",
-fn: function (aCollection){
+selector: "accept:",
+fn: function (aVisitor){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@arguments"]=aCollection;
-return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection}, smalltalk.IRMethod)})}
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(aVisitor)._visitIRMethod_(self);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRMethod)})}
 }),
 smalltalk.IRMethod);
 
@@ -1055,24 +1034,6 @@ return smalltalk.withContext(function($ctx1) { 
return true;
 }),
 smalltalk.IRMethod);
 
-smalltalk.addMethod(
-"_locals",
-smalltalk.method({
-selector: "locals",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
-$2=_st(_st(self)._arguments())._copy();
-_st($2)._addAll_(_st(_st(self)._tempDeclarations())._collect_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(each)._name();
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
-$3=_st($2)._yourself();
-$1=$3;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"locals",{}, smalltalk.IRMethod)})}
-}),
-smalltalk.IRMethod);
-
 smalltalk.addMethod(
 "_messageSends",
 smalltalk.method({
@@ -1110,18 +1071,6 @@ return $1;
 }),
 smalltalk.IRMethod);
 
-smalltalk.addMethod(
-"_scope_",
-smalltalk.method({
-selector: "scope:",
-fn: function (aScope){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
-_st(aScope)._instruction_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.IRMethod)})}
-}),
-smalltalk.IRMethod);
-
 smalltalk.addMethod(
 "_selector",
 smalltalk.method({
@@ -1194,21 +1143,6 @@ return self}, function($ctx1) {$ctx1.fill(self,"superSends:",{aCollection:aColle
 }),
 smalltalk.IRMethod);
 
-smalltalk.addMethod(
-"_tempDeclarations",
-smalltalk.method({
-selector: "tempDeclarations",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st(self)._instructions())._select_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(each)._isTempDeclaration();
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{}, smalltalk.IRMethod)})}
-}),
-smalltalk.IRMethod);
-
 smalltalk.addMethod(
 "_theClass",
 smalltalk.method({

+ 55 - 146
js/Compiler-IR.js

@@ -1106,25 +1106,7 @@ smalltalk.IRScopedInstruction);
 
 
 
-smalltalk.addClass('IRClosure', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler-IR');
-smalltalk.addMethod(
-"_accept_",
-smalltalk.method({
-selector: "accept:",
-category: 'visiting',
-fn: function (aVisitor){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(aVisitor)._visitIRClosure_(self);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRClosure)})},
-args: ["aVisitor"],
-source: "accept: aVisitor\x0a\x09^ aVisitor visitIRClosure: self",
-messageSends: ["visitIRClosure:"],
-referencedClasses: []
-}),
-smalltalk.IRClosure);
-
+smalltalk.addClass('IRClosureInstruction', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler-IR');
 smalltalk.addMethod(
 "_arguments",
 smalltalk.method({
@@ -1140,13 +1122,13 @@ $1=[];
 $1=$2;
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.IRClosure)})},
+}, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.IRClosureInstruction)})},
 args: [],
 source: "arguments\x0a\x09^ arguments ifNil: [ #() ]",
 messageSends: ["ifNil:"],
 referencedClasses: []
 }),
-smalltalk.IRClosure);
+smalltalk.IRClosureInstruction);
 
 smalltalk.addMethod(
 "_arguments_",
@@ -1156,29 +1138,13 @@ category: 'accessing',
 fn: function (aCollection){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@arguments"]=aCollection;
-return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection}, smalltalk.IRClosure)})},
+return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection}, smalltalk.IRClosureInstruction)})},
 args: ["aCollection"],
 source: "arguments: aCollection\x0a\x09arguments := aCollection",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.IRClosure);
-
-smalltalk.addMethod(
-"_isClosure",
-smalltalk.method({
-selector: "isClosure",
-category: 'testing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return true;
-}, function($ctx1) {$ctx1.fill(self,"isClosure",{}, smalltalk.IRClosure)})},
-args: [],
-source: "isClosure\x0a\x09^ true",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.IRClosure);
+smalltalk.IRClosureInstruction);
 
 smalltalk.addMethod(
 "_locals",
@@ -1195,13 +1161,13 @@ return smalltalk.withContext(function($ctx2) {
return _st(each)._name();
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"locals",{}, smalltalk.IRClosure)})},
+}, function($ctx1) {$ctx1.fill(self,"locals",{}, smalltalk.IRClosureInstruction)})},
 args: [],
 source: "locals\x0a\x09^ self arguments copy\x0a    \x09addAll: (self tempDeclarations collect: [ :each | each name ]); \x0a        yourself",
 messageSends: ["addAll:", "collect:", "name", "tempDeclarations", "copy", "arguments", "yourself"],
 referencedClasses: []
 }),
-smalltalk.IRClosure);
+smalltalk.IRClosureInstruction);
 
 smalltalk.addMethod(
 "_scope_",
@@ -1212,31 +1178,13 @@ fn: function (aScope){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
 _st(aScope)._instruction_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.IRClosure)})},
+return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.IRClosureInstruction)})},
 args: ["aScope"],
 source: "scope: aScope\x0a\x09super scope: aScope.\x0a\x09aScope instruction: self",
 messageSends: ["scope:", "instruction:"],
 referencedClasses: []
 }),
-smalltalk.IRClosure);
-
-smalltalk.addMethod(
-"_sequence",
-smalltalk.method({
-selector: "sequence",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st(self)._instructions())._last();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"sequence",{}, smalltalk.IRClosure)})},
-args: [],
-source: "sequence\x0a\x09^ self instructions last",
-messageSends: ["last", "instructions"],
-referencedClasses: []
-}),
-smalltalk.IRClosure);
+smalltalk.IRClosureInstruction);
 
 smalltalk.addMethod(
 "_tempDeclarations",
@@ -1250,18 +1198,17 @@ $1=_st(_st(self)._instructions())._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
return _st(each)._isTempDeclaration();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{}, smalltalk.IRClosure)})},
+}, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{}, smalltalk.IRClosureInstruction)})},
 args: [],
 source: "tempDeclarations\x0a\x09^ self instructions select: [ :each | \x0a    \x09each isTempDeclaration ]",
 messageSends: ["select:", "isTempDeclaration", "instructions"],
 referencedClasses: []
 }),
-smalltalk.IRClosure);
+smalltalk.IRClosureInstruction);
 
 
 
-smalltalk.addClass('IRMethod', smalltalk.IRScopedInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'arguments', 'internalVariables'], 'Compiler-IR');
-smalltalk.IRMethod.comment="I am a method instruction"
+smalltalk.addClass('IRClosure', smalltalk.IRClosureInstruction, [], 'Compiler-IR');
 smalltalk.addMethod(
 "_accept_",
 smalltalk.method({
@@ -1270,46 +1217,68 @@ category: 'visiting',
 fn: function (aVisitor){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(aVisitor)._visitIRMethod_(self);
+$1=_st(aVisitor)._visitIRClosure_(self);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRMethod)})},
+}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRClosure)})},
 args: ["aVisitor"],
-source: "accept: aVisitor\x0a\x09^ aVisitor visitIRMethod: self",
-messageSends: ["visitIRMethod:"],
+source: "accept: aVisitor\x0a\x09^ aVisitor visitIRClosure: self",
+messageSends: ["visitIRClosure:"],
 referencedClasses: []
 }),
-smalltalk.IRMethod);
+smalltalk.IRClosure);
 
 smalltalk.addMethod(
-"_arguments",
+"_isClosure",
 smalltalk.method({
-selector: "arguments",
+selector: "isClosure",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return true;
+}, function($ctx1) {$ctx1.fill(self,"isClosure",{}, smalltalk.IRClosure)})},
+args: [],
+source: "isClosure\x0a\x09^ true",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.IRClosure);
+
+smalltalk.addMethod(
+"_sequence",
+smalltalk.method({
+selector: "sequence",
 category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=self["@arguments"];
+$1=_st(_st(self)._instructions())._last();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.IRMethod)})},
+}, function($ctx1) {$ctx1.fill(self,"sequence",{}, smalltalk.IRClosure)})},
 args: [],
-source: "arguments\x0a\x09^ arguments",
-messageSends: [],
+source: "sequence\x0a\x09^ self instructions last",
+messageSends: ["last", "instructions"],
 referencedClasses: []
 }),
-smalltalk.IRMethod);
+smalltalk.IRClosure);
+
 
+
+smalltalk.addClass('IRMethod', smalltalk.IRClosureInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'internalVariables'], 'Compiler-IR');
+smalltalk.IRMethod.comment="I am a method instruction"
 smalltalk.addMethod(
-"_arguments_",
+"_accept_",
 smalltalk.method({
-selector: "arguments:",
-category: 'accessing',
-fn: function (aCollection){
+selector: "accept:",
+category: 'visiting',
+fn: function (aVisitor){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@arguments"]=aCollection;
-return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection}, smalltalk.IRMethod)})},
-args: ["aCollection"],
-source: "arguments: aCollection\x0a\x09arguments := aCollection",
-messageSends: [],
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(aVisitor)._visitIRMethod_(self);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRMethod)})},
+args: ["aVisitor"],
+source: "accept: aVisitor\x0a\x09^ aVisitor visitIRMethod: self",
+messageSends: ["visitIRMethod:"],
 referencedClasses: []
 }),
 smalltalk.IRMethod);
@@ -1388,29 +1357,6 @@ referencedClasses: []
 }),
 smalltalk.IRMethod);
 
-smalltalk.addMethod(
-"_locals",
-smalltalk.method({
-selector: "locals",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
-$2=_st(_st(self)._arguments())._copy();
-_st($2)._addAll_(_st(_st(self)._tempDeclarations())._collect_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(each)._name();
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
-$3=_st($2)._yourself();
-$1=$3;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"locals",{}, smalltalk.IRMethod)})},
-args: [],
-source: "locals\x0a\x09^ self arguments copy\x0a    \x09addAll: (self tempDeclarations collect: [ :each | each name ]); \x0a        yourself",
-messageSends: ["addAll:", "collect:", "name", "tempDeclarations", "copy", "arguments", "yourself"],
-referencedClasses: []
-}),
-smalltalk.IRMethod);
-
 smalltalk.addMethod(
 "_messageSends",
 smalltalk.method({
@@ -1463,23 +1409,6 @@ referencedClasses: []
 }),
 smalltalk.IRMethod);
 
-smalltalk.addMethod(
-"_scope_",
-smalltalk.method({
-selector: "scope:",
-category: 'accessing',
-fn: function (aScope){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
-_st(aScope)._instruction_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.IRMethod)})},
-args: ["aScope"],
-source: "scope: aScope\x0a\x09super scope: aScope.\x0a\x09aScope instruction: self",
-messageSends: ["scope:", "instruction:"],
-referencedClasses: []
-}),
-smalltalk.IRMethod);
-
 smalltalk.addMethod(
 "_selector",
 smalltalk.method({
@@ -1582,26 +1511,6 @@ referencedClasses: []
 }),
 smalltalk.IRMethod);
 
-smalltalk.addMethod(
-"_tempDeclarations",
-smalltalk.method({
-selector: "tempDeclarations",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st(self)._instructions())._select_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(each)._isTempDeclaration();
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{}, smalltalk.IRMethod)})},
-args: [],
-source: "tempDeclarations\x0a\x09^ self instructions select: [ :each | \x0a    \x09each isTempDeclaration ]",
-messageSends: ["select:", "isTempDeclaration", "instructions"],
-referencedClasses: []
-}),
-smalltalk.IRMethod);
-
 smalltalk.addMethod(
 "_theClass",
 smalltalk.method({

+ 14 - 32
st/Compiler-IR.st

@@ -402,11 +402,11 @@ scope: aScope
 	scope := aScope
 ! !
 
-IRScopedInstruction subclass: #IRClosure
+IRScopedInstruction subclass: #IRClosureInstruction
 	instanceVariableNames: 'arguments'
 	package: 'Compiler-IR'!
 
-!IRClosure methodsFor: 'accessing'!
+!IRClosureInstruction methodsFor: 'accessing'!
 
 arguments
 	^ arguments ifNil: [ #() ]
@@ -427,15 +427,21 @@ scope: aScope
 	aScope instruction: self
 !
 
-sequence
-	^ self instructions last
-!
-
 tempDeclarations
 	^ self instructions select: [ :each | 
     	each isTempDeclaration ]
 ! !
 
+IRClosureInstruction subclass: #IRClosure
+	instanceVariableNames: ''
+	package: 'Compiler-IR'!
+
+!IRClosure methodsFor: 'accessing'!
+
+sequence
+	^ self instructions last
+! !
+
 !IRClosure methodsFor: 'testing'!
 
 isClosure
@@ -448,22 +454,14 @@ accept: aVisitor
 	^ aVisitor visitIRClosure: self
 ! !
 
-IRScopedInstruction subclass: #IRMethod
-	instanceVariableNames: 'theClass source selector classReferences messageSends superSends arguments internalVariables'
+IRClosureInstruction subclass: #IRMethod
+	instanceVariableNames: 'theClass source selector classReferences messageSends superSends internalVariables'
 	package: 'Compiler-IR'!
 !IRMethod commentStamp!
 I am a method instruction!
 
 !IRMethod methodsFor: 'accessing'!
 
-arguments
-	^ arguments
-!
-
-arguments: aCollection
-	arguments := aCollection
-!
-
 classReferences
 	^ classReferences
 !
@@ -480,12 +478,6 @@ isMethod
 	^ true
 !
 
-locals
-	^ self arguments copy
-    	addAll: (self tempDeclarations collect: [ :each | each name ]); 
-        yourself
-!
-
 messageSends
 	^ messageSends
 !
@@ -498,11 +490,6 @@ method
 	^ self
 !
 
-scope: aScope
-	super scope: aScope.
-	aScope instruction: self
-!
-
 selector
 	^ selector
 !
@@ -527,11 +514,6 @@ superSends: aCollection
 	superSends := aCollection
 !
 
-tempDeclarations
-	^ self instructions select: [ :each | 
-    	each isTempDeclaration ]
-!
-
 theClass
 	^ theClass
 !