]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix inline GC check
authorslava <slava@factorcode.org>
Thu, 9 Nov 2006 05:15:02 +0000 (05:15 +0000)
committerslava <slava@factorcode.org>
Thu, 9 Nov 2006 05:15:02 +0000 (05:15 +0000)
TODO.FACTOR.txt
library/compiler/generator/templates.factor
library/compiler/ppc/allot.factor
library/compiler/x86/allot.factor

index c2276e5daa4a9f785646bf1467163c1cbd30a287..e12529b40611b351036667da9216c67dab6c0210 100644 (file)
@@ -9,7 +9,6 @@
 - x86: load-allot-ptr doesn't have a stack effect? why?
 - mov 0x0(%esi),%ecx  why?
 - mac intel: perhaps its not a good idea using ebx as allot-tmp-reg
-- RNG is broken
 - %allot-bignum-signed-2 still has issues on ppc
 - fix %allot-bignum-signed-1/2 on x86
 
index 7fec3e2aace7b728e309fa81f037ceb7919397d7..213289318fe3e658ca2d1eeedac405f8c795ac80 100644 (file)
@@ -5,7 +5,7 @@ USING: arrays generic hashtables inference io kernel math
 namespaces prettyprint sequences vectors words ;
 
 ! Set this to t so that end-basic-block compiles a GC check
-SYMBOL: maybe-gc
+: maybe-gc ( n -- ) \ maybe-gc get push ;
 
 ! Register allocation
 
@@ -136,10 +136,12 @@ SYMBOL: phantom-r
 
 : end-basic-block ( -- )
     finalize-contents finalize-heights
-    maybe-gc get [
-        maybe-gc off
+    \ maybe-gc get dup empty? [
+        drop
+    ] [
+        delete-all
         "simple_gc" f %alien-invoke
-    ] when ;
+    ] if ;
 
 : used-vregs ( -- seq ) phantoms append [ vreg? ] subset ;
 
@@ -154,13 +156,14 @@ SYMBOL: phantom-r
     drop ;
 
 : init-templates ( -- )
-    maybe-gc off
+    V{ } clone \ maybe-gc set
     <phantom-datastack> phantom-d set
     <phantom-callstack> phantom-r set
     compute-free-vregs ;
 
 : keep-templates ( quot -- )
     [
+        V{ } clone \ maybe-gc set
         phantom-d [ clone ] change
         phantom-r [ clone ] change
         compute-free-vregs
index 0c2e9487b924534bb8fed6f70927ef49bdfb9b3f..ada9045f0ba81ff6138ce0fa6f12670bd516116d 100644 (file)
@@ -9,7 +9,7 @@ USING: kernel assembler kernel-internals namespaces math ;
 : %allot ( header size -- )
     #! Store a pointer to 'size' bytes allocated from the
     #! nursery in r11.
-    maybe-gc on
+    dup maybe-gc
     8 align ! align the size
     12 load-zone-ptr ! nusery -> r12
     11 12 cell LWZ ! nursery.here -> r11
index eab550dd0f4815aa5a383e7264467b997c5b8670..17ee437c8a7754cad2ceb05562be6e69d09ff207 100644 (file)
@@ -21,7 +21,7 @@ USING: kernel assembler kernel-internals namespaces math ;
     allot-tmp-reg [] swap tag-header MOV ;
 
 : %allot ( header size quot -- )
-    maybe-gc on
+    dup maybe-gc
     swap >r >r
     allot-tmp-reg PUSH
     load-allot-ptr