diff options
author | Johan Tibell <johan.tibell@gmail.com> | 2014-03-11 13:54:29 +0100 |
---|---|---|
committer | Johan Tibell <johan.tibell@gmail.com> | 2014-03-11 20:01:54 +0100 |
commit | c1d74ab96df7607529596d01223bc8654abf71b9 (patch) | |
tree | f1442ce5bc9dfc0b3e9e92f2d5788292ce9b9d5a /compiler/codeGen/StgCmmHeap.hs | |
parent | b684f27ec7b3538ffd9401de70ef5685b8b71978 (diff) | |
download | haskell-c1d74ab96df7607529596d01223bc8654abf71b9.tar.gz |
Fix incorrect loop condition in inline array allocation
Also make sure allocHeapClosure updates profiling counters with the
memory allocated.
Diffstat (limited to 'compiler/codeGen/StgCmmHeap.hs')
-rw-r--r-- | compiler/codeGen/StgCmmHeap.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/codeGen/StgCmmHeap.hs b/compiler/codeGen/StgCmmHeap.hs index 2a0eaf9da7..488a0e05bc 100644 --- a/compiler/codeGen/StgCmmHeap.hs +++ b/compiler/codeGen/StgCmmHeap.hs @@ -99,7 +99,6 @@ allocDynClosureCmm mb_id info_tbl lf_info use_cc _blame_cc amodes_w_offsets = do -- SAY WHAT WE ARE ABOUT TO DO let rep = cit_rep info_tbl tickyDynAlloc mb_id rep lf_info - profDynAlloc rep use_cc let info_ptr = CmmLit (CmmLabel (cit_lbl info_tbl)) allocHeapClosure rep info_ptr use_cc amodes_w_offsets @@ -112,6 +111,8 @@ allocHeapClosure -> [(CmmExpr,ByteOff)] -- ^ payload -> FCode CmmExpr -- ^ returns the address of the object allocHeapClosure rep info_ptr use_cc payload = do + profDynAlloc rep use_cc + virt_hp <- getVirtHp -- Find the offset of the info-ptr word @@ -122,7 +123,7 @@ allocHeapClosure rep info_ptr use_cc payload = do -- ie 1 *before* the info-ptr word of new object. base <- getHpRelOffset info_offset - emitComment $ mkFastString "allocDynClosure" + emitComment $ mkFastString "allocHeapClosure" emitSetDynHdr base info_ptr use_cc -- Fill in the fields |