Browse Source

IRInstruction / IRVisitor => DagNode / DagVisitor. Part 1.

Herbert Vojčík 7 years ago
parent
commit
d54b906829
4 changed files with 276 additions and 385 deletions
  1. 126 211
      src/Compiler-IR.js
  2. 48 63
      src/Compiler-IR.st
  3. 75 83
      src/Compiler-Inlining.js
  4. 27 28
      src/Compiler-Inlining.st

File diff suppressed because it is too large
+ 126 - 211
src/Compiler-IR.js


+ 48 - 63
src/Compiler-IR.st

@@ -255,8 +255,8 @@ visitVariableNode: aNode
 		yourself
 ! !
 
-Object subclass: #IRInstruction
-	instanceVariableNames: 'parent instructions'
+DagParentNode subclass: #IRInstruction
+	instanceVariableNames: 'parent'
 	package: 'Compiler-IR'!
 !IRInstruction commentStamp!
 I am the abstract root class of the IR (intermediate representation) instructions class hierarchy.
@@ -264,10 +264,6 @@ The IR graph is used to emit JavaScript code using a JSStream.!
 
 !IRInstruction methodsFor: 'accessing'!
 
-instructions
-	^ instructions ifNil: [ instructions := OrderedCollection new ]
-!
-
 method
 	^ self parent method
 !
@@ -289,7 +285,7 @@ scope
 
 add: anObject
 	anObject parent: self.
-	^ self instructions add: anObject
+	^ self dagChildren add: anObject
 !
 
 remove
@@ -297,13 +293,13 @@ remove
 !
 
 remove: anIRInstruction
-	self instructions remove: anIRInstruction
+	self dagChildren remove: anIRInstruction
 !
 
 replace: anIRInstruction with: anotherIRInstruction
 	anotherIRInstruction parent: self.
-	self instructions
-		at: (self instructions indexOf: anIRInstruction)
+	self dagChildren
+		at: (self dagChildren indexOf: anIRInstruction)
 		put: anotherIRInstruction
 !
 
@@ -357,12 +353,6 @@ needsBoxingAsReceiver
 	^ true
 ! !
 
-!IRInstruction methodsFor: 'visiting'!
-
-accept: aVisitor
-	^ aVisitor visitIRInstruction: self
-! !
-
 !IRInstruction class methodsFor: 'instance creation'!
 
 on: aBuilder
@@ -378,16 +368,16 @@ IRInstruction subclass: #IRAssignment
 !IRAssignment methodsFor: 'accessing'!
 
 left
-	^ self instructions first
+	^ self dagChildren first
 !
 
 right
-	^ self instructions last
+	^ self dagChildren last
 ! !
 
 !IRAssignment methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRAssignment: self
 ! !
 
@@ -397,7 +387,7 @@ IRInstruction subclass: #IRDynamicArray
 
 !IRDynamicArray methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRDynamicArray: self
 ! !
 
@@ -407,7 +397,7 @@ IRInstruction subclass: #IRDynamicDictionary
 
 !IRDynamicDictionary methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRDynamicDictionary: self
 ! !
 
@@ -459,7 +449,7 @@ scope: aScope
 !
 
 tempDeclarations
-	^ self instructions select: [ :each |
+	^ self dagChildren select: [ :each |
 		each isTempDeclaration ]
 ! !
 
@@ -470,7 +460,7 @@ IRClosureInstruction subclass: #IRClosure
 !IRClosure methodsFor: 'accessing'!
 
 sequence
-	^ self instructions last
+	^ self dagChildren last
 ! !
 
 !IRClosure methodsFor: 'testing'!
@@ -481,7 +471,7 @@ isClosure
 
 !IRClosure methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRClosure: self
 ! !
 
@@ -553,7 +543,7 @@ isMethod
 
 !IRMethod methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRMethod: self
 ! !
 
@@ -566,7 +556,7 @@ I am a local return instruction.!
 !IRReturn methodsFor: 'accessing'!
 
 expression
-	^ self instructions single
+	^ self dagChildren single
 !
 
 scope
@@ -597,7 +587,7 @@ isReturn
 
 !IRReturn methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRReturn: self
 ! !
 
@@ -615,7 +605,7 @@ isBlockReturn
 
 !IRBlockReturn methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRBlockReturn: self
 ! !
 
@@ -636,7 +626,7 @@ isLocalReturn
 
 !IRNonLocalReturn methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRNonLocalReturn: self
 ! !
 
@@ -662,7 +652,7 @@ isTempDeclaration
 
 !IRTempDeclaration methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRTempDeclaration: self
 ! !
 
@@ -675,7 +665,7 @@ I am a message send instruction.!
 !IRSend methodsFor: 'accessing'!
 
 arguments
-	^ self instructions allButFirst
+	^ self dagChildren allButFirst
 !
 
 index
@@ -687,7 +677,7 @@ index: anInteger
 !
 
 receiver
-	^ self instructions first
+	^ self dagChildren first
 !
 
 selector
@@ -712,7 +702,7 @@ isSuperSend
 
 !IRSend methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRSend: self
 ! !
 
@@ -728,7 +718,7 @@ isSequence
 
 !IRSequence methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRSequence: self
 ! !
 
@@ -738,7 +728,7 @@ IRSequence subclass: #IRBlockSequence
 
 !IRBlockSequence methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRBlockSequence: self
 ! !
 
@@ -766,7 +756,7 @@ needsBoxingAsReceiver
 
 !IRValue methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRValue: self
 ! !
 
@@ -798,7 +788,7 @@ needsBoxingAsReceiver
 
 !IRVariable methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRVariable: self
 ! !
 
@@ -818,22 +808,22 @@ source: aString
 
 !IRVerbatim methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRVerbatim: self
 ! !
 
-Object subclass: #IRVisitor
+PathDagVisitor subclass: #IRVisitor
 	instanceVariableNames: ''
 	package: 'Compiler-IR'!
 
 !IRVisitor methodsFor: 'visiting'!
 
-visit: anIRInstruction
-	^ anIRInstruction accept: self
+visitDagNode: aNode
+	^ self visitDagNodeVariantSimple: aNode
 !
 
 visitIRAssignment: anIRAssignment
-	^ self visitIRInstruction: anIRAssignment
+	^ self visitDagNode: anIRAssignment
 !
 
 visitIRBlockReturn: anIRBlockReturn
@@ -845,15 +835,15 @@ visitIRBlockSequence: anIRBlockSequence
 !
 
 visitIRClosure: anIRClosure
-	^ self visitIRInstruction: anIRClosure
+	^ self visitDagNode: anIRClosure
 !
 
 visitIRDynamicArray: anIRDynamicArray
-	^ self visitIRInstruction: anIRDynamicArray
+	^ self visitDagNode: anIRDynamicArray
 !
 
 visitIRDynamicDictionary: anIRDynamicDictionary
-	^ self visitIRInstruction: anIRDynamicDictionary
+	^ self visitDagNode: anIRDynamicDictionary
 !
 
 visitIRInlinedClosure: anIRInlinedClosure
@@ -864,49 +854,44 @@ visitIRInlinedSequence: anIRInlinedSequence
 	^ self visitIRSequence: anIRInlinedSequence
 !
 
-visitIRInstruction: anIRInstruction
-	anIRInstruction instructions do: [ :each | self visit: each ].
-	^ anIRInstruction
-!
-
 visitIRMethod: anIRMethod
-	^ self visitIRInstruction: anIRMethod
+	^ self visitDagNode: anIRMethod
 !
 
 visitIRNonLocalReturn: anIRNonLocalReturn
-	^ self visitIRInstruction: anIRNonLocalReturn
+	^ self visitDagNode: anIRNonLocalReturn
 !
 
 visitIRNonLocalReturnHandling: anIRNonLocalReturnHandling
-	^ self visitIRInstruction: anIRNonLocalReturnHandling
+	^ self visitDagNode: anIRNonLocalReturnHandling
 !
 
 visitIRReturn: anIRReturn
-	^ self visitIRInstruction: anIRReturn
+	^ self visitDagNode: anIRReturn
 !
 
 visitIRSend: anIRSend
-	^ self visitIRInstruction: anIRSend
+	^ self visitDagNode: anIRSend
 !
 
 visitIRSequence: anIRSequence
-	^ self visitIRInstruction: anIRSequence
+	^ self visitDagNode: anIRSequence
 !
 
 visitIRTempDeclaration: anIRTempDeclaration
-	^ self visitIRInstruction: anIRTempDeclaration
+	^ self visitDagNode: anIRTempDeclaration
 !
 
 visitIRValue: anIRValue
-	^ self visitIRInstruction: anIRValue
+	^ self visitDagNode: anIRValue
 !
 
 visitIRVariable: anIRVariable
-	^ self visitIRInstruction: anIRVariable
+	^ self visitDagNode: anIRVariable
 !
 
 visitIRVerbatim: anIRVerbatim
-	^ self visitIRInstruction: anIRVerbatim
+	^ self visitDagNode: anIRVerbatim
 ! !
 
 IRVisitor subclass: #IRJSTranslator
@@ -963,13 +948,13 @@ visitIRClosure: anIRClosure
 
 visitIRDynamicArray: anIRDynamicArray
 	self
-		visitInstructionList: anIRDynamicArray instructions
+		visitInstructionList: anIRDynamicArray dagChildren
 		enclosedBetween: '[' and: ']'
 !
 
 visitIRDynamicDictionary: anIRDynamicDictionary
 	self
-		visitInstructionList: anIRDynamicDictionary instructions
+		visitInstructionList: anIRDynamicDictionary dagChildren
 		enclosedBetween: '$globals.HashedCollection._newFromPairs_([' and: '])'
 !
 
@@ -1017,7 +1002,7 @@ visitIRSend: anIRSend
 
 visitIRSequence: anIRSequence
 	self stream nextPutSequenceWith: [
-		anIRSequence instructions do: [ :each |
+		anIRSequence dagChildren do: [ :each |
 			self stream nextPutStatementWith: (self visit: each) ] ]
 !
 

+ 75 - 83
src/Compiler-Inlining.js

@@ -12,7 +12,7 @@ $globals.IRInlinedAssignment.comment="I represent an inlined assignment instruct
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
-selector: "accept:",
+selector: "acceptDagVisitor:",
 protocol: 'visiting',
 fn: function (aVisitor){
 var self=this;
@@ -21,12 +21,12 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 return $recv(aVisitor)._visitIRInlinedAssignment_(self);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedAssignment)});
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedAssignment)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aVisitor"],
-source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedAssignment: self",
+source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitIRInlinedAssignment: self",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["visitIRInlinedAssignment:"]
@@ -59,7 +59,7 @@ $globals.IRInlinedClosure.comment="I represent an inlined closure instruction.";
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
-selector: "accept:",
+selector: "acceptDagVisitor:",
 protocol: 'visiting',
 fn: function (aVisitor){
 var self=this;
@@ -69,12 +69,12 @@ return $core.withContext(function($ctx1) {
 $recv(aVisitor)._visitIRInlinedClosure_(self);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedClosure)});
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedClosure)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aVisitor"],
-source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedClosure: self",
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitIRInlinedClosure: self",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["visitIRInlinedClosure:"]
@@ -107,7 +107,7 @@ $globals.IRInlinedReturn.comment="I represent an inlined local return instructio
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
-selector: "accept:",
+selector: "acceptDagVisitor:",
 protocol: 'visiting',
 fn: function (aVisitor){
 var self=this;
@@ -116,12 +116,12 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 return $recv(aVisitor)._visitIRInlinedReturn_(self);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedReturn)});
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedReturn)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aVisitor"],
-source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedReturn: self",
+source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitIRInlinedReturn: self",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["visitIRInlinedReturn:"]
@@ -154,7 +154,7 @@ $globals.IRInlinedSend.comment="I am the abstract super class of inlined message
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
-selector: "accept:",
+selector: "acceptDagVisitor:",
 protocol: 'visiting',
 fn: function (aVisitor){
 var self=this;
@@ -164,12 +164,12 @@ return $core.withContext(function($ctx1) {
 $recv(aVisitor)._visitInlinedSend_(self);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedSend)});
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedSend)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aVisitor"],
-source: "accept: aVisitor\x0a\x09aVisitor visitInlinedSend: self",
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitInlinedSend: self",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["visitInlinedSend:"]
@@ -220,7 +220,7 @@ $globals.IRInlinedIfFalse.comment="I represent an inlined `#ifFalse:` message se
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
-selector: "accept:",
+selector: "acceptDagVisitor:",
 protocol: 'visiting',
 fn: function (aVisitor){
 var self=this;
@@ -230,12 +230,12 @@ return $core.withContext(function($ctx1) {
 $recv(aVisitor)._visitIRInlinedIfFalse_(self);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedIfFalse)});
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedIfFalse)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aVisitor"],
-source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfFalse: self",
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitIRInlinedIfFalse: self",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["visitIRInlinedIfFalse:"]
@@ -250,7 +250,7 @@ $globals.IRInlinedIfNilIfNotNil.comment="I represent an inlined `#ifNil:ifNotNil
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
-selector: "accept:",
+selector: "acceptDagVisitor:",
 protocol: 'visiting',
 fn: function (aVisitor){
 var self=this;
@@ -260,12 +260,12 @@ return $core.withContext(function($ctx1) {
 $recv(aVisitor)._visitIRInlinedIfNilIfNotNil_(self);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedIfNilIfNotNil)});
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedIfNilIfNotNil)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aVisitor"],
-source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfNilIfNotNil: self",
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitIRInlinedIfNilIfNotNil: self",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["visitIRInlinedIfNilIfNotNil:"]
@@ -350,7 +350,7 @@ $globals.IRInlinedIfTrue.comment="I represent an inlined `#ifTrue:` message send
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
-selector: "accept:",
+selector: "acceptDagVisitor:",
 protocol: 'visiting',
 fn: function (aVisitor){
 var self=this;
@@ -360,12 +360,12 @@ return $core.withContext(function($ctx1) {
 $recv(aVisitor)._visitIRInlinedIfTrue_(self);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedIfTrue)});
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedIfTrue)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aVisitor"],
-source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrue: self",
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrue: self",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["visitIRInlinedIfTrue:"]
@@ -380,7 +380,7 @@ $globals.IRInlinedIfTrueIfFalse.comment="I represent an inlined `#ifTrue:ifFalse
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
-selector: "accept:",
+selector: "acceptDagVisitor:",
 protocol: 'visiting',
 fn: function (aVisitor){
 var self=this;
@@ -390,12 +390,12 @@ return $core.withContext(function($ctx1) {
 $recv(aVisitor)._visitIRInlinedIfTrueIfFalse_(self);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedIfTrueIfFalse)});
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedIfTrueIfFalse)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aVisitor"],
-source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrueIfFalse: self",
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrueIfFalse: self",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["visitIRInlinedIfTrueIfFalse:"]
@@ -410,7 +410,7 @@ $globals.IRInlinedSequence.comment="I represent a (block) sequence inside an inl
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
-selector: "accept:",
+selector: "acceptDagVisitor:",
 protocol: 'visiting',
 fn: function (aVisitor){
 var self=this;
@@ -420,12 +420,12 @@ return $core.withContext(function($ctx1) {
 $recv(aVisitor)._visitIRInlinedSequence_(self);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedSequence)});
+}, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.IRInlinedSequence)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aVisitor"],
-source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedSequence: self",
+source: "acceptDagVisitor: aVisitor\x0a\x09aVisitor visitIRInlinedSequence: self",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["visitIRInlinedSequence:"]
@@ -694,7 +694,7 @@ $6=$recv($globals.IRReturn)._new();
 $recv($6)._scope_($recv(anIRNonLocalReturn)._scope());
 localReturn=$recv($6)._yourself();
 localReturn;
-$recv($recv(anIRNonLocalReturn)._instructions())._do_((function(each){
+$recv($recv(anIRNonLocalReturn)._dagChildren())._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -721,10 +721,10 @@ return $7;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 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 instructions do: [ :each |\x0a\x09\x09\x09localReturn add: each ].\x0a\x09\x09anIRNonLocalReturn replaceWith: localReturn.\x0a\x09\x09^ localReturn ].\x0a\x09^ super visitIRNonLocalReturn: 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",
 referencedClasses: ["IRReturn"],
 //>>excludeEnd("ide");
-messageSends: ["ifTrue:", "canInlineNonLocalReturns", "scope", "removeNonLocalReturn:", "methodScope", "scope:", "new", "yourself", "do:", "instructions", "add:", "replaceWith:", "visitIRNonLocalReturn:"]
+messageSends: ["ifTrue:", "canInlineNonLocalReturns", "scope", "removeNonLocalReturn:", "methodScope", "scope:", "new", "yourself", "do:", "dagChildren", "add:", "replaceWith:", "visitIRNonLocalReturn:"]
 }),
 $globals.IRInliner);
 
@@ -907,15 +907,7 @@ return $recv($recv(each)._name())._asVariableName();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
 //>>excludeEnd("ctx");
 })));
-$recv($recv(anIRInlinedClosure)._instructions())._do_((function(each){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return self._visit_(each);
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
-//>>excludeEnd("ctx");
-}));
+self._visitAll_($recv(anIRInlinedClosure)._dagChildren());
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:",{anIRInlinedClosure:anIRInlinedClosure},$globals.IRInliningJSTranslator)});
@@ -923,10 +915,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRInlinedClosure"],
-source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09self stream nextPutVars: (anIRInlinedClosure tempDeclarations collect: [ :each |\x0a\x09\x09each name asVariableName ]).\x0a\x09anIRInlinedClosure instructions do: [ :each |\x0a\x09\x09self visit: each ]",
+source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09self stream nextPutVars: (anIRInlinedClosure tempDeclarations collect: [ :each |\x0a\x09\x09each name asVariableName ]).\x0a\x09self visitAll: anIRInlinedClosure dagChildren",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["nextPutVars:", "stream", "collect:", "tempDeclarations", "asVariableName", "name", "do:", "instructions", "visit:"]
+messageSends: ["nextPutVars:", "stream", "collect:", "tempDeclarations", "asVariableName", "name", "visitAll:", "dagChildren"]
 }),
 $globals.IRInliningJSTranslator);
 
@@ -956,9 +948,9 @@ $recv($2)._nextPutAll_("!$core.assert(");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["nextPutAll:"]=1;
 //>>excludeEnd("ctx");
-$4=$recv(anIRInlinedIfFalse)._instructions();
+$4=$recv(anIRInlinedIfFalse)._dagChildren();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx2.sendIdx["instructions"]=1;
+$ctx2.sendIdx["dagChildren"]=1;
 //>>excludeEnd("ctx");
 $3=$recv($4)._first();
 self._visit_($3);
@@ -973,7 +965,7 @@ return $recv(self._stream())._nextPutAll_(")");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._visit_($recv($recv(anIRInlinedIfFalse)._instructions())._last());
+return self._visit_($recv($recv(anIRInlinedIfFalse)._dagChildren())._last());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
 //>>excludeEnd("ctx");
@@ -985,10 +977,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRInlinedIfFalse"],
-source: "visitIRInlinedIfFalse: anIRInlinedIfFalse\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '!$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfFalse instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfFalse instructions last ]",
+source: "visitIRInlinedIfFalse: anIRInlinedIfFalse\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '!$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfFalse dagChildren first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfFalse dagChildren last ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["nextPutIf:then:", "stream", "nextPutAll:", "visit:", "first", "instructions", "last"]
+messageSends: ["nextPutIf:then:", "stream", "nextPutAll:", "visit:", "first", "dagChildren", "last"]
 }),
 $globals.IRInliningJSTranslator);
 
@@ -1029,9 +1021,9 @@ $recv($2)._nextPutAll_($3);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["nextPutAll:"]=1;
 //>>excludeEnd("ctx");
-$6=$recv(anIRInlinedIfNilIfNotNil)._instructions();
+$6=$recv(anIRInlinedIfNilIfNotNil)._dagChildren();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx2.sendIdx["instructions"]=1;
+$ctx2.sendIdx["dagChildren"]=1;
 //>>excludeEnd("ctx");
 $5=$recv($6)._first();
 self._visit_($5);
@@ -1051,9 +1043,9 @@ return $recv($7)._nextPutAll_($8);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-$10=$recv(anIRInlinedIfNilIfNotNil)._instructions();
+$10=$recv(anIRInlinedIfNilIfNotNil)._dagChildren();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx2.sendIdx["instructions"]=2;
+$ctx2.sendIdx["dagChildren"]=2;
 //>>excludeEnd("ctx");
 $9=$recv($10)._second();
 return self._visit_($9);
@@ -1067,7 +1059,7 @@ $ctx2.sendIdx["visit:"]=2;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._visit_($recv($recv(anIRInlinedIfNilIfNotNil)._instructions())._third());
+return self._visit_($recv($recv(anIRInlinedIfNilIfNotNil)._dagChildren())._third());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
 //>>excludeEnd("ctx");
@@ -1079,10 +1071,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRInlinedIfNilIfNotNil"],
-source: "visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil\x0a\x09self stream\x0a\x09\x09nextPutIf: [\x0a\x09\x09\x09| recvVarName |\x0a\x09\x09\x09recvVarName := anIRInlinedIfNilIfNotNil receiverInternalVariableName.\x0a\x09\x09\x09self stream nextPutAll: '(', recvVarName, ' = '.\x0a\x09\x09\x09self visit: anIRInlinedIfNilIfNotNil instructions first.\x0a\x09\x09\x09self stream nextPutAll: ') == null || ', recvVarName, '.isNil' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfNilIfNotNil instructions second ]\x0a\x09\x09else: [ self visit: anIRInlinedIfNilIfNotNil instructions third ]",
+source: "visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil\x0a\x09self stream\x0a\x09\x09nextPutIf: [\x0a\x09\x09\x09| recvVarName |\x0a\x09\x09\x09recvVarName := anIRInlinedIfNilIfNotNil receiverInternalVariableName.\x0a\x09\x09\x09self stream nextPutAll: '(', recvVarName, ' = '.\x0a\x09\x09\x09self visit: anIRInlinedIfNilIfNotNil dagChildren first.\x0a\x09\x09\x09self stream nextPutAll: ') == null || ', recvVarName, '.isNil' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfNilIfNotNil dagChildren second ]\x0a\x09\x09else: [ self visit: anIRInlinedIfNilIfNotNil dagChildren third ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["nextPutIf:then:else:", "stream", "receiverInternalVariableName", "nextPutAll:", ",", "visit:", "first", "instructions", "second", "third"]
+messageSends: ["nextPutIf:then:else:", "stream", "receiverInternalVariableName", "nextPutAll:", ",", "visit:", "first", "dagChildren", "second", "third"]
 }),
 $globals.IRInliningJSTranslator);
 
@@ -1112,9 +1104,9 @@ $recv($2)._nextPutAll_("$core.assert(");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["nextPutAll:"]=1;
 //>>excludeEnd("ctx");
-$4=$recv(anIRInlinedIfTrue)._instructions();
+$4=$recv(anIRInlinedIfTrue)._dagChildren();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx2.sendIdx["instructions"]=1;
+$ctx2.sendIdx["dagChildren"]=1;
 //>>excludeEnd("ctx");
 $3=$recv($4)._first();
 self._visit_($3);
@@ -1129,7 +1121,7 @@ return $recv(self._stream())._nextPutAll_(")");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._visit_($recv($recv(anIRInlinedIfTrue)._instructions())._last());
+return self._visit_($recv($recv(anIRInlinedIfTrue)._dagChildren())._last());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
 //>>excludeEnd("ctx");
@@ -1141,10 +1133,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRInlinedIfTrue"],
-source: "visitIRInlinedIfTrue: anIRInlinedIfTrue\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfTrue instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfTrue instructions last ]",
+source: "visitIRInlinedIfTrue: anIRInlinedIfTrue\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfTrue dagChildren first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfTrue dagChildren last ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["nextPutIf:then:", "stream", "nextPutAll:", "visit:", "first", "instructions", "last"]
+messageSends: ["nextPutIf:then:", "stream", "nextPutAll:", "visit:", "first", "dagChildren", "last"]
 }),
 $globals.IRInliningJSTranslator);
 
@@ -1174,9 +1166,9 @@ $recv($2)._nextPutAll_("$core.assert(");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["nextPutAll:"]=1;
 //>>excludeEnd("ctx");
-$4=$recv(anIRInlinedIfTrueIfFalse)._instructions();
+$4=$recv(anIRInlinedIfTrueIfFalse)._dagChildren();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx2.sendIdx["instructions"]=1;
+$ctx2.sendIdx["dagChildren"]=1;
 //>>excludeEnd("ctx");
 $3=$recv($4)._first();
 self._visit_($3);
@@ -1191,9 +1183,9 @@ return $recv(self._stream())._nextPutAll_(")");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-$6=$recv(anIRInlinedIfTrueIfFalse)._instructions();
+$6=$recv(anIRInlinedIfTrueIfFalse)._dagChildren();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx2.sendIdx["instructions"]=2;
+$ctx2.sendIdx["dagChildren"]=2;
 //>>excludeEnd("ctx");
 $5=$recv($6)._second();
 return self._visit_($5);
@@ -1207,7 +1199,7 @@ $ctx2.sendIdx["visit:"]=2;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._visit_($recv($recv(anIRInlinedIfTrueIfFalse)._instructions())._third());
+return self._visit_($recv($recv(anIRInlinedIfTrueIfFalse)._dagChildren())._third());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
 //>>excludeEnd("ctx");
@@ -1219,10 +1211,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRInlinedIfTrueIfFalse"],
-source: "visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse\x0a\x09self stream\x0a\x09\x09nextPutIf: [\x0a\x09\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09\x09self visit: anIRInlinedIfTrueIfFalse instructions first.\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]\x0a\x09\x09else: [ self visit: anIRInlinedIfTrueIfFalse instructions third ]",
+source: "visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse\x0a\x09self stream\x0a\x09\x09nextPutIf: [\x0a\x09\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09\x09self visit: anIRInlinedIfTrueIfFalse dagChildren first.\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfTrueIfFalse dagChildren second ]\x0a\x09\x09else: [ self visit: anIRInlinedIfTrueIfFalse dagChildren third ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["nextPutIf:then:else:", "stream", "nextPutAll:", "visit:", "first", "instructions", "second", "third"]
+messageSends: ["nextPutIf:then:else:", "stream", "nextPutAll:", "visit:", "first", "dagChildren", "second", "third"]
 }),
 $globals.IRInliningJSTranslator);
 
@@ -1299,7 +1291,7 @@ var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv($recv(anIRInlinedSequence)._instructions())._do_((function(each){
+$recv($recv(anIRInlinedSequence)._dagChildren())._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -1323,10 +1315,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRInlinedSequence"],
-source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09anIRInlinedSequence instructions do: [ :each |\x0a\x09\x09self stream nextPutStatementWith: [ self visit: each ]]",
+source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09anIRInlinedSequence dagChildren do: [ :each |\x0a\x09\x09self stream nextPutStatementWith: [ self visit: each ]]",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["do:", "instructions", "nextPutStatementWith:", "stream", "visit:"]
+messageSends: ["do:", "dagChildren", "nextPutStatementWith:", "stream", "visit:"]
 }),
 $globals.IRInliningJSTranslator);
 
@@ -1695,7 +1687,7 @@ $recv(inlinedClosure)._add_(sequence);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["add:"]=6;
 //>>excludeEnd("ctx");
-statements=$recv($recv(anIRClosure)._sequence())._instructions();
+statements=$recv($recv(anIRClosure)._sequence())._dagChildren();
 $recv(statements)._ifNotEmpty_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -1755,10 +1747,10 @@ return inlinedClosure;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 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 instructions.\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 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",
 referencedClasses: ["IRTempDeclaration", "IRAssignment", "IRVariable", "AliasVar"],
 //>>excludeEnd("ide");
-messageSends: ["inlinedClosure", "scope:", "scope", "parent:", "parent", "do:", "tempDeclarations", "add:", "inlinedSequence", "arguments", "name:", "new", "yourself", "variable:", "instructions", "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", "ifTrue:ifFalse:", "and:", "isReturn", "last", "isBlockReturn", "expression"]
 }),
 $globals.IRSendInliner);
 
@@ -2170,7 +2162,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 self._assignment_(anIRAssignment);
 inlinedAssignment=$recv($globals.IRInlinedAssignment)._new();
-$recv($recv(anIRAssignment)._instructions())._do_((function(each){
+$recv($recv(anIRAssignment)._dagChildren())._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -2188,10 +2180,10 @@ return inlinedAssignment;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRAssignment"],
-source: "inlineAssignment: anIRAssignment\x0a\x09| inlinedAssignment |\x0a\x09self assignment: anIRAssignment.\x0a\x09inlinedAssignment := IRInlinedAssignment new.\x0a\x09anIRAssignment instructions do: [ :each |\x0a\x09\x09inlinedAssignment add: each ].\x0a\x09anIRAssignment replaceWith: inlinedAssignment.\x0a\x09self inlineSend: inlinedAssignment right.\x0a\x09^ inlinedAssignment",
+source: "inlineAssignment: anIRAssignment\x0a\x09| inlinedAssignment |\x0a\x09self assignment: anIRAssignment.\x0a\x09inlinedAssignment := IRInlinedAssignment new.\x0a\x09anIRAssignment dagChildren do: [ :each |\x0a\x09\x09inlinedAssignment add: each ].\x0a\x09anIRAssignment replaceWith: inlinedAssignment.\x0a\x09self inlineSend: inlinedAssignment right.\x0a\x09^ inlinedAssignment",
 referencedClasses: ["IRInlinedAssignment"],
 //>>excludeEnd("ide");
-messageSends: ["assignment:", "new", "do:", "instructions", "add:", "replaceWith:", "inlineSend:", "right"]
+messageSends: ["assignment:", "new", "do:", "dagChildren", "add:", "replaceWith:", "inlineSend:", "right"]
 }),
 $globals.IRAssignmentInliner);
 
@@ -2214,7 +2206,7 @@ $ctx1.supercall = true,
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
-statements=$recv($recv(inlinedClosure)._sequence())._instructions();
+statements=$recv($recv(inlinedClosure)._sequence())._dagChildren();
 $recv(statements)._ifNotEmpty_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -2249,10 +2241,10 @@ return inlinedClosure;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRClosure"],
-source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure statements |\x0a\x0a\x09inlinedClosure := super inlineClosure: anIRClosure.\x0a\x09statements := inlinedClosure sequence instructions.\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| 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",
 referencedClasses: ["IRAssignment"],
 //>>excludeEnd("ide");
-messageSends: ["inlineClosure:", "instructions", "sequence", "ifNotEmpty:", "ifTrue:", "canBeAssigned", "last", "replaceWith:", "add:", "new", "left", "assignment", "copy", "yourself"]
+messageSends: ["inlineClosure:", "dagChildren", "sequence", "ifNotEmpty:", "ifTrue:", "canBeAssigned", "last", "replaceWith:", "add:", "new", "left", "assignment", "copy", "yourself"]
 }),
 $globals.IRAssignmentInliner);
 
@@ -2281,7 +2273,7 @@ $ctx1.supercall = true,
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
-statements=$recv($recv(closure)._sequence())._instructions();
+statements=$recv($recv(closure)._sequence())._dagChildren();
 $recv(statements)._ifNotEmpty_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -2312,10 +2304,10 @@ return closure;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRClosure"],
-source: "inlineClosure: anIRClosure\x0a\x09| closure statements |\x0a\x0a\x09closure := super inlineClosure: anIRClosure.\x0a\x09statements := closure sequence instructions.\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 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",
 referencedClasses: ["IRReturn"],
 //>>excludeEnd("ide");
-messageSends: ["inlineClosure:", "instructions", "sequence", "ifNotEmpty:", "ifFalse:", "isReturn", "last", "replaceWith:", "add:", "new", "copy", "yourself"]
+messageSends: ["inlineClosure:", "dagChildren", "sequence", "ifNotEmpty:", "ifFalse:", "isReturn", "last", "replaceWith:", "add:", "new", "copy", "yourself"]
 }),
 $globals.IRReturnInliner);
 
@@ -2330,7 +2322,7 @@ var return_;
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 return_=self._inlinedReturn();
-$recv($recv(anIRReturn)._instructions())._do_((function(each){
+$recv($recv(anIRReturn)._dagChildren())._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -2348,10 +2340,10 @@ return return_;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRReturn"],
-source: "inlineReturn: anIRReturn\x0a\x09| return |\x0a\x09return := self inlinedReturn.\x0a\x09anIRReturn instructions do: [ :each |\x0a\x09\x09return add: each ].\x0a\x09anIRReturn replaceWith: return.\x0a\x09self inlineSend: return expression.\x0a\x09^ return",
+source: "inlineReturn: anIRReturn\x0a\x09| return |\x0a\x09return := self inlinedReturn.\x0a\x09anIRReturn dagChildren do: [ :each |\x0a\x09\x09return add: each ].\x0a\x09anIRReturn replaceWith: return.\x0a\x09self inlineSend: return expression.\x0a\x09^ return",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["inlinedReturn", "do:", "instructions", "add:", "replaceWith:", "inlineSend:", "expression"]
+messageSends: ["inlinedReturn", "do:", "dagChildren", "add:", "replaceWith:", "inlineSend:", "expression"]
 }),
 $globals.IRReturnInliner);
 

+ 27 - 28
src/Compiler-Inlining.st

@@ -13,7 +13,7 @@ isInlined
 
 !IRInlinedAssignment methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRInlinedAssignment: self
 ! !
 
@@ -31,7 +31,7 @@ isInlined
 
 !IRInlinedClosure methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	aVisitor visitIRInlinedClosure: self
 ! !
 
@@ -49,7 +49,7 @@ isInlined
 
 !IRInlinedReturn methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	^ aVisitor visitIRInlinedReturn: self
 ! !
 
@@ -76,7 +76,7 @@ isInlined
 
 !IRInlinedSend methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	aVisitor visitInlinedSend: self
 ! !
 
@@ -88,7 +88,7 @@ I represent an inlined `#ifFalse:` message send instruction.!
 
 !IRInlinedIfFalse methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	aVisitor visitIRInlinedIfFalse: self
 ! !
 
@@ -116,7 +116,7 @@ receiverInternalVariableName
 
 !IRInlinedIfNilIfNotNil methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	aVisitor visitIRInlinedIfNilIfNotNil: self
 ! !
 
@@ -128,7 +128,7 @@ I represent an inlined `#ifTrue:` message send instruction.!
 
 !IRInlinedIfTrue methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	aVisitor visitIRInlinedIfTrue: self
 ! !
 
@@ -140,7 +140,7 @@ I represent an inlined `#ifTrue:ifFalse:` message send instruction.!
 
 !IRInlinedIfTrueIfFalse methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	aVisitor visitIRInlinedIfTrueIfFalse: self
 ! !
 
@@ -158,7 +158,7 @@ isInlined
 
 !IRInlinedSequence methodsFor: 'visiting'!
 
-accept: aVisitor
+acceptDagVisitor: aVisitor
 	aVisitor visitIRInlinedSequence: self
 ! !
 
@@ -220,7 +220,7 @@ transformNonLocalReturn: anIRNonLocalReturn
 		localReturn := IRReturn new
 			scope: anIRNonLocalReturn scope;
 			yourself.
-		anIRNonLocalReturn instructions do: [ :each |
+		anIRNonLocalReturn dagChildren do: [ :each |
 			localReturn add: each ].
 		anIRNonLocalReturn replaceWith: localReturn.
 		^ localReturn ].
@@ -264,16 +264,15 @@ visitIRInlinedAssignment: anIRInlinedAssignment
 visitIRInlinedClosure: anIRInlinedClosure
 	self stream nextPutVars: (anIRInlinedClosure tempDeclarations collect: [ :each |
 		each name asVariableName ]).
-	anIRInlinedClosure instructions do: [ :each |
-		self visit: each ]
+	self visitAll: anIRInlinedClosure dagChildren
 !
 
 visitIRInlinedIfFalse: anIRInlinedIfFalse
 	self stream nextPutIf: [
 		self stream nextPutAll: '!!$core.assert('.
-		self visit: anIRInlinedIfFalse instructions first.
+		self visit: anIRInlinedIfFalse dagChildren first.
 		self stream nextPutAll: ')' ]
-		then: [ self visit: anIRInlinedIfFalse instructions last ]
+		then: [ self visit: anIRInlinedIfFalse dagChildren last ]
 !
 
 visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil
@@ -282,28 +281,28 @@ visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil
 			| recvVarName |
 			recvVarName := anIRInlinedIfNilIfNotNil receiverInternalVariableName.
 			self stream nextPutAll: '(', recvVarName, ' = '.
-			self visit: anIRInlinedIfNilIfNotNil instructions first.
+			self visit: anIRInlinedIfNilIfNotNil dagChildren first.
 			self stream nextPutAll: ') == null || ', recvVarName, '.isNil' ]
-		then: [ self visit: anIRInlinedIfNilIfNotNil instructions second ]
-		else: [ self visit: anIRInlinedIfNilIfNotNil instructions third ]
+		then: [ self visit: anIRInlinedIfNilIfNotNil dagChildren second ]
+		else: [ self visit: anIRInlinedIfNilIfNotNil dagChildren third ]
 !
 
 visitIRInlinedIfTrue: anIRInlinedIfTrue
 	self stream nextPutIf: [
 		self stream nextPutAll: '$core.assert('.
-		self visit: anIRInlinedIfTrue instructions first.
+		self visit: anIRInlinedIfTrue dagChildren first.
 		self stream nextPutAll: ')' ]
-		then: [ self visit: anIRInlinedIfTrue instructions last ]
+		then: [ self visit: anIRInlinedIfTrue dagChildren last ]
 !
 
 visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse
 	self stream
 		nextPutIf: [
 			self stream nextPutAll: '$core.assert('.
-			self visit: anIRInlinedIfTrueIfFalse instructions first.
+			self visit: anIRInlinedIfTrueIfFalse dagChildren first.
 			self stream nextPutAll: ')' ]
-		then: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]
-		else: [ self visit: anIRInlinedIfTrueIfFalse instructions third ]
+		then: [ self visit: anIRInlinedIfTrueIfFalse dagChildren second ]
+		else: [ self visit: anIRInlinedIfTrueIfFalse dagChildren third ]
 !
 
 visitIRInlinedNonLocalReturn: anIRInlinedReturn
@@ -317,7 +316,7 @@ visitIRInlinedReturn: anIRInlinedReturn
 !
 
 visitIRInlinedSequence: anIRInlinedSequence
-	anIRInlinedSequence instructions do: [ :each |
+	anIRInlinedSequence dagChildren do: [ :each |
 		self stream nextPutStatementWith: [ self visit: each ]]
 ! !
 
@@ -438,7 +437,7 @@ inlineClosure: anIRClosure
 	inlinedClosure add: sequence.
 
 	"Get all the statements"
-	statements := anIRClosure sequence instructions.
+	statements := anIRClosure sequence dagChildren.
 	
 	statements ifNotEmpty: [
 		statements allButLast do: [ :each | sequence add: each ].
@@ -543,7 +542,7 @@ inlineAssignment: anIRAssignment
 	| inlinedAssignment |
 	self assignment: anIRAssignment.
 	inlinedAssignment := IRInlinedAssignment new.
-	anIRAssignment instructions do: [ :each |
+	anIRAssignment dagChildren do: [ :each |
 		inlinedAssignment add: each ].
 	anIRAssignment replaceWith: inlinedAssignment.
 	self inlineSend: inlinedAssignment right.
@@ -554,7 +553,7 @@ inlineClosure: anIRClosure
 	| inlinedClosure statements |
 
 	inlinedClosure := super inlineClosure: anIRClosure.
-	statements := inlinedClosure sequence instructions.
+	statements := inlinedClosure sequence dagChildren.
 	
 	statements ifNotEmpty: [
 		statements last canBeAssigned ifTrue: [
@@ -584,7 +583,7 @@ inlineClosure: anIRClosure
 	| closure statements |
 
 	closure := super inlineClosure: anIRClosure.
-	statements := closure sequence instructions.
+	statements := closure sequence dagChildren.
 	
 	statements ifNotEmpty: [
 		statements last isReturn
@@ -598,7 +597,7 @@ inlineClosure: anIRClosure
 inlineReturn: anIRReturn
 	| return |
 	return := self inlinedReturn.
-	anIRReturn instructions do: [ :each |
+	anIRReturn dagChildren do: [ :each |
 		return add: each ].
 	anIRReturn replaceWith: return.
 	self inlineSend: return expression.

Some files were not shown because too many files changed in this diff