ds is in esi now

cvs
Slava Pestov 2005-02-17 04:24:35 +00:00
parent e92757e93c
commit 9eb0046f09
5 changed files with 48 additions and 82 deletions

View File

@ -1,36 +1,38 @@
72/73: 72/73:
- [ [ dup call ] dup call ] infer hangs
- move tuple to generic vocab
- update plugin docs - update plugin docs
- word preview for remote words - word preview for remote words
- vectors: ensure its ok with bignum indices - faster completion
- code gc
- [ [ dup call ] dup call ] infer hangs
- type inference fails with some assembler words; - type inference fails with some assembler words;
displaced, register and other predicates need to inherit from list displaced, register and other predicates need to inherit from list
not cons, and need stronger branch partial eval not cons, and need stronger branch partial eval
- print warning on null class - print warning on null class
- optimize away dispatch - optimize away dispatch
- faster completion
- move tuple to generic vocab
- vectors: ensure its ok with bignum indices
- code gc
- ppc register decls - ppc register decls
- unit test failure
- #jump-f #jump-f-label
- extract word inside M:, C:, and structure browsing for these - extract word inside M:, C:, and structure browsing for these
- fix checkbox alignment - fix checkbox alignment
- begin-scan, next-object, end-scan primitives - begin-scan, next-object, end-scan primitives
- each-object, each-slot combinators - each-object, each-slot combinators
- port leak
- references primitive - references primitive
- ditch % for tuples? - ditch % for tuples?
- resize window: world not updated until mouse moved - resize window: world not updated until mouse moved
- x>offset - x>offset
- fix completion invoke in middle of word - fix completion invoke in middle of word
- html: word links
- don't hardcode so many colors - don't hardcode so many colors
- ffi unicode strings: null char security hole - ffi unicode strings: null char security hole
- utf16 string boxing - utf16 string boxing
- slot compile problem - slot compile problem
- sdl console crash - sdl console crash
- x86 register decl
- UI: don't roll over if mouse button is down - UI: don't roll over if mouse button is down
+ compiler/ffi: + compiler/ffi:

View File

@ -47,16 +47,14 @@ USE: math-internals
: fixnum-insn ( overflow opcode -- ) : fixnum-insn ( overflow opcode -- )
#! This needs to be factored. #! This needs to be factored.
ECX DS> EAX [ ESI -4 ] MOV
EAX [ ECX -4 ] MOV EAX [ ESI ] rot execute
EAX [ ECX ] rot execute
0 JNO fixup 0 JNO fixup
swap compile-call swap compile-call
0 JMP fixup >r 0 JMP fixup >r
compiled-offset swap patch compiled-offset swap patch
ECX 4 SUB ESI 4 SUB
[ ECX ] EAX MOV [ ESI ] EAX MOV
ECX >DS
r> compiled-offset swap patch ; r> compiled-offset swap patch ;
\ fixnum+ [ \ fixnum+ [
@ -73,17 +71,15 @@ USE: math-internals
\ fixnum* [ \ fixnum* [
drop drop
ECX DS> EAX [ ESI -4 ] MOV
EAX [ ECX -4 ] MOV
EAX 3 SHR EAX 3 SHR
EAX [ ECX ] IMUL EAX [ ESI ] IMUL
0 JNO fixup 0 JNO fixup
\ fixnum* compile-call \ fixnum* compile-call
0 JMP fixup >r 0 JMP fixup >r
compiled-offset swap patch compiled-offset swap patch
ECX 4 SUB ESI 4 SUB
[ ECX ] EAX MOV [ ESI ] EAX MOV
ECX >DS
r> compiled-offset swap patch r> compiled-offset swap patch
] "generator" set-word-property ] "generator" set-word-property
@ -91,18 +87,16 @@ USE: math-internals
\ fixnum/i [ \ fixnum/i [
drop drop
ECX DS> EAX [ ESI -4 ] MOV
EAX [ ECX -4 ] MOV
CDQ CDQ
[ ECX ] IDIV [ ESI ] IDIV
EAX 3 SHL EAX 3 SHL
0 JNO fixup 0 JNO fixup
\ fixnum/i compile-call \ fixnum/i compile-call
0 JMP fixup >r 0 JMP fixup >r
compiled-offset swap patch compiled-offset swap patch
ECX 4 SUB ESI 4 SUB
[ ECX ] EAX MOV [ ESI ] EAX MOV
ECX >DS
r> compiled-offset swap patch r> compiled-offset swap patch
] "generator" set-word-property ] "generator" set-word-property
@ -110,18 +104,16 @@ USE: math-internals
\ fixnum-mod [ \ fixnum-mod [
drop drop
ECX DS> EAX [ ESI -4 ] MOV
EAX [ ECX -4 ] MOV
CDQ CDQ
[ ECX ] IDIV [ ESI ] IDIV
EAX 3 SHL EAX 3 SHL
0 JNO fixup 0 JNO fixup
\ fixnum/i compile-call \ fixnum/i compile-call
0 JMP fixup >r 0 JMP fixup >r
compiled-offset swap patch compiled-offset swap patch
ECX 4 SUB ESI 4 SUB
[ ECX ] EDX MOV [ ESI ] EDX MOV
ECX >DS
r> compiled-offset swap patch r> compiled-offset swap patch
] "generator" set-word-property ] "generator" set-word-property
@ -129,18 +121,16 @@ USE: math-internals
\ fixnum/mod [ \ fixnum/mod [
drop drop
ECX DS> EAX [ ESI -4 ] MOV
EAX [ ECX -4 ] MOV
CDQ CDQ
[ ECX ] IDIV [ ESI ] IDIV
EAX 3 SHL EAX 3 SHL
0 JNO fixup 0 JNO fixup
\ fixnum/mod compile-call \ fixnum/mod compile-call
0 JMP fixup >r 0 JMP fixup >r
compiled-offset swap patch compiled-offset swap patch
[ ECX -4 ] EAX MOV [ ESI -4 ] EAX MOV
[ ECX ] EDX MOV [ ESI ] EDX MOV
ECX >DS
r> compiled-offset swap patch r> compiled-offset swap patch
] "generator" set-word-property ] "generator" set-word-property
@ -148,10 +138,9 @@ USE: math-internals
\ arithmetic-type [ \ arithmetic-type [
drop drop
ECX DS> EAX [ ESI -4 ] MOV
EAX [ ECX -4 ] MOV
EAX BIN: 111 AND EAX BIN: 111 AND
EDX [ ECX ] MOV EDX [ ESI ] MOV
EDX BIN: 111 AND EDX BIN: 111 AND
EAX EDX CMP EAX EDX CMP
0 JE fixup >r 0 JE fixup >r

View File

@ -6,9 +6,8 @@ math memory namespaces words ;
\ slot [ \ slot [
PEEK-DS PEEK-DS
( EAX [ EAX 3 ] MOV )
2unlist type-tag >r cell * r> - EAX swap 2list EAX swap MOV 2unlist type-tag >r cell * r> - EAX swap 2list EAX swap MOV
[ ECX ] EAX MOV [ ESI ] EAX MOV
] "generator" set-word-property ] "generator" set-word-property
: compile-call-label ( label -- ) : compile-call-label ( label -- )

View File

@ -3,15 +3,6 @@
IN: compiler IN: compiler
USING: inference kernel assembler words lists alien memory ; 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 ( -- ) : rel-cs ( -- )
#! Add an entry to the relocation table for the 32-bit #! Add an entry to the relocation table for the 32-bit
#! immediate just compiled. #! immediate just compiled.
@ -23,20 +14,17 @@ USING: inference kernel assembler words lists alien memory ;
: PEEK-DS ( -- ) : PEEK-DS ( -- )
#! Peek datastack to EAX. #! Peek datastack to EAX.
ECX DS> EAX [ ESI ] MOV ;
EAX [ ECX ] MOV ;
: POP-DS ( -- ) : POP-DS ( -- )
#! Pop datastack to EAX. #! Pop datastack to EAX.
PEEK-DS PEEK-DS
ECX 4 SUB ESI 4 SUB ;
ECX >DS ;
: PUSH-DS ( -- ) : PUSH-DS ( -- )
#! Push EAX to datastack. #! Push EAX to datastack.
ECX 4 ADD ESI 4 ADD
[ ECX ] EAX MOV [ ESI ] EAX MOV ;
ECX >DS ;
: PEEK-CS ( -- ) : PEEK-CS ( -- )
#! Peek return stack to EAX. #! Peek return stack to EAX.
@ -56,41 +44,33 @@ USING: inference kernel assembler words lists alien memory ;
ECX >CS ; ECX >CS ;
: immediate-literal ( obj -- ) : immediate-literal ( obj -- )
[ ECX ] swap address MOV ; [ ESI ] swap address MOV ;
: indirect-literal ( obj -- ) : indirect-literal ( obj -- )
( EAX [ obj ] MOV )
EAX swap intern-literal unit MOV rel-address ; EAX swap intern-literal unit MOV rel-address ;
#push-immediate [ #push-immediate [
ECX DS> ESI 4 ADD
ECX 4 ADD
immediate-literal immediate-literal
ECX >DS
] "generator" set-word-property ] "generator" set-word-property
#push-indirect [ #push-indirect [
ECX DS>
indirect-literal indirect-literal
PUSH-DS PUSH-DS
] "generator" set-word-property ] "generator" set-word-property
#replace-immediate [ #replace-immediate [
ECX DS>
immediate-literal immediate-literal
] "generator" set-word-property ] "generator" set-word-property
#replace-indirect [ #replace-indirect [
ECX DS>
indirect-literal indirect-literal
[ ECX ] EAX MOV [ ESI ] EAX MOV
] "generator" set-word-property ] "generator" set-word-property
\ drop [ \ drop [
drop drop
ECX DS> ESI 4 SUB
ECX 4 SUB
ECX >DS
] "generator" set-word-property ] "generator" set-word-property
\ dup [ \ dup [
@ -101,24 +81,21 @@ USING: inference kernel assembler words lists alien memory ;
\ swap [ \ swap [
drop drop
ECX DS> EAX [ ESI ] MOV
EAX [ ECX ] MOV EDX [ ESI -4 ] MOV
EDX [ ECX -4 ] MOV [ ESI ] EDX MOV
[ ECX ] EDX MOV [ ESI -4 ] EAX MOV
[ ECX -4 ] EAX MOV
] "generator" set-word-property ] "generator" set-word-property
\ over [ \ over [
drop drop
ECX DS> EAX [ ESI -4 ] MOV
EAX [ ECX -4 ] MOV
PUSH-DS PUSH-DS
] "generator" set-word-property ] "generator" set-word-property
\ pick [ \ pick [
drop drop
ECX DS> EAX [ ESI -8 ] MOV
EAX [ ECX -8 ] MOV
PUSH-DS PUSH-DS
] "generator" set-word-property ] "generator" set-word-property
@ -132,6 +109,5 @@ USING: inference kernel assembler words lists alien memory ;
\ r> [ \ r> [
drop drop
POP-CS POP-CS
ECX DS>
PUSH-DS PUSH-DS
] "generator" set-word-property ] "generator" set-word-property

View File

@ -19,7 +19,7 @@ typedef unsigned long int CELL;
CELL ds_bot; CELL ds_bot;
/* raw pointer to datastack top */ /* raw pointer to datastack top */
DLLEXPORT CELL ds; register DLLEXPORT CELL ds asm("esi");
/* raw pointer to callstack bottom */ /* raw pointer to callstack bottom */
CELL cs_bot; CELL cs_bot;