X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FHeapStackCheck.cmm;h=db4af25db8d7570c1c5eb43523cda362a853eb0c;hb=03d63424f3034c34d61fe0f654e05d20c9eded89;hp=88d18063e23986e8b9de32fe28e5fab322100983;hpb=c8898df0380dad4705353de00a48ea105d00bcc5;p=ghc-hetmet.git diff --git a/ghc/rts/HeapStackCheck.cmm b/ghc/rts/HeapStackCheck.cmm index 88d1806..db4af25 100644 --- a/ghc/rts/HeapStackCheck.cmm +++ b/ghc/rts/HeapStackCheck.cmm @@ -55,7 +55,7 @@ CLOSE_NURSERY(); \ CurrentNursery = bdescr_link(CurrentNursery); \ OPEN_NURSERY(); \ - if (CInt[context_switch] != 0) { \ + if (CInt[context_switch] != 0 :: CInt) { \ R1 = ThreadYielding; \ goto sched; \ } else { \ @@ -109,18 +109,6 @@ __stg_gc_enter_1 GC_GENERIC } -#ifdef SMP -stg_gc_enter_1_hponly -{ - Sp_adj(-1); - Sp(0) = R1; - R1 = HeapOverflow; - SAVE_THREAD_STATE(); - TSO_what_next(CurrentTSO) = ThreadRunGHC::I16; - jump StgReturn; -} -#endif - #if defined(GRAN) /* ToDo: merge the block and yield macros, calling something like BLOCK(N) @@ -594,7 +582,13 @@ __stg_gc_fun size = BITMAP_SIZE(StgFunInfoExtra_bitmap(info)); } else { if (type == ARG_GEN_BIG) { +#ifdef TABLES_NEXT_TO_CODE + // bitmap field holds an offset + size = StgLargeBitmap_size( StgFunInfoExtra_bitmap(info) + + %GET_ENTRY(R1) /* ### */ ); +#else size = StgLargeBitmap_size( StgFunInfoExtra_bitmap(info) ); +#endif } else { size = BITMAP_SIZE(W_[stg_arg_bitmaps + WDS(type)]); } @@ -617,13 +611,13 @@ __stg_gc_fun Sp(2) = R1; Sp(1) = size; Sp(0) = stg_gc_fun_info; - // DEBUG_ONLY(foreign "C" fprintf(stderr, "stg_fun_gc_gen(ARG_GEN)");); + // DEBUG_ONLY(foreign "C" debugBelch("stg_fun_gc_gen(ARG_GEN)");); GC_GENERIC } else { jump W_[stg_stack_save_entries + WDS(type)]; // jumps to stg_gc_noregs after saving stuff } -#endif // !NO_ARG_REGS +#endif /* !NO_ARG_REGS */ } /* ----------------------------------------------------------------------------- @@ -717,7 +711,7 @@ INFO_TABLE_RET( stg_gc_fun, 0/*framesize*/, 0/*bitmap*/, RET_FUN ) Sp(5) = R3; \ Sp(4) = R2; \ Sp(3) = R1; \ - Sp(2) = R10.w; /* return address */ \ + Sp(2) = R10; /* return address */ \ Sp(1) = R9; /* liveness mask */ \ Sp(0) = stg_gc_gen_info; @@ -854,7 +848,7 @@ stg_block_putmvar BLOCK_GENERIC; } -#ifdef mingw32_TARGET_OS +#ifdef mingw32_HOST_OS INFO_TABLE_RET( stg_block_async, 0/*framesize*/, 0/*bitmap*/, RET_SMALL ) { W_ ares; @@ -864,7 +858,7 @@ INFO_TABLE_RET( stg_block_async, 0/*framesize*/, 0/*bitmap*/, RET_SMALL ) len = StgAsyncIOResult_len(ares); errC = StgAsyncIOResult_errCode(ares); StgTSO_block_info(CurrentTSO) = NULL; - foreign "C" free(ares); + foreign "C" free(ares "ptr"); R1 = len; Sp(0) = errC; jump %ENTRY_CODE(Sp(1)); @@ -877,4 +871,25 @@ stg_block_async BLOCK_GENERIC; } +/* Used by threadDelay implementation; it would be desirable to get rid of + * this free()'ing void return continuation. + */ +INFO_TABLE_RET( stg_block_async_void, 0/*framesize*/, 0/*bitmap*/, RET_SMALL ) +{ + W_ ares; + + ares = StgTSO_block_info(CurrentTSO); + StgTSO_block_info(CurrentTSO) = NULL; + foreign "C" free(ares "ptr"); + Sp_adj(1); + jump %ENTRY_CODE(Sp(0)); +} + +stg_block_async_void +{ + Sp_adj(-1); + Sp(0) = stg_block_async_void_info; + BLOCK_GENERIC; +} + #endif