- ALLOC_PRIM (SIZEOF_StgMutArrPtrs + WDS(ptrs), R1_PTR, closurePayloadzh_fast);
- ptrs_arr = Hp - SIZEOF_StgMutArrPtrs - WDS(ptrs) + WDS(1);
+ // Some closures have non-standard layout, so we omit those here.
+ W_ type;
+ type = TO_W_(%INFO_TYPE(info));
+ switch [0 .. N_CLOSURE_TYPES] type {
+ case THUNK_SELECTOR : {
+ ptrs = 1;
+ nptrs = 0;
+ goto out;
+ }
+ case THUNK, THUNK_1_0, THUNK_0_1, THUNK_2_0, THUNK_1_1,
+ THUNK_0_2, THUNK_STATIC, AP, PAP, AP_STACK, BCO : {
+ ptrs = 0;
+ nptrs = 0;
+ goto out;
+ }
+ default: {
+ ptrs = TO_W_(%INFO_PTRS(info));
+ nptrs = TO_W_(%INFO_NPTRS(info));
+ goto out;
+ }}
+out:
+
+ W_ ptrs_arr_sz, nptrs_arr_sz;
+ nptrs_arr_sz = SIZEOF_StgArrWords + WDS(nptrs);
+ ptrs_arr_sz = SIZEOF_StgMutArrPtrs + WDS(ptrs);
+
+ ALLOC_PRIM (ptrs_arr_sz + nptrs_arr_sz, R1_PTR, unpackClosurezh_fast);
+
+ ptrs_arr = Hp - nptrs_arr_sz - ptrs_arr_sz + WDS(1);
+ nptrs_arr = Hp - nptrs_arr_sz + WDS(1);
+