StgMiscClosures.h 9.71 KB
Newer Older
1
/* -----------------------------------------------------------------------------
sof's avatar
sof committed
2
 * $Id: StgMiscClosures.h,v 1.43 2002/03/02 17:46:03 sof Exp $
3 4
 *
 * (c) The GHC Team, 1998-1999
5 6 7 8 9 10 11 12 13 14 15 16
 *
 * Entry code for various built-in closure types.
 *
 * ---------------------------------------------------------------------------*/

/* The naming scheme here follows the naming scheme for closure types
 * defined in InfoTables.h.  The actual info tables and entry code for
 * these objects can be found in StgMiscClosures.hc.
 */

/* entry code */

17 18 19 20 21 22 23 24
STGFUN(stg_IND_entry);
STGFUN(stg_IND_STATIC_entry);
STGFUN(stg_IND_PERM_entry);
STGFUN(stg_IND_OLDGEN_entry);
STGFUN(stg_IND_OLDGEN_PERM_entry);
STGFUN(stg_CAF_UNENTERED_entry);
STGFUN(stg_CAF_ENTERED_entry);
STGFUN(stg_BLACKHOLE_entry);
25
STGFUN(stg_CAF_BLACKHOLE_entry);
26
STGFUN(stg_BLACKHOLE_BQ_entry);
27
#ifdef SMP
28
STGFUN(stg_WHITEHOLE_entry);
29
#endif
30
#ifdef TICKY_TICKY
31
STGFUN(stg_SE_BLACKHOLE_entry);
32
STGFUN(stg_SE_CAF_BLACKHOLE_entry);
33
#endif
34
#if defined(PAR) || defined(GRAN)
35
STGFUN(stg_RBH_entry);
36
#endif
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
STGFUN(stg_BCO_entry);
STGFUN(stg_EVACUATED_entry);
STGFUN(stg_FOREIGN_entry);
STGFUN(stg_WEAK_entry);
STGFUN(stg_NO_FINALIZER_entry);
STGFUN(stg_DEAD_WEAK_entry);
STGFUN(stg_STABLE_NAME_entry);
STGFUN(stg_TSO_entry);
STGFUN(stg_FULL_MVAR_entry);
STGFUN(stg_EMPTY_MVAR_entry);
STGFUN(stg_ARR_WORDS_entry);
STGFUN(stg_MUT_ARR_PTRS_entry);
STGFUN(stg_MUT_ARR_PTRS_FROZEN_entry);
STGFUN(stg_MUT_VAR_entry);
STGFUN(stg_END_TSO_QUEUE_entry);
STGFUN(stg_MUT_CONS_entry);
STGFUN(stg_END_MUT_LIST_entry);
STGFUN(stg_dummy_ret_entry);
55

56
/* entry code for constructors created by the bytecode interpreter */
57 58 59 60 61 62 63 64 65
STGFUN(stg_interp_constr_entry);
STGFUN(stg_interp_constr1_entry);
STGFUN(stg_interp_constr2_entry);
STGFUN(stg_interp_constr3_entry);
STGFUN(stg_interp_constr4_entry);
STGFUN(stg_interp_constr5_entry);
STGFUN(stg_interp_constr6_entry);
STGFUN(stg_interp_constr7_entry);
STGFUN(stg_interp_constr8_entry);
66 67

/* Magic glue code for when compiled code returns a value in R1/F1/D1
68
   or a VoidRep to the interpreter. */
69 70
extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_R1p_info;
extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_R1n_info;
71 72
extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_F1_info;
extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_D1_info;
73
extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_V_info;
74 75 76

/* Used by the interpreter to return an unboxed value on the stack to
   compiled code. */
rje's avatar
rje committed
77 78 79 80 81
extern DLL_IMPORT_RTS const StgInfoTable stg_gc_unbx_r1_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_gc_f1_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_gc_d1_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_gc_l1_info;

82

83 84 85 86
/* this is the NIL ptr for a TSO queue (e.g. runnable queue) */
#define END_TSO_QUEUE  ((StgTSO *)(void*)&stg_END_TSO_QUEUE_closure)
/* this is the NIL ptr for a list CAFs */
#define END_ECAF_LIST   ((StgCAF *)(void*)&stg_END_TSO_QUEUE_closure)
87 88
#if defined(PAR) || defined(GRAN)
/* this is the NIL ptr for a blocking queue */
89
# define END_BQ_QUEUE  ((StgBlockingQueueElement *)(void*)&stg_END_TSO_QUEUE_closure)
90
/* this is the NIL ptr for a blocked fetch queue (as in PendingFetches in GUM) */
91
# define END_BF_QUEUE  ((StgBlockedFetch *)(void*)&stg_END_TSO_QUEUE_closure)
92
#endif
93
/* ToDo?: different name for end of sleeping queue ? -- HWL */
94

95 96
/* info tables */

97 98 99 100 101 102 103 104
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_STATIC_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_PERM_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_OLDGEN_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_OLDGEN_PERM_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_UNENTERED_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_ENTERED_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_BLACKHOLE_info;
105
extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_BLACKHOLE_info;
106
extern DLL_IMPORT_RTS const StgInfoTable stg_BLACKHOLE_BQ_info;
107
#ifdef SMP
108
extern DLL_IMPORT_RTS const StgInfoTable stg_WHITEHOLE_info;
109
#endif
110
#ifdef TICKY_TICKY
111
extern DLL_IMPORT_RTS const StgInfoTable stg_SE_BLACKHOLE_info;
112
extern DLL_IMPORT_RTS const StgInfoTable stg_SE_CAF_BLACKHOLE_info;
113
#endif
114
#if defined(PAR) || defined(GRAN)
115
extern DLL_IMPORT_RTS const StgInfoTable stg_RBH_info;
116
#endif
117 118 119
#if defined(PAR)
extern DLL_IMPORT_RTS const StgInfoTable stg_FETCH_ME_BQ_info;
#endif
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
extern DLL_IMPORT_RTS const StgInfoTable stg_BCO_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_EVACUATED_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_FOREIGN_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_WEAK_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_DEAD_WEAK_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_STABLE_NAME_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_FULL_MVAR_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_EMPTY_MVAR_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_TSO_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_ARR_WORDS_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_MUT_ARR_WORDS_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_MUT_ARR_PTRS_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_MUT_ARR_PTRS_FROZEN_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_MUT_VAR_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_END_TSO_QUEUE_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_MUT_CONS_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_END_MUT_LIST_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_catch_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_seq_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_dummy_ret_info;
140 141 142

/* closures */

143 144 145 146 147
extern DLL_IMPORT_RTS StgClosure stg_END_TSO_QUEUE_closure;
extern DLL_IMPORT_RTS StgClosure stg_END_MUT_LIST_closure;
extern DLL_IMPORT_RTS StgClosure stg_NO_FINALIZER_closure;
extern DLL_IMPORT_RTS StgClosure stg_dummy_ret_closure;
extern DLL_IMPORT_RTS StgClosure stg_forceIO_closure;
148

149 150
extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_CHARLIKE_closure[];
extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_INTLIKE_closure[];
151 152 153

/* standard entry points */

rrt's avatar
rrt committed
154
/* EXTFUN_RTS(stg_error_entry); No longer used */
155

156 157
  /* (see also below  -- KSW 1998-12) */

158 159
/* standard selector thunks */

160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
EXTINFO_RTS stg_sel_0_upd_info;
EXTINFO_RTS stg_sel_1_upd_info;
EXTINFO_RTS stg_sel_2_upd_info;
EXTINFO_RTS stg_sel_3_upd_info;
EXTINFO_RTS stg_sel_4_upd_info;
EXTINFO_RTS stg_sel_5_upd_info;
EXTINFO_RTS stg_sel_6_upd_info;
EXTINFO_RTS stg_sel_7_upd_info;
EXTINFO_RTS stg_sel_8_upd_info;
EXTINFO_RTS stg_sel_8_upd_info;
EXTINFO_RTS stg_sel_9_upd_info;
EXTINFO_RTS stg_sel_10_upd_info;
EXTINFO_RTS stg_sel_11_upd_info;
EXTINFO_RTS stg_sel_12_upd_info;
EXTINFO_RTS stg_sel_13_upd_info;
EXTINFO_RTS stg_sel_14_upd_info;
EXTINFO_RTS stg_sel_15_upd_info;

EXTINFO_RTS stg_sel_0_noupd_info;
EXTINFO_RTS stg_sel_1_noupd_info;
EXTINFO_RTS stg_sel_2_noupd_info;
EXTINFO_RTS stg_sel_3_noupd_info;
EXTINFO_RTS stg_sel_4_noupd_info;
EXTINFO_RTS stg_sel_5_noupd_info;
EXTINFO_RTS stg_sel_6_noupd_info;
EXTINFO_RTS stg_sel_7_noupd_info;
EXTINFO_RTS stg_sel_8_noupd_info;
EXTINFO_RTS stg_sel_9_noupd_info;
EXTINFO_RTS stg_sel_10_noupd_info;
EXTINFO_RTS stg_sel_11_noupd_info;
EXTINFO_RTS stg_sel_12_noupd_info;
EXTINFO_RTS stg_sel_13_noupd_info;
EXTINFO_RTS stg_sel_14_noupd_info;
EXTINFO_RTS stg_sel_15_noupd_info;
194

195 196
  /* and their standard entry points  -- KSW 1998-12 */

197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
EXTFUN_RTS(stg_sel_0_upd_entry);
EXTFUN_RTS(stg_sel_1_upd_entry);
EXTFUN_RTS(stg_sel_2_upd_entry);
EXTFUN_RTS(stg_sel_3_upd_entry);
EXTFUN_RTS(stg_sel_4_upd_entry);
EXTFUN_RTS(stg_sel_5_upd_entry);
EXTFUN_RTS(stg_sel_6_upd_entry);
EXTFUN_RTS(stg_sel_7_upd_entry);
EXTFUN_RTS(stg_sel_8_upd_entry);
EXTFUN_RTS(stg_sel_8_upd_entry);
EXTFUN_RTS(stg_sel_9_upd_entry);
EXTFUN_RTS(stg_sel_10_upd_entry);
EXTFUN_RTS(stg_sel_11_upd_entry);
EXTFUN_RTS(stg_sel_12_upd_entry);
EXTFUN_RTS(stg_sel_13_upd_entry);
EXTFUN_RTS(stg_sel_14_upd_entry);
EXTFUN_RTS(stg_sel_15_upd_entry);

EXTFUN_RTS(stg_sel_0_noupd_entry);
EXTFUN_RTS(stg_sel_1_noupd_entry);
EXTFUN_RTS(stg_sel_2_noupd_entry);
EXTFUN_RTS(stg_sel_3_noupd_entry);
EXTFUN_RTS(stg_sel_4_noupd_entry);
EXTFUN_RTS(stg_sel_5_noupd_entry);
EXTFUN_RTS(stg_sel_6_noupd_entry);
EXTFUN_RTS(stg_sel_7_noupd_entry);
EXTFUN_RTS(stg_sel_8_noupd_entry);
EXTFUN_RTS(stg_sel_9_noupd_entry);
EXTFUN_RTS(stg_sel_10_noupd_entry);
EXTFUN_RTS(stg_sel_11_noupd_entry);
EXTFUN_RTS(stg_sel_12_noupd_entry);
EXTFUN_RTS(stg_sel_13_noupd_entry);
EXTFUN_RTS(stg_sel_14_noupd_entry);
EXTFUN_RTS(stg_sel_15_noupd_entry);
231

232 233
/* standard ap thunks */

234 235 236 237 238 239 240 241
EXTINFO_RTS stg_ap_1_upd_info;
EXTINFO_RTS stg_ap_2_upd_info;
EXTINFO_RTS stg_ap_3_upd_info;
EXTINFO_RTS stg_ap_4_upd_info;
EXTINFO_RTS stg_ap_5_upd_info;
EXTINFO_RTS stg_ap_6_upd_info;
EXTINFO_RTS stg_ap_7_upd_info;
EXTINFO_RTS stg_ap_8_upd_info;
242

243 244 245 246 247 248 249 250 251 252 253 254 255 256
/* standard GC & stack check entry points */

EXTFUN(stg_gc_entertop);
EXTFUN(stg_gc_enter_1_hponly);
EXTFUN(__stg_gc_enter_1);
EXTFUN(stg_gc_enter_2);
EXTFUN(stg_gc_enter_3);
EXTFUN(stg_gc_enter_4);
EXTFUN(stg_gc_enter_5);
EXTFUN(stg_gc_enter_6);
EXTFUN(stg_gc_enter_7);
EXTFUN(stg_gc_enter_8);
EXTFUN(stg_gc_seq_1);

rje's avatar
rje committed
257
EI_(stg_gc_noregs_info);
258 259
EF_(stg_gc_noregs);

rje's avatar
rje committed
260
EI_(stg_gc_unpt_r1_info);
261 262
EF_(stg_gc_unpt_r1);

sof's avatar
sof committed
263 264
EI_(stg_ut_1_0_unreg_info);

rje's avatar
rje committed
265
EI_(stg_gc_unbx_r1_info);
266 267
EF_(stg_gc_unbx_r1);

rje's avatar
rje committed
268
EI_(stg_gc_f1_info);
269 270
EF_(stg_gc_f1);

rje's avatar
rje committed
271
EI_(stg_gc_d1_info);
272 273
EF_(stg_gc_d1);

rje's avatar
rje committed
274 275
EI_(stg_gc_ut_1_0_info);
EI_(stg_gc_l1_info);
chak's avatar
chak committed
276
EF_(stg_gc_l1);
277 278
EF_(stg_gc_ut_1_0);

rje's avatar
rje committed
279
EI_(stg_gc_ut_0_1_info);
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
EF_(stg_gc_ut_0_1);

EXTFUN(__stg_chk_0);
EXTFUN(__stg_chk_1);
EXTFUN(stg_chk_1n);
EXTFUN(stg_chk_2);
EXTFUN(stg_chk_3);
EXTFUN(stg_chk_4);
EXTFUN(stg_chk_5);
EXTFUN(stg_chk_6);
EXTFUN(stg_chk_7);
EXTFUN(stg_chk_8);
EXTFUN(stg_gen_chk_ret);
EXTFUN(stg_gen_chk);
EXTFUN(stg_gen_hp);
EXTFUN(stg_gen_yield);
EXTFUN(stg_yield_noregs);
EXTFUN(stg_yield_to_interpreter);
EXTFUN(stg_gen_block);
EXTFUN(stg_block_noregs);
EXTFUN(stg_block_1);
EXTFUN(stg_block_takemvar);
EXTFUN(stg_block_putmvar);