diff --git a/core/compiler/constants/constants.factor b/core/compiler/constants/constants.factor index 3de32ab7fa..66fc8d5789 100755 --- a/core/compiler/constants/constants.factor +++ b/core/compiler/constants/constants.factor @@ -19,4 +19,4 @@ IN: compiler.constants : class-hash-offset bootstrap-cell object tag-number - ; : word-xt-offset 8 bootstrap-cells object tag-number - ; : word-code-offset 9 bootstrap-cells object tag-number - ; -: compiled-header-size 8 bootstrap-cells ; +: compiled-header-size 4 bootstrap-cells ; diff --git a/core/compiler/test/redefine.factor b/core/compiler/test/redefine.factor index 821daef203..6e652df877 100755 --- a/core/compiler/test/redefine.factor +++ b/core/compiler/test/redefine.factor @@ -17,7 +17,7 @@ DEFER: x-2 { x-1 } compile - \ x-2 word-xt eq? + \ x-2 word-xt = ] unit-test ] with-variable @@ -115,7 +115,7 @@ DEFER: g-test-3 "IN: temporary USE: math GENERIC: g-test-1 ( x -- y ) M: integer g-test-1 3 + ;" eval - \ g-test-3 word-xt eq? + \ g-test-3 word-xt = ] unit-test DEFER: g-test-5 diff --git a/core/compiler/test/templates-early.factor b/core/compiler/test/templates-early.factor index 795d331c00..e518d2de8a 100755 --- a/core/compiler/test/templates-early.factor +++ b/core/compiler/test/templates-early.factor @@ -44,7 +44,7 @@ words kernel math effects definitions compiler.units ; [ [ ] [ init-templates ] unit-test - [ ] [ \ + init-generator ] unit-test + [ ] [ init-generator ] unit-test [ t ] [ [ end-basic-block ] { } make empty? ] unit-test diff --git a/core/cpu/architecture/architecture.factor b/core/cpu/architecture/architecture.factor index 2409eafaf0..e48ba97f33 100755 --- a/core/cpu/architecture/architecture.factor +++ b/core/cpu/architecture/architecture.factor @@ -72,8 +72,6 @@ HOOK: %jump-dispatch compiler-backend ( -- ) HOOK: %dispatch-label compiler-backend ( word -- ) -HOOK: %end-dispatch compiler-backend ( label -- ) - ! Return to caller HOOK: %return compiler-backend ( -- ) diff --git a/core/cpu/ppc/architecture/architecture.factor b/core/cpu/ppc/architecture/architecture.factor index a156c173a1..edbed571e1 100755 --- a/core/cpu/ppc/architecture/architecture.factor +++ b/core/cpu/ppc/architecture/architecture.factor @@ -144,9 +144,6 @@ M: ppc-backend %jump-dispatch ( -- ) M: ppc-backend %dispatch-label ( word -- ) 0 , rc-absolute-cell rel-word ; -M: ppc-backend %end-dispatch ( label -- ) - resolve-label ; - M: ppc-backend %return ( -- ) %epilogue-later BLR ; M: ppc-backend %unwind drop %return ; diff --git a/core/cpu/x86/architecture/architecture.factor b/core/cpu/x86/architecture/architecture.factor index 96b2dcf1ec..876c631b81 100755 --- a/core/cpu/x86/architecture/architecture.factor +++ b/core/cpu/x86/architecture/architecture.factor @@ -85,7 +85,7 @@ M: x86-backend %jump-label ( label -- ) JMP ; M: x86-backend %jump-t ( label -- ) "flag" operand f v>operand CMP JNE ; -: (%dispatch) ( -- operand ) +: (%dispatch) ( n -- operand ) ! Load jump table base. We use a temporary register ! since on AMD64 we have to load a 64-bit immediate. On ! x86, this is redundant. @@ -94,18 +94,20 @@ M: x86-backend %jump-t ( label -- ) ! Add jump table base "offset" operand HEX: ffffffff MOV rc-absolute-cell rel-here "n" operand "offset" operand ADD - "n" operand bootstrap-cell 8 = 14 9 ? [+] ; + "n" operand swap bootstrap-cell 8 = 14 9 ? + [+] ; M: x86-backend %call-dispatch ( word-table# -- ) - [ (%dispatch) CALL