]> gitweb.factorcode.org Git - factor.git/commitdiff
%call-label and %return-to were compiled wrong
authorSlava Pestov <slava@factorcode.org>
Wed, 19 Oct 2005 00:35:41 +0000 (00:35 +0000)
committerSlava Pestov <slava@factorcode.org>
Wed, 19 Oct 2005 00:35:41 +0000 (00:35 +0000)
library/compiler/ppc/generator.factor
library/test/compiler/optimizer.factor

index bf906fcb15ec1b52f66ae4136a3200bb82a5d1b6..91eac8e19857bd911c5b75517a676fea50345fd6 100644 (file)
@@ -30,7 +30,7 @@ M: %call-label generate-node ( vop -- )
     vop-label
     compiled-offset 20 + 18 LOAD32  0 1 rel-address
     1 1 stack-increment neg STWU
-    18 1 stack-increment cell + STW
+    18 1 stack-increment lr@ STW
     B ;
 
 : word-addr ( word -- )
@@ -59,8 +59,8 @@ M: %jump-t generate-node ( vop -- )
 
 M: %return-to generate-node ( vop -- )
     vop-label 0 3 LOAD32  absolute-16/16
-    1 1 -16 STWU
-    3 1 20 STW ;
+    1 1 stack-increment neg STWU
+    3 1 stack-increment lr@ STW ;
 
 M: %return generate-node ( vop -- )
     drop compile-epilogue BLR ;
index bf87a0c1349a40c949eb74a1535679d1e6f6b532..c4661bfb1a5ff6c1f083826246bf90681cdb15cc 100644 (file)
@@ -176,12 +176,12 @@ TUPLE: pred-test ;
 
 [ << pred-test >> "pred-test" ] [ << pred-test >> pred-test-4 ] unit-test
 
-: inline-test
-    "nom" = ; compiled
-
-[ t ] [ "nom" inline-test ] unit-test
-[ f ] [ "shayin" inline-test ] unit-test
-[ f ] [ 3 inline-test ] unit-test
+: inline-test
+    "nom" = ; compiled
+! 
+[ t ] [ "nom" inline-test ] unit-test
+[ f ] [ "shayin" inline-test ] unit-test
+[ f ] [ 3 inline-test ] unit-test
 
 : fixnum-declarations >fixnum 24 shift 1234 bitxor ; compiled