Commit 9462452a authored by Andreas Klebinger's avatar Andreas Klebinger Committed by Marge Bot

Improve and refactor StgToCmm codegen for DataCons.

We now differentiate three cases of constructor bindings:

1)Bindings which we can "replace" with a reference to
  an existing closure. Reference the replacement closure
  when accessing the binding.
2)Bindings which we can "replace" as above. But we still
  generate a closure which will be referenced by modules
  importing this binding.
3)For any other binding generate a closure. Then reference

Before this patch 1) did only apply to local bindings and we
didn't do 2) at all.
parent ef7576c4
Pipeline #17544 passed with stages
in 389 minutes and 4 seconds
This diff is collapsed.
{ foreign "C" barf("COMPACT_NFDATA_DIRTY object (%p) entered!", R1) never returns; }
/* ----------------------------------------------------------------------------
CHARLIKE and INTLIKE closures.
Note [CHARLIKE and INTLIKE closures.]
These are static representations of Chars and small Ints, so that
we can remove dynamic Chars and Ints during garbage collection and
......@@ -6,6 +6,6 @@ newtype A = A Int
newtype B = B A
{-# NOINLINE a #-}
a = trace "evaluating a" A 42
a = trace "evaluating a" A 42000
b = B a
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment