]> gitweb.factorcode.org Git - factor.git/blob - basis/bootstrap/assembler/x86.32.windows.factor
factor: trim using lists
[factor.git] / basis / bootstrap / assembler / x86.32.windows.factor
1 ! Copyright (C) 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: compiler.codegen.relocation compiler.constants cpu.x86.assembler
4 cpu.x86.assembler.operands kernel kernel.private layouts parser
5 sequences ;
6 IN: bootstrap.x86
7
8 : tib-segment ( -- ) FS ;
9 : tib-temp ( -- reg ) EAX ;
10
11 << "vocab:bootstrap/assembler/x86.windows.factor" parse-file suffix! >> call
12
13 : jit-install-seh ( -- )
14     ! VM pointer must be in vm-reg already
15     ! Create a new exception record and store it in the TIB.
16     ! Clobbers tib-temp.
17     ! Align stack
18     ESP 3 bootstrap-cells ADD
19     tib-temp EBX WIN-EXCEPTION-HANDLER vm-special-object-offset [+] MOV
20     tib-temp tib-temp alien-offset [+] MOV
21     tib-temp PUSH
22
23     ! No next handler
24     0 PUSH
25     ! This is the new exception handler
26     tib-exception-list-offset [] ESP tib-segment MOV ;
27
28 :: jit-update-seh ( ctx-reg -- )
29     ! Load exception record structure that jit-install-seh
30     ! created from the bottom of the callstack.
31     ! Clobbers tib-temp.
32     tib-temp ctx-reg context-callstack-bottom-offset [+] MOV
33     tib-temp bootstrap-cell ADD
34     ! Store exception record in TIB.
35     tib-exception-list-offset [] tib-temp tib-segment MOV ;
36
37 << "vocab:bootstrap/assembler/x86.32.factor" parse-file suffix! >> call
38 << "vocab:bootstrap/assembler/x86.factor" parse-file suffix! >> call