Fixed multiple occurence of line: instruction
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 13 May 2009 08:23:00 +0000
changeset 18 e6921b3a5d5b
parent 17 df6f26442169
child 19 3bb7360f9dff
Fixed multiple occurence of line: instruction
IRBuilder.st
IRBytecodeGenerator.st
--- a/IRBuilder.st	Tue May 12 11:10:22 2009 +0000
+++ b/IRBuilder.st	Wed May 13 08:23:00 2009 +0000
@@ -2,7 +2,7 @@
 
 Object subclass:#IRBuilder
 	instanceVariableNames:'ir jumpBackTargetStacks jumpAheadStacks currentSequence
-		sourceMapNodes sourceMapByteIndex'
+		sourceMapNodes sourceMapByteIndex lastLine'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'NewCompiler-IR'
@@ -203,9 +203,12 @@
 !
 
 line:line 
-    self add:(IRInstruction line:line)
 
-    "Modified: / 28-03-2009 / 21:02:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    lastLine ~= line ifTrue:
+        [self add:(IRInstruction line:line).
+        lastLine := line].
+
+    "Modified: / 12-05-2009 / 16:11:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
 popTop
--- a/IRBytecodeGenerator.st	Tue May 12 11:10:22 2009 +0000
+++ b/IRBytecodeGenerator.st	Wed May 13 08:23:00 2009 +0000
@@ -109,12 +109,14 @@
 
 goto: seqId
 
-	stacks at: seqId put: (stack linkTo: (stacks at: seqId ifAbsentPut: [nil])).
+        stacks at: seqId put: (stack linkTo: (stacks at: seqId ifAbsentPut: [nil])).
 
-	self saveLastJump: (Message
-		selector: #from:goto:
-		arguments: {currentSeqId. seqId}).
-	self from: currentSeqId goto: seqId.
+        self saveLastJump: (Message
+                selector: #from:goto:
+                arguments: (Array with: currentSeqId with: seqId)).
+        self from: currentSeqId goto: seqId.
+
+    "Modified: / 13-05-2009 / 10:16:45 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
 if: bool goto: seqId
@@ -402,7 +404,6 @@
 
         stack pop: sendNumArgs.
 
-
         self 
             nextPut: #send;
             nextPut: lastLine;
@@ -410,7 +411,7 @@
             nextPut: sendNumArgs.
 
     "Created: / 01-12-2008 / 19:47:43 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 02-12-2008 / 09:10:31 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 13-05-2009 / 10:06:22 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
 send: selector numArgs: sendNumArgs toSuperOf: behavior
@@ -426,7 +427,7 @@
             nextPut: (self addLiteral: behavior superclass)
 
     "Created: / 01-12-2008 / 19:48:14 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 02-12-2008 / 09:10:37 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 13-05-2009 / 10:05:42 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
 storeBlockArg: index