]> gitweb.factorcode.org Git - factor.git/commitdiff
cpu.x86: combine 32-bit and 64-bit %dispatch template
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 12 Jun 2010 01:52:38 +0000 (21:52 -0400)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 12 Jun 2010 01:52:38 +0000 (21:52 -0400)
basis/cpu/x86/32/32.factor
basis/cpu/x86/64/64.factor
basis/cpu/x86/x86.factor

index b640008f3a1fbe212e5478f8d4251ef523622462..50835affb0a4034c70b0247a68748c2072e6fac0 100755 (executable)
@@ -56,20 +56,6 @@ M: x86.32 %mark-deck
     rc-absolute-cell rel-decks-offset
     building get push ;
 
-M:: x86.32 %dispatch ( src temp -- )
-    ! Load jump table base.
-    temp src HEX: ffffffff [+] LEA
-    building get length :> start
-    0 rc-absolute-cell rel-here
-    ! Go
-    temp HEX: 7f [+] JMP
-    building get length :> end
-    ! Fix up the displacement above
-    cell alignment
-    [ end start - + building get dup pop* push ]
-    [ (align-code) ]
-    bi ;
-
 M: x86.32 pic-tail-reg EDX ;
 
 M: x86.32 reserved-stack-space 0 ;
index fb53b6fcbb409479dd2d27da3b50f1b78e2f5d3c..65acdfbeb91143523c8505d49e3841a1ed828cc5 100644 (file)
@@ -81,21 +81,6 @@ M: x86.64 %mark-deck
     dup load-decks-offset
     [+] card-mark <byte> MOV ;
 
-M:: x86.64 %dispatch ( src temp -- )
-    ! Load jump table base.
-    temp HEX: ffffffff MOV
-    building get length :> start
-    0 rc-absolute-cell rel-here
-    ! Add jump table base
-    temp src ADD
-    temp HEX: 7f [+] JMP
-    building get length :> end
-    ! Fix up the displacement above
-    cell alignment
-    [ end start - + building get dup pop* push ]
-    [ (align-code) ]
-    bi ;
-
 M:: x86.64 %load-reg-param ( dst reg rep -- )
     dst reg rep %copy ;
 
index b8911f912723ab33ebe469e83cf698e2a1ae7821..05251818b54dfbf0131c5fd6b40559903cac5927 100644 (file)
@@ -570,6 +570,20 @@ M:: x86 %compare-imm-branch ( label src1 src2 cc -- )
     src1 src2 (%compare-imm)
     label cc %branch ;
 
+M:: x86 %dispatch ( src temp -- )
+    ! Load jump table base.
+    temp HEX: ffffffff MOV
+    building get length :> start
+    0 rc-absolute-cell rel-here
+    ! Add jump table base
+    temp src HEX: 7f [++] JMP
+    building get length :> end
+    ! Fix up the displacement above
+    cell alignment
+    [ end start - + building get dup pop* push ]
+    [ (align-code) ]
+    bi ;
+
 M:: x86 %spill ( src rep dst -- )
     dst src rep %copy ;