Working on faster (execute)

db4
Slava Pestov 2009-04-25 21:14:59 -05:00
parent 2630c4a95f
commit 27c84e89fe
2 changed files with 22 additions and 9 deletions

View File

@ -137,6 +137,9 @@ SYMBOL: jit-2dip-word
SYMBOL: jit-2dip SYMBOL: jit-2dip
SYMBOL: jit-3dip-word SYMBOL: jit-3dip-word
SYMBOL: jit-3dip SYMBOL: jit-3dip
SYMBOL: jit-execute-word
SYMBOL: jit-execute-jump
SYMBOL: jit-execute-call
SYMBOL: jit-epilog SYMBOL: jit-epilog
SYMBOL: jit-return SYMBOL: jit-return
SYMBOL: jit-profiling SYMBOL: jit-profiling
@ -173,6 +176,9 @@ SYMBOL: undefined-quot
{ jit-2dip 47 } { jit-2dip 47 }
{ jit-3dip-word 48 } { jit-3dip-word 48 }
{ jit-3dip 49 } { jit-3dip 49 }
{ jit-execute-word 50 }
{ jit-execute-jump 51 }
{ jit-execute-call 52 }
{ undefined-quot 60 } { undefined-quot 60 }
} ; inline } ; inline
@ -486,6 +492,7 @@ M: quotation '
\ dip jit-dip-word set \ dip jit-dip-word set
\ 2dip jit-2dip-word set \ 2dip jit-2dip-word set
\ 3dip jit-3dip-word set \ 3dip jit-3dip-word set
\ (execute) jit-execute-word set
[ undefined ] undefined-quot set [ undefined ] undefined-quot set
{ {
jit-code-format jit-code-format
@ -506,6 +513,9 @@ M: quotation '
jit-2dip jit-2dip
jit-3dip-word jit-3dip-word
jit-3dip jit-3dip
jit-execute-word
jit-execute-jump
jit-execute-call
jit-epilog jit-epilog
jit-return jit-return
jit-profiling jit-profiling

View File

@ -151,6 +151,18 @@ big-endian off
jit-3r> jit-3r>
] rc-relative rt-xt 23 rex-length 8 * + jit-3dip jit-define ] rc-relative rt-xt 23 rex-length 8 * + jit-3dip jit-define
: prepare-(execute) ( -- operand )
! load from stack
temp0 ds-reg [] MOV
! pop stack
ds-reg bootstrap-cell SUB
! execute word
temp0 word-xt-offset [+] ;
[ prepare-(execute) JMP ] f f f jit-execute-jump jit-define
[ prepare-(execute) CALL ] f f f jit-execute-call jit-define
[ [
! unwind stack frame ! unwind stack frame
stack-reg stack-frame-size bootstrap-cell - ADD stack-reg stack-frame-size bootstrap-cell - ADD
@ -170,15 +182,6 @@ big-endian off
arg quot-xt-offset [+] JMP arg quot-xt-offset [+] JMP
] f f f \ (call) define-sub-primitive ] f f f \ (call) define-sub-primitive
[
! load from stack
temp0 ds-reg [] MOV
! pop stack
ds-reg bootstrap-cell SUB
! execute word
temp0 word-xt-offset [+] JMP
] f f f \ (execute) define-sub-primitive
! Objects ! Objects
[ [
! load from stack ! load from stack