]> gitweb.factorcode.org Git - factor.git/commitdiff
Remove %dispatch-label since its tehe same on all platforms; fix %gc on PowerPC
authorSlava Pestov <slava@factorcode.org>
Mon, 8 Jun 2009 02:46:28 +0000 (21:46 -0500)
committerSlava Pestov <slava@factorcode.org>
Mon, 8 Jun 2009 02:46:28 +0000 (21:46 -0500)
basis/compiler/codegen/codegen.factor
basis/cpu/architecture/architecture.factor
basis/cpu/ppc/ppc.factor
basis/cpu/x86/x86.factor

index 7bdaace1db3c37388dc6f6ca12d20a6c9fa54549..7602295284cd98adb33474ff0a71d09e08fdbff7 100755 (executable)
@@ -8,6 +8,7 @@ continuations.private fry cpu.architecture
 source-files.errors
 compiler.errors
 compiler.alien
+compiler.constants
 compiler.cfg
 compiler.cfg.instructions
 compiler.cfg.stack-frame
@@ -94,7 +95,9 @@ M: _dispatch generate-insn
     [ src>> register ] [ temp>> register ] bi %dispatch ;
 
 M: _dispatch-label generate-insn
-    label>> lookup-label %dispatch-label ;
+    label>> lookup-label
+    cell 0 <repetition> %
+    rc-absolute-cell label-fixup ;
 
 : >slot< ( insn -- dst obj slot tag )
     {
index 805ba4fd71e7d75c2f2ee98455c942a489ef1c18..556424f50cf565c70036c22f1ad7875c6c2f62a6 100644 (file)
@@ -55,7 +55,6 @@ HOOK: %jump-label cpu ( label -- )
 HOOK: %return cpu ( -- )
 
 HOOK: %dispatch cpu ( src temp -- )
-HOOK: %dispatch-label cpu ( label -- )
 
 HOOK: %slot cpu ( dst obj slot tag temp -- )
 HOOK: %slot-imm cpu ( dst obj slot tag -- )
index 934b456075eb86b577f90c5da72c18afbc887845..003eccfa18a23cdb36cb5c921f12af65c0ae0a7f 100644 (file)
@@ -3,10 +3,11 @@
 USING: accessors assocs sequences kernel combinators make math
 math.order math.ranges system namespaces locals layouts words
 alien alien.accessors alien.c-types literals cpu.architecture
-cpu.ppc.assembler cpu.ppc.assembler.backend literals compiler.cfg.registers
+cpu.ppc.assembler cpu.ppc.assembler.backend compiler.cfg.registers
 compiler.cfg.instructions compiler.constants compiler.codegen
 compiler.codegen.fixup compiler.cfg.intrinsics
-compiler.cfg.stack-frame compiler.units ;
+compiler.cfg.stack-frame compiler.cfg.build-stack-frame
+compiler.units ;
 FROM: cpu.ppc.assembler => B ;
 IN: cpu.ppc
 
@@ -461,16 +462,18 @@ M:: ppc %write-barrier ( src card# table -- )
     src card# deck-bits SRWI
     table scratch-reg card# STBX ;
 
-M: ppc %gc
+M:: ppc %gc ( temp1 temp2 gc-roots gc-root-count -- )
     "end" define-label
-    12 load-zone-ptr
-    11 12 cell LWZ ! nursery.here -> r11
-    12 12 3 cells LWZ ! nursery.end -> r12
-    11 11 1024 ADDI ! add ALLOT_BUFFER_ZONE to here
-    11 0 12 CMP ! is here >= end?
+    temp2 load-zone-ptr
+    temp1 temp2 cell LWZ
+    temp2 temp2 3 cells LWZ
+    temp1 temp1 1024 ADDI ! add ALLOT_BUFFER_ZONE to here
+    temp1 0 temp2 CMP ! is here >= end?
     "end" get BLE
     %prepare-alien-invoke
-    "minor_gc" f %alien-invoke
+    0 3 LI
+    0 4 LI
+    "inline_gc" f %alien-invoke
     "end" resolve-label ;
 
 M: ppc %prologue ( n -- )
index ef353281e50e80583034e6be15837e4f0dba652c..b3cb5b56ec6b77b526bfe3038f933ed2c0a5c47a 100644 (file)
@@ -91,9 +91,6 @@ M: x86 %return ( -- ) 0 RET ;
 : align-code ( n -- )
     0 <repetition> % ;
 
-M: x86 %dispatch-label ( label -- )
-    0 cell, rc-absolute-cell label-fixup ;
-
 :: (%slot) ( obj slot tag temp -- op )
     temp slot obj [+] LEA
     temp tag neg [+] ; inline