Changes between Version 15 and Version 16 of Commentary/ResourceLimits


Ignore:
Timestamp:
Sep 2, 2013 3:52:52 AM (2 years ago)
Author:
ezyang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/ResourceLimits

    v15 v16  
    1313{{{
    1414// profDynAlloc rep use_cc
    15 // use_cc == CurCCS
     15// use_cc == CurCCS for the cases we're looking at
    1616         I64[CCCS + 72] = I64[CCCS + 72] + %MO_UU_Conv_W64_W64(4 - 2);
    1717// ALLOCATE THE OBJECT
     
    3838
    3939{{{
     40// this is not part of link_caf, see thunkCode
     41         Hp = Hp + 32;
     42         if (Hp > HpLim) goto cms;
    4043//   ; hp_rel <- allocDynClosureCmm Nothing cafBlackHoleInfoTable mkLFBlackHole use_cc blame_cc [(tso,fixedHdrSize dflags)]
    4144         I64[I64[R1 + 8] + 72] = I64[I64[R1 + 8] + 72] + %MO_UU_Conv_W64_W64(4 - 2);
     
    5760{{{
    5861// XXX change nursery to Bdescr(R1)->rc
    59 // XXX where is the heap check?
     62         Hp = Hp + 16;
     63         if (Hp > HpLim) goto cms;
    6064         I64[Hp - 8] = stg_CAF_BLACKHOLE_info;
    6165         I64[Hp + 0] = CurrentTSO;
    62 // XXX change nursery back
     66// XXX change nursery back, new heap check?
    6367         (_cmt::I64,) = foreign "ccall"
    6468           newCAF((BaseReg, PtrHint), (R1, PtrHint), (Hp - 24, PtrHint));
    6569         if (_cmt::I64 == 0) goto cmu;
    6670         goto cmv;
     71}}}
     72
     73=== Thunk code ===
     74
     75[[GhcFile(compiler/codeGen/StgCmmBind.hs)]]:thunkCode
     76
     77{{{
     78// ldvEnterClosure cl_info
     79     clc:
     80         if (%MO_UU_Conv_W32_W64(I32[era]) > 0) goto cld;
     81         goto cle;
     82     cld:
     83         I64[R1 + 16] = I64[R1 + 16] & 1152921503533105152 | %MO_UU_Conv_W32_W64(I32[era]) | 1152921504606846976;
     84         goto cle;
     85     cle:
     86// entryHeapCheck cl_info node' arity []
     87         if (Sp - 32 < SpLim) goto clg;
     88         Hp = Hp + 40;
     89         if (Hp > HpLim) goto cli;
     90// when (blackHoleOnEntry cl_info && node_points)
     91//    (blackHoleIt node)
     92         // empty
     93// setupUpdate cl_info node
     94         I64[Sp - 32] = stg_upd_frame_info;
     95         I64[Sp - 8] = R1;
     96         I64[Sp - 24] = CCCS;
     97// enterCostCentreThunk (CmmReg nodeReg)
     98         CCCS = I64[R1 + 8];
     99// let lf_info = closureLFInfo cl_info
     100// fv_bindings <- mapM bind_fv fv_details
     101// load_fvs node lf_info fv_bindings
     102         // empty
     103// cgExpr body
     104         ...
     105// due to 'entryHeapCheck cl_info node' arity []'
     106     clg: jump stg_gc_enter_1; // [R1]
     107     cli:
     108         HpAlloc = 40;
     109         goto clg;
     110}}}
     111
     112Changes to:
     113
     114{{{
     115         if (Sp - 32 < SpLim) goto clg;
     116         // XXX Update nursery
     117         Hp = Hp + 40; // or whatever this adjusts to
     118         if (Hp > HpLim) goto cli;
     119         // (blackhole)
     120         I64[Sp - 32] = stg_upd_frame_info;
     121         I64[Sp - 8] = R1;
     122         I64[Sp - 24] = CurrentResourceContainer; // so we can restore it on return, NOT the same as nursery
     123         // XXX Update CurrentResourceContainer
     124         // (load free variables)
     125         ...
     126     clg: jump stg_gc_enter_1; // [R1]
     127     cli:
     128         HpAlloc = 40;
     129         goto clg;
    67130}}}
    68131