Skip to content

Commit

Permalink
Merge pull request #5454 from unisonweb/fix/inline-info
Browse files Browse the repository at this point in the history
Actually calculate inlining info for builtins
  • Loading branch information
dolio authored Nov 15, 2024
2 parents de1273c + 77757dd commit 336a9a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions unison-runtime/src/Unison/Runtime/Builtin.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module Unison.Runtime.Builtin
builtinTypeBackref,
builtinForeigns,
builtinArities,
builtinInlineInfo,
sandboxedForeigns,
numberedTermLookup,
Sandbox (..),
Expand Down Expand Up @@ -3666,5 +3667,9 @@ builtinArities =
Map.fromList $
[ (r, arity s) | (r, (_, s)) <- Map.toList builtinLookup ]

builtinInlineInfo :: Map Reference (Int, ANormal Symbol)
builtinInlineInfo =
ANF.buildInlineMap $ fmap (Rec [] . snd) builtinLookup

unsafeSTMToIO :: STM.STM a -> IO a
unsafeSTMToIO (STM.STM m) = IO m
2 changes: 1 addition & 1 deletion unison-runtime/src/Unison/Runtime/Machine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ cacheAdd0 ntys0 termSuperGroups sands cc = do
rtm <- updateMap (M.fromList $ zip rs [ntm ..]) (refTm cc)
-- check for missing references
let arities = fmap (head . ANF.arities) int <> builtinArities
inlinfo = ANF.buildInlineMap int
inlinfo = ANF.buildInlineMap int <> builtinInlineInfo
rns = RN (refLookup "ty" rty) (refLookup "tm" rtm) (flip M.lookup arities)
combinate :: Word64 -> (Reference, SuperGroup Symbol) -> (Word64, EnumMap Word64 Comb)
combinate n (r, g) =
Expand Down

0 comments on commit 336a9a5

Please sign in to comment.