1 ! Copyright (C) 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: bootstrap.image.private compiler.constants
4 compiler.codegen.relocation cpu.x86.assembler
5 cpu.x86.assembler.operands kernel layouts locals parser
9 : tib-segment ( -- ) FS ;
10 : tib-temp ( -- reg ) EAX ;
12 << "vocab:bootstrap/assembler/x86.windows.factor" parse-file suffix! >> call
14 : jit-install-seh ( -- )
15 ! Create a new exception record and store it in the TIB.
18 ESP 3 bootstrap-cells ADD
19 ! Exception handler address filled in by callback.cpp
20 tib-temp 0 MOV rc-absolute-cell rel-exception-handler
24 ! This is the new exception handler
25 tib-exception-list-offset [] ESP tib-segment MOV ;
27 :: jit-update-seh ( ctx-reg -- )
28 ! Load exception record structure that jit-install-seh
29 ! created from the bottom of the callstack.
31 tib-temp ctx-reg context-callstack-bottom-offset [+] MOV
32 tib-temp bootstrap-cell ADD
33 ! Store exception record in TIB.
34 tib-exception-list-offset [] tib-temp tib-segment MOV ;
36 << "vocab:bootstrap/assembler/x86.32.factor" parse-file suffix! >> call
37 << "vocab:bootstrap/assembler/x86.factor" parse-file suffix! >> call