Paste: 32-bit Windows bootstrap
Author: | slava |
Mode: | factor |
Date: | Sat, 3 Apr 2010 06:33:53 |
Plain Text |
USING: bootstrap.image.private compiler.constants
cpu.x86.assembler cpu.x86.assembler.operands kernel layouts
locals parser sequences ;
IN: bootstrap.x86
: tib-exception-list-offset ( -- n ) 0 bootstrap-cells ;
: tib-stack-base-offset ( -- n ) 1 bootstrap-cells ;
: tib-stack-limit-offset ( -- n ) 2 bootstrap-cells ;
: jit-save-tib ( -- )
tib-exception-list-offset [] FS PUSH
tib-stack-base-offset [] FS PUSH
tib-stack-limit-offset [] FS PUSH ;
: jit-restore-tib ( -- )
tib-stack-limit-offset [] FS POP
tib-stack-base-offset [] FS POP
tib-exception-list-offset [] FS POP ;
:: jit-update-tib ( ctx-reg -- )
EAX ctx-reg context-callstack-seg-offset [+] MOV
EAX EAX segment-end-offset [+] MOV
tib-stack-base-offset [] EAX FS MOV
EAX ctx-reg context-callstack-seg-offset [+] MOV
EAX EAX segment-start-offset [+] MOV
tib-stack-limit-offset [] EAX FS MOV ;
: jit-install-seh ( -- )
ESP 3 bootstrap-cells ADD
0 PUSH rc-absolute-cell rt-dlsym jit-rel
0 PUSH
tib-exception-list-offset [] ESP FS MOV ;
:: jit-update-seh ( ctx-reg -- )
EAX ctx-reg context-callstack-bottom-offset [+] MOV
EAX bootstrap-cell ADD
tib-exception-list-offset [] EAX FS MOV ;
<< "vocab:cpu/x86/32/bootstrap.factor" parse-file suffix! >>
call
New Annotation