diff options
-rw-r--r-- | includes/rts/storage/ClosureMacros.h | 17 | ||||
-rw-r--r-- | rts/Interpreter.c | 2 | ||||
-rw-r--r-- | rts/Printer.c | 6 | ||||
-rw-r--r-- | rts/sm/Evac.c | 10 | ||||
-rw-r--r-- | rts/sm/GCAux.c | 2 |
5 files changed, 22 insertions, 15 deletions
diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h index 146564a17f..8f071a21d7 100644 --- a/includes/rts/storage/ClosureMacros.h +++ b/includes/rts/storage/ClosureMacros.h @@ -46,11 +46,14 @@ -------------------------------------------------------------------------- */ -#define SET_INFO(c,i) ((c)->header.info = (i)) -#define GET_INFO(c) ((c)->header.info) -#define GET_ENTRY(c) (ENTRY_CODE(GET_INFO(c))) +INLINE_HEADER void SET_INFO(StgClosure *c, const StgInfoTable *info) { + c->header.info = info; +} +INLINE_HEADER const StgInfoTable *GET_INFO(StgClosure *c) { + return c->header.info; +} -#define GET_TAG(con) (get_itbl(con)->srt_bitmap) +#define GET_ENTRY(c) (ENTRY_CODE(GET_INFO(c))) #ifdef TABLES_NEXT_TO_CODE EXTERN_INLINE StgInfoTable *INFO_PTR_TO_STRUCT(const StgInfoTable *info); @@ -90,6 +93,10 @@ INLINE_HEADER StgThunkInfoTable *get_thunk_itbl(const StgClosure *c) {return THU INLINE_HEADER StgConInfoTable *get_con_itbl(const StgClosure *c) {return CON_INFO_PTR_TO_STRUCT((c)->header.info);} +INLINE_HEADER StgHalfWord GET_TAG(const StgClosure *con) { + return get_itbl(con)->srt_bitmap; +} + /* ----------------------------------------------------------------------------- Macros for building closures -------------------------------------------------------------------------- */ @@ -142,7 +149,7 @@ INLINE_HEADER StgConInfoTable *get_con_itbl(const StgClosure *c) {return CON_INF // Use when changing a closure from one kind to another #define OVERWRITE_INFO(c, new_info) \ OVERWRITING_CLOSURE((StgClosure *)(c)); \ - SET_INFO((c), (new_info)); \ + SET_INFO((StgClosure *)(c), (new_info)); \ LDV_RECORD_CREATE(c); /* ----------------------------------------------------------------------------- diff --git a/rts/Interpreter.c b/rts/Interpreter.c index f3e070000b..83973e8c9b 100644 --- a/rts/Interpreter.c +++ b/rts/Interpreter.c @@ -339,7 +339,7 @@ eval_obj: { StgUpdateFrame *__frame; __frame = (StgUpdateFrame *)Sp; - SET_INFO(__frame, (StgInfoTable *)&stg_upd_frame_info); + SET_INFO((StgClosure *)__frame, (StgInfoTable *)&stg_upd_frame_info); __frame->updatee = (StgClosure *)(ap); } diff --git a/rts/Printer.c b/rts/Printer.c index 02fbb09962..fb00401f59 100644 --- a/rts/Printer.c +++ b/rts/Printer.c @@ -259,7 +259,7 @@ printClosure( StgClosure *obj ) { StgUpdateFrame* u = (StgUpdateFrame*)obj; debugBelch("UPDATE_FRAME("); - printPtr((StgPtr)GET_INFO(u)); + printPtr((StgPtr)GET_INFO((StgClosure *)u)); debugBelch(","); printPtr((StgPtr)u->updatee); debugBelch(")\n"); @@ -270,7 +270,7 @@ printClosure( StgClosure *obj ) { StgCatchFrame* u = (StgCatchFrame*)obj; debugBelch("CATCH_FRAME("); - printPtr((StgPtr)GET_INFO(u)); + printPtr((StgPtr)GET_INFO((StgClosure *)u)); debugBelch(","); printPtr((StgPtr)u->handler); debugBelch(")\n"); @@ -290,7 +290,7 @@ printClosure( StgClosure *obj ) { StgStopFrame* u = (StgStopFrame*)obj; debugBelch("STOP_FRAME("); - printPtr((StgPtr)GET_INFO(u)); + printPtr((StgPtr)GET_INFO((StgClosure *)u)); debugBelch(")\n"); break; } diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c index 867cef81fb..ed2bc4a8d8 100644 --- a/rts/sm/Evac.c +++ b/rts/sm/Evac.c @@ -794,11 +794,11 @@ unchain_thunk_selectors(StgSelector *p, StgClosure *val) // entered, and should result in a NonTermination exception. ((StgThunk *)p)->payload[0] = val; write_barrier(); - SET_INFO(p, &stg_sel_0_upd_info); + SET_INFO((StgClosure *)p, &stg_sel_0_upd_info); } else { ((StgInd *)p)->indirectee = val; write_barrier(); - SET_INFO(p, &stg_IND_info); + SET_INFO((StgClosure *)p, &stg_IND_info); } // For the purposes of LDV profiling, we have created an @@ -885,7 +885,7 @@ selector_chain: // - if evac, we need to call evacuate(), because we // need the write-barrier stuff. // - undo the chain we've built to point to p. - SET_INFO(p, (const StgInfoTable *)info_ptr); + SET_INFO((StgClosure *)p, (const StgInfoTable *)info_ptr); *q = (StgClosure *)p; if (evac) evacuate(q); unchain_thunk_selectors(prev_thunk_selector, (StgClosure *)p); @@ -895,7 +895,7 @@ selector_chain: #else // Save the real info pointer (NOTE: not the same as get_itbl()). info_ptr = (StgWord)p->header.info; - SET_INFO(p,&stg_WHITEHOLE_info); + SET_INFO((StgClosure *)p,&stg_WHITEHOLE_info); #endif field = INFO_PTR_TO_STRUCT((StgInfoTable *)info_ptr)->layout.selector_offset; @@ -1073,7 +1073,7 @@ selector_loop: bale_out: // We didn't manage to evaluate this thunk; restore the old info // pointer. But don't forget: we still need to evacuate the thunk itself. - SET_INFO(p, (const StgInfoTable *)info_ptr); + SET_INFO((StgClosure *)p, (const StgInfoTable *)info_ptr); // THREADED_RTS: we just unlocked the thunk, so another thread // might get in and update it. copy() will lock it again and // check whether it was updated in the meantime. diff --git a/rts/sm/GCAux.c b/rts/sm/GCAux.c index 12e106b0e0..3df36d7449 100644 --- a/rts/sm/GCAux.c +++ b/rts/sm/GCAux.c @@ -113,7 +113,7 @@ revertCAFs( void ) c != (StgIndStatic *)END_OF_STATIC_LIST; c = (StgIndStatic *)c->static_link) { - SET_INFO(c, c->saved_info); + SET_INFO((StgClosure *)c, c->saved_info); c->saved_info = NULL; // could, but not necessary: c->static_link = NULL; } |