Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed instructions into Section #5527

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions unison-runtime/src/Unison/Runtime/Interface.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ import Unison.Runtime.Exception
import Unison.Runtime.MCode
( Args (..),
CombIx (..),
GInstr (..),
GSection (..),
RCombs,
RefNums (..),
Expand Down Expand Up @@ -1063,7 +1062,7 @@ executeMainComb ::
CCache ->
IO (Either (Pretty ColorText) ())
executeMainComb init cc = do
rSection <- resolveSection cc $ Ins (Pack RF.unitRef (PackedTag 0) ZArgs) $ Call True init init (VArg1 0)
rSection <- resolveSection cc $ Pack RF.unitRef (PackedTag 0) ZArgs $ Call True init init (VArg1 0)
result <-
UnliftIO.try . eval0 cc Nothing $ rSection
case result of
Expand Down Expand Up @@ -1440,18 +1439,19 @@ buildSCache crsrc cssrc cacheableCombs trsrc ftm fty int rtmsrc rtysrc sndbx =
restrictTyR m = Map.restrictKeys m typeRefs

standalone :: CCache -> Word64 -> IO StoredCache
standalone cc init = readTVarIO (combRefs cc) >>= \crs ->
case EC.lookup init crs of
Just rinit ->
buildSCache crs
<$> readTVarIO (srcCombs cc)
<*> readTVarIO (cacheableCombs cc)
<*> readTVarIO (tagRefs cc)
<*> readTVarIO (freshTm cc)
<*> readTVarIO (freshTy cc)
<*> (readTVarIO (intermed cc) >>= traceNeeded rinit)
<*> readTVarIO (refTm cc)
<*> readTVarIO (refTy cc)
<*> readTVarIO (sandbox cc)
Nothing ->
die $ "standalone: unknown combinator: " ++ show init
standalone cc init =
readTVarIO (combRefs cc) >>= \crs ->
case EC.lookup init crs of
Just rinit ->
buildSCache crs
<$> readTVarIO (srcCombs cc)
<*> readTVarIO (cacheableCombs cc)
<*> readTVarIO (tagRefs cc)
<*> readTVarIO (freshTm cc)
<*> readTVarIO (freshTy cc)
<*> (readTVarIO (intermed cc) >>= traceNeeded rinit)
<*> readTVarIO (refTm cc)
<*> readTVarIO (refTy cc)
<*> readTVarIO (sandbox cc)
Nothing ->
die $ "standalone: unknown combinator: " ++ show init
Loading
Loading