1 ! Copyright (C) 2010 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien alien.accessors alien.c-types alien.syntax kernel
4 kernel.private math system ;
5 IN: javascriptcore.ffi.hack
7 HOOK: set-callstack-bounds os ( -- )
9 HOOK: macosx-callstack-start-offset cpu ( -- address )
10 HOOK: macosx-callstack-size-offset cpu ( -- address )
12 M: ppc macosx-callstack-start-offset 0x188 ;
13 M: ppc macosx-callstack-size-offset 0x18c ;
15 M: x86.32 macosx-callstack-start-offset 0xc48 ;
16 M: x86.32 macosx-callstack-size-offset 0xc4c ;
18 M: x86.64 macosx-callstack-start-offset 0x1860 ;
19 M: x86.64 macosx-callstack-size-offset 0x1868 ;
21 M: object set-callstack-bounds ;
23 FUNCTION: void* pthread_self ( ) ;
25 M: macosx set-callstack-bounds
26 callstack-bounds over [ alien-address ] bi@ -
28 [ macosx-callstack-size-offset set-alien-unsigned-cell ]
29 [ macosx-callstack-start-offset set-alien-cell ] bi ;