diff options
author | Simon Marlow <marlowsd@gmail.com> | 2018-03-05 15:12:57 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-03-06 13:03:06 -0500 |
commit | 488d63d6899d223ef87c26c218f0cf81ac670a90 (patch) | |
tree | 166a686fe8e90a4110174e437d8d4c966d723188 /compiler/ghci | |
parent | 1488591ac595d1b7be39345cc390737ea9a65fe3 (diff) | |
download | haskell-488d63d6899d223ef87c26c218f0cf81ac670a90.tar.gz |
Fix interpreter with profiling
This was broken by D3746 and/or D3809, but unfortunately we didn't
notice because CI at the time wasn't building the profiling way.
Test Plan:
```
cd testsuite/test/profiling/should_run
make WAY=ghci-ext-prof
```
Reviewers: bgamari, michalt, hvr, erikd
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #14705
Differential Revision: https://phabricator.haskell.org/D4437
Diffstat (limited to 'compiler/ghci')
-rw-r--r-- | compiler/ghci/ByteCodeGen.hs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/ghci/ByteCodeGen.hs b/compiler/ghci/ByteCodeGen.hs index 13cb83df14..90fcb6d2ca 100644 --- a/compiler/ghci/ByteCodeGen.hs +++ b/compiler/ghci/ByteCodeGen.hs @@ -47,9 +47,7 @@ import Unique import FastString import Panic import StgCmmClosure ( NonVoid(..), fromNonVoid, nonVoidIds ) -import StgCmmLayout ( ArgRep(..), FieldOffOrPadding(..), - toArgRep, argRepSizeW, - mkVirtHeapOffsetsWithPadding, mkVirtConstrOffsets ) +import StgCmmLayout import SMRep hiding (WordOff, ByteOff, wordsToBytes) import Bitmap import OrdList @@ -801,9 +799,8 @@ mkConAppCode orig_d _ p con args_r_to_l = , let prim_rep = atomPrimRep arg , not (isVoidRep prim_rep) ] - is_thunk = False (_, _, args_offsets) = - mkVirtHeapOffsetsWithPadding dflags is_thunk non_voids + mkVirtHeapOffsetsWithPadding dflags StdHeader non_voids do_pushery !d (arg : args) = do (push, arg_bytes) <- case arg of @@ -970,7 +967,7 @@ doCase d s p (_,scrut) bndr alts is_unboxed_tuple -- algebraic alt with some binders | otherwise = let (tot_wds, _ptrs_wds, args_offsets) = - mkVirtConstrOffsets dflags + mkVirtHeapOffsets dflags NoHeader [ NonVoid (bcIdPrimRep id, id) | NonVoid id <- nonVoidIds real_bndrs ] @@ -980,7 +977,7 @@ doCase d s p (_,scrut) bndr alts is_unboxed_tuple -- convert offsets from Sp into offsets into the virtual stack p' = Map.insertList - [ (arg, stack_bot + wordSize dflags - ByteOff offset) + [ (arg, stack_bot - ByteOff offset) | (NonVoid arg, offset) <- args_offsets ] p_alts in do |