Rodrigo Mesquita pushed to branch wip/romes/step-out-11 at Glasgow Haskell Compiler / GHC

WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below.

Deleted commits:

1 changed file:

Changes:

  • compiler/GHC/StgToByteCode.hs
    ... ... @@ -749,12 +749,21 @@ doTailCall init_d s p fn args = do
    749 749
     
    
    750 750
       where
    
    751 751
       do_pushes !d [] reps = do
    
    752
    -        assert (null reps) return ()
    
    753
    -        (push_fn, sz) <- pushAtom d p (StgVarArg fn)
    
    754 752
             platform <- profilePlatform <$> getProfile
    
    755
    -        assert (sz == wordSize platform) return ()
    
    756
    -        let slide = mkSlideB platform (d - init_d + wordSize platform) (init_d - s)
    
    757
    -        return (push_fn `appOL` (slide `appOL` unitOL ENTER))
    
    753
    +        assert (null reps) return ()
    
    754
    +        case lookupBCEnv_maybe fn p of
    
    755
    +          Just d_v
    
    756
    +            | d - d_v == 0  -- shortcut; the first thing on the stack is what we want to enter,
    
    757
    +            , d_v <= init_d -- and it is between init_d and sequel (which would be dropped)
    
    758
    +            -> do
    
    759
    +              let slide = mkSlideB platform (d - init_d + wordSize platform)
    
    760
    +                                            (init_d - s - wordSize platform)
    
    761
    +              return (slide `appOL` unitOL ENTER)
    
    762
    +          _ -> do
    
    763
    +              (push_fn, sz) <- pushAtom d p (StgVarArg fn)
    
    764
    +              assert (sz == wordSize platform) return ()
    
    765
    +              let slide = mkSlideB platform (d - init_d + wordSize platform) (init_d - s)
    
    766
    +              return (push_fn `appOL` (slide `appOL` unitOL ENTER))
    
    758 767
       do_pushes !d args reps = do
    
    759 768
           let (push_apply, n, rest_of_reps) = findPushSeq reps
    
    760 769
               (these_args, rest_of_args) = splitAt n args