- nat size, np, nw_heap, nw_really, w;
- StgClosure* con;
- StgInfoTable* itbl;
- W_* r;
- FB_
- itbl = ((StgInfoTable**)Sp)[0];
-STGCALL3(fprintf,stderr,"mmc: itbl = %d\n",itbl);
-
-STGCALL3(fprintf,stderr,"mmc: sp-4 = %d\n", ((W_*)Sp)[-4] );
-STGCALL3(fprintf,stderr,"mmc: sp-3 = %d\n", ((W_*)Sp)[-3] );
-STGCALL3(fprintf,stderr,"mmc: sp-2 = %d\n", ((W_*)Sp)[-2] );
-STGCALL3(fprintf,stderr,"mmc: sp-1 = %d\n", ((W_*)Sp)[-1] );
-STGCALL3(fprintf,stderr,"mmc: sp+0 = %d\n", ((W_*)Sp)[0] );
-STGCALL3(fprintf,stderr,"mmc: sp+1 = %d\n", ((W_*)Sp)[1] );
-STGCALL3(fprintf,stderr,"mmc: sp+2 = %d\n", ((W_*)Sp)[2] );
-STGCALL3(fprintf,stderr,"mmc: sp+3 = %d\n", ((W_*)Sp)[3] );
-STGCALL3(fprintf,stderr,"mmc: sp+4 = %d\n", ((W_*)Sp)[4] );
- np = itbl->layout.payload.ptrs;
- nw_really = itbl->layout.payload.nptrs;
- nw_heap = stg_max(nw_really, MIN_NONUPD_SIZE-np);
- size = CONSTR_sizeW( np, nw_heap );
-
- /* The total number of words to copy off the stack is np + nw.
- That doesn't include tag words, tho.
- */
- HP_CHK_GEN_TICKY(size, NO_PTRS, mci_make_constr_entry, );
- TICK_ALLOC_PRIM(sizeofW(StgHeader), size-sizeofW(StgHeader), 0);
- CCS_ALLOC(CCCS,size); /* ccs prof */
-
- con = (StgClosure*)(Hp + 1 - size);
- SET_HDR(con, itbl,CCCS);
-
- /* Copy into the closure. */
- w = 0;
- r = Sp+1;
- while (1) {
- if (w == np + nw) break;
- ASSERT(w < np + nw);
- if (IS_ARG_TAG(*r)) {
- nat n = *r++;
- for (; n > 0; n--)
- con->payload[w++] = (StgClosure*)(*r++);
- } else {
- con->payload[w++] = (StgClosure*)(*r++);
- }
- ASSERT((P_)r <= (P_)Su);
- }