]> gitweb.factorcode.org Git - factor.git/commitdiff
ds is in esi now
authorSlava Pestov <slava@factorcode.org>
Thu, 17 Feb 2005 04:24:35 +0000 (04:24 +0000)
committerSlava Pestov <slava@factorcode.org>
Thu, 17 Feb 2005 04:24:35 +0000 (04:24 +0000)
TODO.FACTOR.txt
library/compiler/x86/fixnum.factor
library/compiler/x86/generator.factor
library/compiler/x86/stack.factor
native/factor.h

index 4ec2f1a8e7ae5ee098c5e7b2662d29cbc9e82508..686e102feed84e8a832a3ccd0e61f39c25c40ccd 100644 (file)
@@ -1,36 +1,38 @@
 72/73:\r
 \r
-- [ [ dup call ] dup call ] infer hangs\r
-- move tuple to generic vocab\r
 - update plugin docs\r
 - word preview for remote words\r
-- vectors: ensure its ok with bignum indices\r
-- code gc\r
+- faster completion\r
+\r
+- [ [ dup call ] dup call ] infer hangs\r
 - type inference fails with some assembler words;\r
   displaced, register and other predicates need to inherit from list\r
   not cons, and need stronger branch partial eval\r
 - print warning on null class\r
 - optimize away dispatch\r
-- faster completion\r
+\r
+- move tuple to generic vocab\r
+\r
+- vectors: ensure its ok with bignum indices\r
+- code gc\r
 - ppc register decls\r
 \r
+- unit test failure\r
+- #jump-f #jump-f-label\r
 - extract word inside M:, C:, and structure browsing for these\r
 - fix checkbox alignment\r
 - begin-scan, next-object, end-scan primitives\r
 - each-object, each-slot combinators\r
-- port leak\r
 - references primitive\r
 - ditch % for tuples?\r
 - resize window: world not updated until mouse moved\r
 - x>offset\r
 - fix completion invoke in middle of word\r
-- html: word links\r
 - don't hardcode so many colors\r
 - ffi unicode strings: null char security hole\r
 - utf16 string boxing\r
 - slot compile problem\r
 - sdl console crash\r
-- x86 register decl\r
 - UI: don't roll over if mouse button is down\r
 \r
 + compiler/ffi:\r
index 08ae3d23b5ba382221785c7c2a869a138c8648fa..c2b92c1c4b7aa208153bc77347ebd7d5bd2a9b09 100644 (file)
@@ -47,16 +47,14 @@ USE: math-internals
 
 : fixnum-insn ( overflow opcode -- )
     #! This needs to be factored.
-    ECX DS>
-    EAX [ ECX -4 ] MOV
-    EAX [ ECX ] rot execute
+    EAX [ ESI -4 ] MOV
+    EAX [ ESI ] rot execute
     0 JNO fixup
     swap compile-call
     0 JMP fixup >r
     compiled-offset swap patch
-    ECX 4 SUB
-    [ ECX ] EAX MOV
-    ECX >DS
+    ESI 4 SUB
+    [ ESI ] EAX MOV
     r> compiled-offset swap patch ;
 
 \ fixnum+ [
@@ -73,17 +71,15 @@ USE: math-internals
 
 \ fixnum* [
     drop
-    ECX DS>
-    EAX [ ECX -4 ] MOV
+    EAX [ ESI -4 ] MOV
     EAX 3 SHR
-    EAX [ ECX ] IMUL
+    EAX [ ESI ] IMUL
     0 JNO fixup
     \ fixnum* compile-call
     0 JMP fixup >r
     compiled-offset swap patch
-    ECX 4 SUB
-    [ ECX ] EAX MOV
-    ECX >DS
+    ESI 4 SUB
+    [ ESI ] EAX MOV
     r> compiled-offset swap patch
 ] "generator" set-word-property
 
@@ -91,18 +87,16 @@ USE: math-internals
 
 \ fixnum/i [
     drop
-    ECX DS>
-    EAX [ ECX -4 ] MOV
+    EAX [ ESI -4 ] MOV
     CDQ
-    [ ECX ] IDIV
+    [ ESI ] IDIV
     EAX 3 SHL
     0 JNO fixup
     \ fixnum/i compile-call
     0 JMP fixup >r
     compiled-offset swap patch
-    ECX 4 SUB
-    [ ECX ] EAX MOV
-    ECX >DS
+    ESI 4 SUB
+    [ ESI ] EAX MOV
     r> compiled-offset swap patch
 ] "generator" set-word-property
 
@@ -110,18 +104,16 @@ USE: math-internals
 
 \ fixnum-mod [
     drop
-    ECX DS>
-    EAX [ ECX -4 ] MOV
+    EAX [ ESI -4 ] MOV
     CDQ
-    [ ECX ] IDIV
+    [ ESI ] IDIV
     EAX 3 SHL
     0 JNO fixup
     \ fixnum/i compile-call
     0 JMP fixup >r
     compiled-offset swap patch
-    ECX 4 SUB
-    [ ECX ] EDX MOV
-    ECX >DS
+    ESI 4 SUB
+    [ ESI ] EDX MOV
     r> compiled-offset swap patch
 ] "generator" set-word-property
 
@@ -129,18 +121,16 @@ USE: math-internals
 
 \ fixnum/mod [
     drop
-    ECX DS>
-    EAX [ ECX -4 ] MOV
+    EAX [ ESI -4 ] MOV
     CDQ
-    [ ECX ] IDIV
+    [ ESI ] IDIV
     EAX 3 SHL
     0 JNO fixup
     \ fixnum/mod compile-call
     0 JMP fixup >r
     compiled-offset swap patch
-    [ ECX -4 ] EAX MOV
-    [ ECX ] EDX MOV
-    ECX >DS
+    [ ESI -4 ] EAX MOV
+    [ ESI ] EDX MOV
     r> compiled-offset swap patch
 ] "generator" set-word-property
 
@@ -148,10 +138,9 @@ USE: math-internals
 
 \ arithmetic-type [
     drop
-    ECX DS>
-    EAX [ ECX -4 ] MOV
+    EAX [ ESI -4 ] MOV
     EAX BIN: 111 AND
-    EDX [ ECX ] MOV
+    EDX [ ESI ] MOV
     EDX BIN: 111 AND
     EAX EDX CMP
     0 JE fixup >r
index 1a6bdbce3bf110a05cd8810810cd689f023af7a9..568c82f1ddb2b111edc164e6c5eea8e967c8a1eb 100644 (file)
@@ -6,9 +6,8 @@ math memory namespaces words ;
 
 \ slot [
     PEEK-DS
-    ( EAX [ EAX 3 ] MOV )
     2unlist type-tag >r cell * r> - EAX swap 2list EAX swap MOV
-    [ ECX ] EAX MOV
+    [ ESI ] EAX MOV
 ] "generator" set-word-property
 
 : compile-call-label ( label -- )
index 8c49b996d8e45aa5667d58b3933fac90e60165eb..d52e379eeadab1b1f2cb75f3b53ea1bc53535c5c 100644 (file)
@@ -3,15 +3,6 @@
 IN: compiler
 USING: inference kernel assembler words lists alien memory ;
 
-: rel-ds ( -- )
-    #! Add an entry to the relocation table for the 32-bit
-    #! immediate just compiled.
-    "ds" f f rel-dlsym ;
-
-: DS ( -- [ address ] ) "ds" f dlsym unit ;
-: DS> ( register -- ) DS MOV rel-ds ;
-: >DS ( register -- ) DS swap MOV rel-ds ;
-
 : rel-cs ( -- )
     #! Add an entry to the relocation table for the 32-bit
     #! immediate just compiled.
@@ -23,20 +14,17 @@ USING: inference kernel assembler words lists alien memory ;
 
 : PEEK-DS ( -- )
     #! Peek datastack to EAX.
-    ECX DS>
-    EAX [ ECX ] MOV ;
+    EAX [ ESI ] MOV ;
 
 : POP-DS ( -- )
     #! Pop datastack to EAX.
     PEEK-DS
-    ECX 4 SUB
-    ECX >DS ;
+    ESI 4 SUB ;
 
 : PUSH-DS ( -- )
     #! Push EAX to datastack.
-    ECX 4 ADD
-    [ ECX ] EAX MOV
-    ECX >DS ;
+    ESI 4 ADD
+    [ ESI ] EAX MOV ;
 
 : PEEK-CS ( -- )
     #! Peek return stack to EAX.
@@ -56,41 +44,33 @@ USING: inference kernel assembler words lists alien memory ;
     ECX >CS ;
 
 : immediate-literal ( obj -- )
-    [ ECX ] swap address MOV ;
+    [ ESI ] swap address MOV ;
 
 : indirect-literal ( obj -- )
-    ( EAX [ obj ] MOV )
     EAX swap intern-literal unit MOV  rel-address ;
 
 #push-immediate [
-    ECX DS>
-    ECX 4 ADD
+    ESI 4 ADD
     immediate-literal
-    ECX >DS
 ] "generator" set-word-property
 
 #push-indirect [
-    ECX DS>
     indirect-literal
     PUSH-DS
 ] "generator" set-word-property
 
 #replace-immediate [
-    ECX DS>
     immediate-literal
 ] "generator" set-word-property
 
 #replace-indirect [
-    ECX DS>
     indirect-literal
-    [ ECX ] EAX MOV
+    [ ESI ] EAX MOV
 ] "generator" set-word-property
 
 \ drop [
     drop
-    ECX DS>
-    ECX 4 SUB
-    ECX >DS
+    ESI 4 SUB
 ] "generator" set-word-property
 
 \ dup [
@@ -101,24 +81,21 @@ USING: inference kernel assembler words lists alien memory ;
 
 \ swap [
     drop
-    ECX DS>
-    EAX [ ECX ] MOV
-    EDX [ ECX -4 ] MOV
-    [ ECX ] EDX MOV
-    [ ECX -4 ] EAX MOV
+    EAX [ ESI ] MOV
+    EDX [ ESI -4 ] MOV
+    [ ESI ] EDX MOV
+    [ ESI -4 ] EAX MOV
 ] "generator" set-word-property
 
 \ over [
     drop
-    ECX DS>
-    EAX [ ECX -4 ] MOV
+    EAX [ ESI -4 ] MOV
     PUSH-DS
 ] "generator" set-word-property
 
 \ pick [
     drop
-    ECX DS>
-    EAX [ ECX -8 ] MOV
+    EAX [ ESI -8 ] MOV
     PUSH-DS
 ] "generator" set-word-property
 
@@ -132,6 +109,5 @@ USING: inference kernel assembler words lists alien memory ;
 \ r> [
     drop
     POP-CS
-    ECX DS>
     PUSH-DS
 ] "generator" set-word-property
index dc1e0143e090788362cededc8d58c808281fbb2b..1dc542d37b9c517a1a4df29597e44006f16c301d 100644 (file)
@@ -19,7 +19,7 @@ typedef unsigned long int CELL;
 CELL ds_bot;
 
 /* raw pointer to datastack top */
-DLLEXPORT CELL ds;
+register DLLEXPORT CELL ds asm("esi");
 
 /* raw pointer to callstack bottom */
 CELL cs_bot;