diff options
Diffstat (limited to 'includes/rts')
-rw-r--r-- | includes/rts/Constants.h | 24 | ||||
-rw-r--r-- | includes/rts/storage/ClosureMacros.h | 8 | ||||
-rw-r--r-- | includes/rts/storage/ClosureTypes.h | 55 | ||||
-rw-r--r-- | includes/rts/storage/Closures.h | 56 | ||||
-rw-r--r-- | includes/rts/storage/Liveness.h | 34 | ||||
-rw-r--r-- | includes/rts/storage/SMPClosureOps.h | 2 |
6 files changed, 29 insertions, 150 deletions
diff --git a/includes/rts/Constants.h b/includes/rts/Constants.h index cd741be7e0..2fab041c22 100644 --- a/includes/rts/Constants.h +++ b/includes/rts/Constants.h @@ -118,11 +118,6 @@ pushed in one of the heap check fragments in HeapStackCheck.hc (ie. currently the generic heap checks - 3 words for StgRetDyn, 18 words for the saved registers, see StgMacros.h). - - In the event of an unboxed tuple or let-no-escape stack/heap check - failure, there will be other words on the stack which are covered - by the RET_DYN frame. These will have been accounted for by stack - checks however, so we don't need to allow for them here. -------------------------------------------------------------------------- */ #define RESERVED_STACK_WORDS 21 @@ -277,25 +272,6 @@ */ #define TSO_SQUEEZED 128 -/* ----------------------------------------------------------------------------- - RET_DYN stack frames - -------------------------------------------------------------------------- */ - -/* VERY MAGIC CONSTANTS! - * must agree with code in HeapStackCheck.c, stg_gen_chk, and - * RESERVED_STACK_WORDS in Constants.h. - */ -#define RET_DYN_BITMAP_SIZE 8 -#define RET_DYN_NONPTR_REGS_SIZE 10 - -/* Sanity check that RESERVED_STACK_WORDS is reasonable. We can't - * just derive RESERVED_STACK_WORDS because it's used in Haskell code - * too. - */ -#if RESERVED_STACK_WORDS != (3 + RET_DYN_BITMAP_SIZE + RET_DYN_NONPTR_REGS_SIZE) -#error RESERVED_STACK_WORDS may be wrong! -#endif - /* * The number of times we spin in a spin lock before yielding (see * #3758). To tune this value, use the benchmark in #3758: run the diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h index 6fdd55727a..dd5f428135 100644 --- a/includes/rts/storage/ClosureMacros.h +++ b/includes/rts/storage/ClosureMacros.h @@ -410,14 +410,6 @@ EXTERN_INLINE StgWord stack_frame_sizeW( StgClosure *frame ) info = get_ret_itbl(frame); switch (info->i.type) { - case RET_DYN: - { - StgRetDyn *dyn = (StgRetDyn *)frame; - return sizeofW(StgRetDyn) + RET_DYN_BITMAP_SIZE + - RET_DYN_NONPTR_REGS_SIZE + - RET_DYN_PTRS(dyn->liveness) + RET_DYN_NONPTRS(dyn->liveness); - } - case RET_FUN: return sizeofW(StgRetFun) + ((StgRetFun *)frame)->size; diff --git a/includes/rts/storage/ClosureTypes.h b/includes/rts/storage/ClosureTypes.h index 75ec08bf18..4e3b1e6a72 100644 --- a/includes/rts/storage/ClosureTypes.h +++ b/includes/rts/storage/ClosureTypes.h @@ -52,33 +52,32 @@ #define RET_BCO 31 #define RET_SMALL 32 #define RET_BIG 33 -#define RET_DYN 34 -#define RET_FUN 35 -#define UPDATE_FRAME 36 -#define CATCH_FRAME 37 -#define UNDERFLOW_FRAME 38 -#define STOP_FRAME 39 -#define BLOCKING_QUEUE 40 -#define BLACKHOLE 41 -#define MVAR_CLEAN 42 -#define MVAR_DIRTY 43 -#define ARR_WORDS 44 -#define MUT_ARR_PTRS_CLEAN 45 -#define MUT_ARR_PTRS_DIRTY 46 -#define MUT_ARR_PTRS_FROZEN0 47 -#define MUT_ARR_PTRS_FROZEN 48 -#define MUT_VAR_CLEAN 49 -#define MUT_VAR_DIRTY 50 -#define WEAK 51 -#define PRIM 52 -#define MUT_PRIM 53 -#define TSO 54 -#define STACK 55 -#define TREC_CHUNK 56 -#define ATOMICALLY_FRAME 57 -#define CATCH_RETRY_FRAME 58 -#define CATCH_STM_FRAME 59 -#define WHITEHOLE 60 -#define N_CLOSURE_TYPES 61 +#define RET_FUN 34 +#define UPDATE_FRAME 35 +#define CATCH_FRAME 36 +#define UNDERFLOW_FRAME 37 +#define STOP_FRAME 38 +#define BLOCKING_QUEUE 39 +#define BLACKHOLE 40 +#define MVAR_CLEAN 41 +#define MVAR_DIRTY 42 +#define ARR_WORDS 43 +#define MUT_ARR_PTRS_CLEAN 44 +#define MUT_ARR_PTRS_DIRTY 45 +#define MUT_ARR_PTRS_FROZEN0 46 +#define MUT_ARR_PTRS_FROZEN 47 +#define MUT_VAR_CLEAN 48 +#define MUT_VAR_DIRTY 49 +#define WEAK 50 +#define PRIM 51 +#define MUT_PRIM 52 +#define TSO 53 +#define STACK 54 +#define TREC_CHUNK 55 +#define ATOMICALLY_FRAME 56 +#define CATCH_RETRY_FRAME 57 +#define CATCH_STM_FRAME 58 +#define WHITEHOLE 59 +#define N_CLOSURE_TYPES 60 #endif /* RTS_STORAGE_CLOSURETYPES_H */ diff --git a/includes/rts/storage/Closures.h b/includes/rts/storage/Closures.h index 5f4f03541f..fcba1ebeb6 100644 --- a/includes/rts/storage/Closures.h +++ b/includes/rts/storage/Closures.h @@ -240,60 +240,6 @@ typedef struct { #define BCO_BITMAP_SIZEW(bco) ((BCO_BITMAP_SIZE(bco) + BITS_IN(StgWord) - 1) \ / BITS_IN(StgWord)) -/* ----------------------------------------------------------------------------- - Dynamic stack frames for generic heap checks. - - These generic heap checks are slow, but have the advantage of being - usable in a variety of situations. - - The one restriction is that any relevant SRTs must already be pointed - to from the stack. The return address doesn't need to have an info - table attached: hence it can be any old code pointer. - - The liveness mask contains a 1 at bit n, if register Rn contains a - non-pointer. The contents of all 8 vanilla registers are always saved - on the stack; the liveness mask tells the GC which ones contain - pointers. - - Good places to use a generic heap check: - - - case alternatives (the return address with an SRT is already - on the stack). - - - primitives (no SRT required). - - The stack frame layout for a RET_DYN is like this: - - some pointers |-- RET_DYN_PTRS(liveness) words - some nonpointers |-- RET_DYN_NONPTRS(liveness) words - - L1 \ - D1-2 |-- RET_DYN_NONPTR_REGS_SIZE words - F1-4 / - - R1-8 |-- RET_DYN_BITMAP_SIZE words - - return address \ - liveness mask |-- StgRetDyn structure - stg_gen_chk_info / - - we assume that the size of a double is always 2 pointers (wasting a - word when it is only one pointer, but avoiding lots of #ifdefs). - - See Liveness.h for the macros (RET_DYN_PTRS() etc.). - - NOTE: if you change the layout of RET_DYN stack frames, then you - might also need to adjust the value of RESERVED_STACK_WORDS in - Constants.h. - -------------------------------------------------------------------------- */ - -typedef struct { - const StgInfoTable* info; - StgWord liveness; - StgWord ret_addr; - StgClosure * payload[FLEXIBLE_ARRAY]; -} StgRetDyn; - /* A function return stack frame: used when saving the state for a * garbage collection at a function entry point. The function * arguments are on the stack, and we also save the function (its @@ -430,7 +376,7 @@ typedef struct { typedef struct { StgHeader header; - StgBool running_alt_code; + StgWord running_alt_code; StgClosure *first_code; StgClosure *alt_code; } StgCatchRetryFrame; diff --git a/includes/rts/storage/Liveness.h b/includes/rts/storage/Liveness.h deleted file mode 100644 index 66c82f3134..0000000000 --- a/includes/rts/storage/Liveness.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ----------------------------------------------------------------------------- - * - * (c) The University of Glasgow 2004 - * - * Building liveness masks for RET_DYN stack frames. - * A few macros that are used in both .cmm and .c sources. - * - * A liveness mask is constructed like so: - * - * R1_PTR & R2_PTR & R3_PTR - * - * -------------------------------------------------------------------------- */ - -#ifndef RTS_STORAGE_LIVENESS_H -#define RTS_STORAGE_LIVENESS_H - -#define NO_PTRS 0xff -#define R1_PTR (NO_PTRS ^ (1<<0)) -#define R2_PTR (NO_PTRS ^ (1<<1)) -#define R3_PTR (NO_PTRS ^ (1<<2)) -#define R4_PTR (NO_PTRS ^ (1<<3)) -#define R5_PTR (NO_PTRS ^ (1<<4)) -#define R6_PTR (NO_PTRS ^ (1<<5)) -#define R7_PTR (NO_PTRS ^ (1<<6)) -#define R8_PTR (NO_PTRS ^ (1<<7)) - -#define N_NONPTRS(n) ((n)<<16) -#define N_PTRS(n) ((n)<<24) - -#define RET_DYN_NONPTRS(l) ((l)>>16 & 0xff) -#define RET_DYN_PTRS(l) ((l)>>24 & 0xff) -#define RET_DYN_LIVENESS(l) ((l) & 0xffff) - -#endif /* RTS_STORAGE_LIVENESS_H */ diff --git a/includes/rts/storage/SMPClosureOps.h b/includes/rts/storage/SMPClosureOps.h index 8dee7cbcf9..cd6a789af4 100644 --- a/includes/rts/storage/SMPClosureOps.h +++ b/includes/rts/storage/SMPClosureOps.h @@ -12,7 +12,7 @@ #ifdef CMINUSMINUS #define unlockClosure(ptr,info) \ - prim %write_barrier() []; \ + prim %write_barrier(); \ StgHeader_info(ptr) = info; #else |