diff -r 1bfd09c6b3d8 -r be8c2dd09dff IRBytecodeGenerator.st --- 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 " +! + 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 " "Modified: / 12-05-2009 / 08:58:11 / Jan Vrany " - "Modified: / 23-03-2010 / 22:34:24 / Jan Vrany " ! popTop @@ -715,38 +726,6 @@ "Modified: / 13-05-2009 / 10:42:16 / Jan Vrany " ! -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 " - "Modified: / 13-05-2009 / 11:15:41 / Jan Vrany " - "Modified: / 24-03-2010 / 08:42:04 / Jan Vrany " -! - 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:: $' ! !