IRBytecodeGenerator.st
changeset 37 be8c2dd09dff
parent 30 1b7ff9c8c40b
child 41 f3898a3b378d
--- a/IRBytecodeGenerator.st	Tue Nov 15 21:28:05 2011 +0000
+++ b/IRBytecodeGenerator.st	Thu Mar 29 18:03:58 2012 +0000
@@ -37,6 +37,17 @@
 
 !IRBytecodeGenerator methodsFor:'accessing'!
 
+getCode
+
+    "
+        Private entry for IRBytecodeGenerator>>makeBlock:
+    "
+
+    ^code
+
+    "Created: / 30-03-2009 / 19:00:07 / Jan Vrany <vranyj1@fel.cvut.cz>"
+!
+
 properties: aDictionary
 
     properties := aDictionary.
@@ -213,6 +224,7 @@
                 at: index + 1 
                 put: (closureCode at: index + 1) + pos + 4]].
 
+
     code addAll: closureCode.
 
     "Patch number of closure bytecodes"
@@ -220,7 +232,6 @@
 
     "Created: / 30-03-2009 / 18:16:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 12-05-2009 / 08:58:11 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 23-03-2010 / 22:34:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 popTop
@@ -715,38 +726,6 @@
     "Modified: / 13-05-2009 / 10:42:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
-getCode
-
-        | stream basicBlockStartOffset |
-        [ orderSeq
-                inject: false
-                into: [:changed :seqId | (self updateJump: seqId) | changed]
-        ] whileTrue.
-
-        stream := (OrderedCollection new: 200) writeStream.
-        basicBlockStartOffset := 0. 
-        orderSeq do: [:seqId |
-                (instrMaps at: seqId) do: [:assoc |
-                        assoc key "instr" bytecodeIndex: stream position + assoc value.
-                ].
-                "Patch makeBlock offsets"
-                (seqCode at: seqId) withIndexDo:
-                    [:instr :index|
-                    instr == #makeBlock ifTrue:
-                        [(seqCode at: seqId) 
-                            at: index + 1
-                            put: ((seqCode at: seqId) at: index + 1) + basicBlockStartOffset]].
-
-                stream nextPutAll: (seqCode at: seqId).
-                basicBlockStartOffset := basicBlockStartOffset + (seqCode at: seqId) size.
-        ].
-        ^stream contents
-
-    "Created: / 11-06-2008 / 14:00:43 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 13-05-2009 / 11:15:41 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 24-03-2010 / 08:42:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 literals
 
     ^literals asArray
@@ -829,13 +808,13 @@
 !IRBytecodeGenerator class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/cvut/stx/goodies/newcompiler/IRBytecodeGenerator.st,v 1.3 2009/10/08 12:04:39 fm Exp $'
+    ^ '$Id$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/cvut/stx/goodies/newcompiler/IRBytecodeGenerator.st,v 1.3 2009/10/08 12:04:39 fm Exp $'
+    ^ '§Header: /cvs/stx/cvut/stx/goodies/newcompiler/IRBytecodeGenerator.st,v 1.3 2009/10/08 12:04:39 fm Exp §'
 !
 
 version_SVN
-    ^ '$Id$'
+    ^ '$Id::                                                                                                                        $'
 ! !