Revert "Properly tag fun field of PAPs generated by ap_0_fast"
authorÖmer Sinan Ağacan <omeragacan@gmail.com>
Wed, 22 Aug 2018 05:52:50 +0000 (08:52 +0300)
committerÖmer Sinan Ağacan <omeragacan@gmail.com>
Wed, 22 Aug 2018 05:52:50 +0000 (08:52 +0300)
This reverts commit 2693eb11f55f2001701c90c24183e21c794a8be1.

This patch isn't ready yet, see D5051.

rts/Apply.cmm

index 7e23609..15d8250 100644 (file)
@@ -106,9 +106,6 @@ again:
                 pap = Hp - SIZEOF_StgPAP + WDS(1);
                 SET_HDR(pap, stg_PAP_info, CCCS);
                 StgPAP_arity(pap) = arity;
-                if (arity <= TAG_MASK) {
-                  fun = untaggedfun + arity;
-                }
                 StgPAP_fun(pap)   = fun;
                 StgPAP_n_args(pap) = 0;
                 return (pap);
@@ -120,8 +117,9 @@ again:
                 return (fun);
             } else {
                 // We're going to copy this PAP, and put the new CCS in it
+                fun = untaggedfun;
                 W_ size;
-                size = SIZEOF_StgPAP + WDS(TO_W_(StgPAP_n_args(untaggedfun)));
+                size = SIZEOF_StgPAP + WDS(TO_W_(StgPAP_n_args(fun)));
                 HP_CHK_GEN(size);
                 TICK_ALLOC_PAP(size, 0);
                 // attribute this allocation to the "overhead of profiling"
@@ -129,13 +127,13 @@ again:
                 P_ pap;
                 pap = Hp - size + WDS(1);
                 // We'll lose the original PAP, so we should enter its CCS
-                ccall enterFunCCS(BaseReg "ptr", StgHeader_ccs(untaggedfun) "ptr");
+                ccall enterFunCCS(BaseReg "ptr", StgHeader_ccs(fun) "ptr");
                 SET_HDR(pap, stg_PAP_info, CCCS);
-                StgPAP_arity(pap) = StgPAP_arity(untaggedfun);
-                StgPAP_n_args(pap) = StgPAP_n_args(untaggedfun);
+                StgPAP_arity(pap) = StgPAP_arity(fun);
+                StgPAP_n_args(pap) = StgPAP_n_args(fun);
                 StgPAP_fun(pap)   = StgPAP_fun(fun);
                 W_ i;
-                i = TO_W_(StgPAP_n_args(untaggedfun));
+                i = TO_W_(StgPAP_n_args(fun));
             loop:
                 if (i == 0) {
                     return (pap);