2 Copyright (C) 2001-2003, The Perl Foundation.
7 src/cpu_dep.c - CPU-dependent functions
11 These functions are called while stackwalking during dead object
12 destruction. They implement conditional CPU-specific behaviour related
13 to register windowing.
15 Register windowing is a technique which avoids having to empty registers
16 by moving a virtual window up/down the register stack restricting the
17 number of registers which are visible.
19 Remember you read something about it in F<docs/infant.dev>?
29 #include "parrot/parrot.h"
33 # include <ucontext.h>
34 extern void *flush_reg_store(void);
35 # define BACKING_STORE_BASE 0x80000fff80000000
39 static void trace_system_stack(Interp
*interpreter
);
43 =item C<void trace_system_areas(Interp *interpreter)>
45 Traces the system stack and any additional CPU-specific areas.
52 trace_system_areas(Interp
*interpreter
)
54 #if defined(__sparc) /* Flush register windows */
56 unsigned int insns
[4];
60 0x81580000, /* flushw */
62 0x91d02003, /* ta ST_FLUSH_WINDOWS */
64 0x81c3e008, /* retl */
68 static void (*fn_ptr
)(void) = (void (*)(void))&u
.align_hack
[0];
71 #elif defined(__ia64__)
74 void *current_regstore_top
;
77 current_regstore_top
= flush_reg_store();
79 trace_mem_block(interpreter
, 0x80000fff80000000,
80 (size_t)current_regstore_top
);
83 # ifdef PARROT_HAS_HEADER_SETJMP
86 /* Zero the Parrot_jump_buff, otherwise you will trace stale objects */
87 memset(&env
, 0, sizeof(env
));
89 /* this should put registers in env, which then get marked in
90 * trace_system_stack below
98 trace_system_stack(interpreter
);
104 trace_system_stack(Interp *interpreter)>
106 Traces the memory block starting at C<< interpreter->lo_var_ptr >>.
113 trace_system_stack(Interp
*interpreter
)
115 size_t lo_var_ptr
= (size_t)interpreter
->lo_var_ptr
;
117 trace_mem_block(interpreter
, (size_t)lo_var_ptr
,
118 (size_t)&lo_var_ptr
);
127 F<src/dod.c>, F<include/parrot/dod.h> and F<docs/infant.dev>.
136 * c-file-style: "parrot"
138 * vim: expandtab shiftwidth=4: