diff --git a/unison-runtime/package.yaml b/unison-runtime/package.yaml index c67aae8e6d..4dbde33972 100644 --- a/unison-runtime/package.yaml +++ b/unison-runtime/package.yaml @@ -3,6 +3,7 @@ github: unisonweb/unison copyright: Copyright (C) 2013-2024 Unison Computing, PBC and contributors ghc-options: -fmax-worker-args=100 -Wall -funbox-strict-fields -O2 +# -fsimpl-tick-factor=300 -fmax-simplifier-iterations=10 -fspecialise-aggressively -fexpose-all-unfoldings flags: arraychecks: @@ -21,7 +22,7 @@ when: - condition: flag(stackchecks) cpp-options: -DSTACK_CHECK - condition: flag(dumpcore) - ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures # -dsuppress-type-applications -dsuppress-type-signatures + ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures -ddump-simpl-stats # -dsuppress-type-applications -dsuppress-type-signatures library: source-dirs: src diff --git a/unison-runtime/src/Unison/Runtime/Machine.hs b/unison-runtime/src/Unison/Runtime/Machine.hs index 444b588d9c..e0da7831a6 100644 --- a/unison-runtime/src/Unison/Runtime/Machine.hs +++ b/unison-runtime/src/Unison/Runtime/Machine.hs @@ -654,16 +654,15 @@ eval !env !denv !activeThreads !stk !k r (NMatch _mr i br) = do n <- peekOffN stk i eval env denv activeThreads stk k r $ selectBranch n br -eval !_env !_denv !_activeThreads !_stk !_k _r (RMatch _i _pu _br) = do - pure () --- (t, stk) <- dumpDataNoTag Nothing stk =<< peekOff stk i --- if t == PackedTag 0 --- then eval env denv activeThreads stk k r pu --- else case ANF.unpackTags t of --- (ANF.rawTag -> e, ANF.rawTag -> t) --- | Just ebs <- EC.lookup e br -> --- eval env denv activeThreads stk k r $ selectBranch t ebs --- | otherwise -> unhandledErr "eval" env e +eval !env !denv !activeThreads !stk !k r (RMatch i pu br) = do + (t, stk) <- dumpDataNoTag Nothing stk =<< peekOff stk i + if t == PackedTag 0 + then eval env denv activeThreads stk k r pu + else case ANF.unpackTags t of + (ANF.rawTag -> e, ANF.rawTag -> t) + | Just ebs <- EC.lookup e br -> + eval env denv activeThreads stk k r $ selectBranch t ebs + | otherwise -> unhandledErr "eval" env e eval !env !denv !activeThreads !stk !k _ (Yield args) | asize stk > 0, VArg1 i <- args = diff --git a/unison-runtime/unison-runtime.cabal b/unison-runtime/unison-runtime.cabal index 08184c9bab..51c9340edf 100644 --- a/unison-runtime/unison-runtime.cabal +++ b/unison-runtime/unison-runtime.cabal @@ -87,7 +87,7 @@ library TypeApplications TypeFamilies ViewPatterns - ghc-options: -fmax-worker-args=100 -Wall -funbox-strict-fields -O2 + ghc-options: -fsimpl-tick-factor=300 -fmax-simplifier-iterations=10 -fmax-worker-args=100 -Wall -funbox-strict-fields -fspecialise-aggressively -fexpose-all-unfoldings -O2 build-depends: asn1-encoding , asn1-types @@ -147,7 +147,7 @@ library if flag(stackchecks) cpp-options: -DSTACK_CHECK if flag(dumpcore) - ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures + ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures -ddump-simpl-stats test-suite runtime-tests type: exitcode-stdio-1.0 @@ -194,7 +194,7 @@ test-suite runtime-tests TypeApplications TypeFamilies ViewPatterns - ghc-options: -fmax-worker-args=100 -Wall -funbox-strict-fields -O2 -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0 + ghc-options: -fsimpl-tick-factor=300 -fmax-simplifier-iterations=10 -fmax-worker-args=100 -Wall -funbox-strict-fields -fspecialise-aggressively -fexpose-all-unfoldings -O2 -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0 build-depends: base , bytes @@ -228,4 +228,4 @@ test-suite runtime-tests if flag(stackchecks) cpp-options: -DSTACK_CHECK if flag(dumpcore) - ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures + ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures -ddump-simpl-stats