StgMiscClosures.h 9.9 KB
Newer Older
1
/* -----------------------------------------------------------------------------
2
 * $Id: StgMiscClosures.h,v 1.47 2003/03/27 13:54:31 simonmar Exp $
3
 *
4
 * (c) The GHC Team, 1998-2002
5 6 7 8 9 10 11 12 13 14
 *
 * 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.
 */

15 16
/* Various entry points */
STGFUN(stg_PAP_entry);
17
STGFUN(stg_BCO_entry);
18 19

/* Entry code for constructors created by the bytecode interpreter */
20 21 22 23 24 25 26 27 28
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);
29 30

/* Magic glue code for when compiled code returns a value in R1/F1/D1
31
   or a VoidRep to the interpreter. */
32 33 34 35 36 37 38
extern DLL_IMPORT_RTS const StgPolyInfoTable stg_ctoi_ret_R1p_info;
extern DLL_IMPORT_RTS const StgRetInfoTable stg_ctoi_ret_R1unpt_info;
extern DLL_IMPORT_RTS const StgRetInfoTable stg_ctoi_ret_R1n_info;
extern DLL_IMPORT_RTS const StgRetInfoTable stg_ctoi_ret_F1_info;
extern DLL_IMPORT_RTS const StgRetInfoTable stg_ctoi_ret_D1_info;
extern DLL_IMPORT_RTS const StgRetInfoTable stg_ctoi_ret_L1_info;
extern DLL_IMPORT_RTS const StgRetInfoTable stg_ctoi_ret_V_info;
rje's avatar
rje committed
39

40
extern DLL_IMPORT_RTS const StgRetInfoTable stg_apply_interp_info;
41

42 43 44 45
/* 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)
46 47
#if defined(PAR) || defined(GRAN)
/* this is the NIL ptr for a blocking queue */
48
# define END_BQ_QUEUE  ((StgBlockingQueueElement *)(void*)&stg_END_TSO_QUEUE_closure)
49
/* this is the NIL ptr for a blocked fetch queue (as in PendingFetches in GUM) */
50
# define END_BF_QUEUE  ((StgBlockedFetch *)(void*)&stg_END_TSO_QUEUE_closure)
51
#endif
52
/* ToDo?: different name for end of sleeping queue ? -- HWL */
53

54 55
/* info tables */

56
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_info;
57 58 59 60 61 62 63 64 65
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_direct_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_0_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_1_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_2_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_3_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_4_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_5_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_6_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_7_info;
66 67 68 69 70 71 72
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;
73
extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_BLACKHOLE_info;
74
extern DLL_IMPORT_RTS const StgInfoTable stg_BLACKHOLE_BQ_info;
75
#ifdef SMP
76
extern DLL_IMPORT_RTS const StgInfoTable stg_WHITEHOLE_info;
77
#endif
78
#ifdef TICKY_TICKY
79
extern DLL_IMPORT_RTS const StgInfoTable stg_SE_BLACKHOLE_info;
80
extern DLL_IMPORT_RTS const StgInfoTable stg_SE_CAF_BLACKHOLE_info;
81
#endif
82
#if defined(PAR) || defined(GRAN)
83
extern DLL_IMPORT_RTS const StgInfoTable stg_RBH_info;
84
#endif
85 86 87
#if defined(PAR)
extern DLL_IMPORT_RTS const StgInfoTable stg_FETCH_ME_BQ_info;
#endif
88
extern DLL_IMPORT_RTS const StgFunInfoTable stg_BCO_info;
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
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;
106 107 108 109
extern DLL_IMPORT_RTS const StgPolyInfoTable stg_seq_frame_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_PAP_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_AP_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_AP_STACK_info;
110
extern DLL_IMPORT_RTS const StgInfoTable stg_dummy_ret_info;
111 112 113
extern DLL_IMPORT_RTS const StgInfoTable stg_raise_info;
extern DLL_IMPORT_RTS const StgRetInfoTable stg_forceIO_info;
extern DLL_IMPORT_RTS const StgRetInfoTable stg_noforceIO_info;
114 115
/* closures */

116 117 118 119 120
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;
121

122 123
extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_CHARLIKE_closure[];
extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_INTLIKE_closure[];
124 125


126
/* standard entry points */
127

128 129
/* standard selector thunks */

130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
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;
164

165 166
  /* and their standard entry points  -- KSW 1998-12 */

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 194 195 196 197 198 199 200
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);
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 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
// standard ap thunks

ETI_RTS stg_ap_1_upd_info;
ETI_RTS stg_ap_2_upd_info;
ETI_RTS stg_ap_3_upd_info;
ETI_RTS stg_ap_4_upd_info;
ETI_RTS stg_ap_5_upd_info;
ETI_RTS stg_ap_6_upd_info;
ETI_RTS stg_ap_7_upd_info;
ETI_RTS stg_ap_8_upd_info;

// standard application routines (see also rts/gen_apply.py, 
// and compiler/codeGen/CgStackery.lhs).

extern DLL_IMPORT_RTS const StgPolyInfoTable stg_ap_0_info;
ERI_(stg_ap_v_info);
ERI_(stg_ap_f_info);
ERI_(stg_ap_d_info);
ERI_(stg_ap_l_info);
ERI_(stg_ap_n_info);
ERI_(stg_ap_p_info);
ERI_(stg_ap_pv_info);
ERI_(stg_ap_pp_info);
ERI_(stg_ap_ppv_info);
ERI_(stg_ap_ppp_info);
ERI_(stg_ap_pppp_info);
ERI_(stg_ap_ppppp_info);
ERI_(stg_ap_pppppp_info);
ERI_(stg_ap_ppppppp_info);

EXTFUN(stg_ap_0_ret);
EXTFUN(stg_ap_v_ret);
EXTFUN(stg_ap_f_ret);
EXTFUN(stg_ap_d_ret);
EXTFUN(stg_ap_l_ret);
EXTFUN(stg_ap_n_ret);
EXTFUN(stg_ap_p_ret);
EXTFUN(stg_ap_pv_ret);
EXTFUN(stg_ap_pp_ret);
EXTFUN(stg_ap_ppv_ret);
EXTFUN(stg_ap_ppp_ret);
EXTFUN(stg_ap_pppp_ret);
EXTFUN(stg_ap_ppppp_ret);
EXTFUN(stg_ap_pppppp_ret);
EXTFUN(stg_ap_ppppppp_ret);

/* standard GC & stack check entry points, all defined in HeapStackCheck.hc */

ERI_(stg_enter_info);
EF_(stg_enter_ret);

ERI_(stg_gc_void_info);

EF_(__stg_gc_enter_1);

257 258
EF_(stg_gc_noregs);

259
ERI_(stg_gc_unpt_r1_info);
260 261
EF_(stg_gc_unpt_r1);

262
ERI_(stg_gc_unbx_r1_info);
263 264
EF_(stg_gc_unbx_r1);

265
ERI_(stg_gc_f1_info);
266 267
EF_(stg_gc_f1);

268
ERI_(stg_gc_d1_info);
269 270
EF_(stg_gc_d1);

271
ERI_(stg_gc_l1_info);
chak's avatar
chak committed
272
EF_(stg_gc_l1);
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293

EF_(__stg_gc_fun);
ERI_(stg_gc_fun_info);
EF_(stg_gc_fun_ret);

EF_(stg_gc_gen);
ERI_(stg_gc_gen_info);

EF_(stg_ut_1_0_unreg_ret);
ERI_(stg_ut_1_0_unreg_info);

EF_(stg_gc_gen_hp);
EF_(stg_gc_ut);
EF_(stg_gen_yield);
EF_(stg_yield_noregs);
EF_(stg_yield_to_interpreter);
EF_(stg_gen_block);
EF_(stg_block_noregs);
EF_(stg_block_1);
EF_(stg_block_takemvar);
EF_(stg_block_putmvar);
sof's avatar
sof committed
294 295 296
#ifdef mingw32_TARGET_OS
EF_(stg_block_async);
#endif