Remove the IND_OLDGEN and IND_OLDGEN_PERM closure types
authorSimon Marlow <marlowsd@gmail.com>
Thu, 1 Apr 2010 09:35:19 +0000 (09:35 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 1 Apr 2010 09:35:19 +0000 (09:35 +0000)
These are no longer used: once upon a time they used to have different
layout from IND and IND_PERM respectively, but that is no longer the
case since we changed the remembered set to be an array of addresses
instead of a linked list of closures.

20 files changed:
includes/Cmm.h
includes/rts/storage/ClosureMacros.h
includes/rts/storage/ClosureTypes.h
includes/stg/MiscClosures.h
rts/ClosureFlags.c
rts/FrontPanel.c
rts/Interpreter.c
rts/LdvProfile.c
rts/Printer.c
rts/ProfHeap.c
rts/RetainerProfile.c
rts/Stable.c
rts/StgMiscClosures.cmm
rts/Updates.h
rts/sm/Compact.c
rts/sm/Evac.c
rts/sm/GCAux.c
rts/sm/Sanity.c
rts/sm/Scav.c
utils/genapply/GenApply.hs

index ff91146..183e103 100644 (file)
          (TO_W_( %INFO_TYPE(%STD_INFO(info)) )) {      \
   case                                                 \
     IND,                                               \
-    IND_OLDGEN,                                                \
     IND_PERM,                                          \
-    IND_OLDGEN_PERM,                                   \
     IND_STATIC:                                                \
    {                                                   \
       P1 = StgInd_indirectee(P1);                      \
index 098c65d..56e7dca 100644 (file)
@@ -327,8 +327,6 @@ closure_sizeW_ (StgClosure *p, StgInfoTable *info)
        return pap_sizeW((StgPAP *)p);
     case IND:
     case IND_PERM:
-    case IND_OLDGEN:
-    case IND_OLDGEN_PERM:
        return sizeofW(StgInd);
     case ARR_WORDS:
        return arr_words_sizeW((StgArrWords *)p);
index 518d39b..8d09e69 100644 (file)
 #define PAP                    26
 #define AP_STACK                27
 #define IND                    28
-#define IND_OLDGEN             29
-#define IND_PERM               30
-#define IND_OLDGEN_PERM                31
-#define IND_STATIC             32
-#define RET_BCO                 33
-#define RET_SMALL              34
-#define RET_BIG                        35
-#define RET_DYN                        36
-#define RET_FUN                 37
-#define UPDATE_FRAME           38
-#define CATCH_FRAME            39
-#define STOP_FRAME             40
-#define BLOCKING_QUEUE         41
-#define BLACKHOLE              42
-#define MVAR_CLEAN             43
-#define MVAR_DIRTY             44
-#define ARR_WORDS              45
-#define MUT_ARR_PTRS_CLEAN      46
-#define MUT_ARR_PTRS_DIRTY      47
-#define MUT_ARR_PTRS_FROZEN0    48
-#define MUT_ARR_PTRS_FROZEN     49
-#define MUT_VAR_CLEAN          50
-#define MUT_VAR_DIRTY          51
-#define WEAK                   52
-#define PRIM                   53
-#define MUT_PRIM                54
-#define TSO                    55
-#define TREC_CHUNK              56
-#define ATOMICALLY_FRAME        57
-#define CATCH_RETRY_FRAME       58
-#define CATCH_STM_FRAME         59
-#define WHITEHOLE               60
-#define N_CLOSURE_TYPES         61
+#define IND_PERM               29
+#define IND_STATIC             30
+#define RET_BCO                 31
+#define RET_SMALL              32
+#define RET_BIG                        33
+#define RET_DYN                        34
+#define RET_FUN                 35
+#define UPDATE_FRAME           36
+#define CATCH_FRAME            37
+#define STOP_FRAME             38
+#define BLOCKING_QUEUE         39
+#define BLACKHOLE              40
+#define MVAR_CLEAN             41
+#define MVAR_DIRTY             42
+#define ARR_WORDS              43
+#define MUT_ARR_PTRS_CLEAN      44
+#define MUT_ARR_PTRS_DIRTY      45
+#define MUT_ARR_PTRS_FROZEN0    46
+#define MUT_ARR_PTRS_FROZEN     47
+#define MUT_VAR_CLEAN          48
+#define MUT_VAR_DIRTY          49
+#define WEAK                   50
+#define PRIM                   51
+#define MUT_PRIM                52
+#define TSO                    53
+#define TREC_CHUNK              54
+#define ATOMICALLY_FRAME        55
+#define CATCH_RETRY_FRAME       56
+#define CATCH_STM_FRAME         57
+#define WHITEHOLE               58
+#define N_CLOSURE_TYPES         59
 
 #endif /* RTS_STORAGE_CLOSURETYPES_H */
index 0aa6f99..9b2bb60 100644 (file)
@@ -83,8 +83,6 @@ RTS_ENTRY(stg_IND);
 RTS_ENTRY(stg_IND_direct);
 RTS_ENTRY(stg_IND_STATIC);
 RTS_ENTRY(stg_IND_PERM);
-RTS_ENTRY(stg_IND_OLDGEN);
-RTS_ENTRY(stg_IND_OLDGEN_PERM);
 RTS_ENTRY(stg_BLACKHOLE);
 RTS_ENTRY(stg_CAF_BLACKHOLE);
 RTS_ENTRY(__stg_EAGER_BLACKHOLE);
index cebd124..d5181ca 100644 (file)
@@ -50,9 +50,7 @@ StgWord16 closure_flags[] = {
  [PAP]                 =  (_HNF|     _NS                                ),
  [AP_STACK]            =  (                   _THU                      ),
  [IND]                 =  (          _NS|                        _IND ),
- [IND_OLDGEN]          =  (          _NS|                        _IND ),
  [IND_PERM]            =  (          _NS|                        _IND ),
- [IND_OLDGEN_PERM]     =  (          _NS|                        _IND ),
  [IND_STATIC]          =  (          _NS|_STA|                   _IND ),
  [RET_BCO]             =  (     _BTM                                  ),
  [RET_SMALL]           =  (     _BTM|                       _SRT      ),
@@ -84,6 +82,6 @@ StgWord16 closure_flags[] = {
  [WHITEHOLE]           =  ( 0                                         )
 };
 
-#if N_CLOSURE_TYPES != 61
+#if N_CLOSURE_TYPES != 59
 #error Closure types changed: update ClosureFlags.c!
 #endif
index da42548..d6269fb 100644 (file)
@@ -700,7 +700,6 @@ residencyCensus( void )
                    case MUT_VAR:
 /*                 case MUT_CONS: FIXME: case does not exist */
                    case IND_PERM:
-                   case IND_OLDGEN_PERM:
                        size = sizeW_fromITBL(info);
                        type = Other;
                        break;
index 16a8e24..5a564ba 100644 (file)
@@ -276,9 +276,7 @@ eval_obj:
     switch ( get_itbl(obj)->type ) {
 
     case IND:
-    case IND_OLDGEN:
     case IND_PERM:
-    case IND_OLDGEN_PERM:
     case IND_STATIC:
     { 
        tagged_obj = ((StgInd*)obj)->indirectee;
index 799d418..021ecf0 100644 (file)
@@ -142,18 +142,16 @@ processHeapClosureForDead( StgClosure *c )
     case BLACKHOLE:
     case BLOCKING_QUEUE:
     case IND_PERM:
-    case IND_OLDGEN_PERM:
        /*
          'Ingore' cases
        */
-       // Why can we ignore IND/IND_OLDGEN closures? We assume that
+       // Why can we ignore IND closures? We assume that
        // any census is preceded by a major garbage collection, which
-       // IND/IND_OLDGEN closures cannot survive. Therefore, it is no
-       // use considering IND/IND_OLDGEN closures in the meanwhile
+       // IND closures cannot survive. Therefore, it is no
+       // use considering IND closures in the meanwhile
        // because they will perish before the next census at any
        // rate.
     case IND:
-    case IND_OLDGEN:
        // Found a dead closure: record its size
        LDV_recordDead(c, size);
        return size;
index 6eecfab..6ab4b7e 100644 (file)
@@ -233,24 +233,12 @@ printClosure( StgClosure *obj )
             debugBelch(")\n"); 
             break;
 
-    case IND_OLDGEN:
-            debugBelch("IND_OLDGEN("); 
-            printPtr((StgPtr)((StgInd*)obj)->indirectee);
-            debugBelch(")\n"); 
-            break;
-
     case IND_PERM:
             debugBelch("IND("); 
             printPtr((StgPtr)((StgInd*)obj)->indirectee);
             debugBelch(")\n"); 
             break;
 
-    case IND_OLDGEN_PERM:
-            debugBelch("IND_OLDGEN_PERM("); 
-            printPtr((StgPtr)((StgInd*)obj)->indirectee);
-            debugBelch(")\n"); 
-            break;
-
     case IND_STATIC:
             debugBelch("IND_STATIC("); 
             printPtr((StgPtr)((StgInd*)obj)->indirectee);
@@ -994,9 +982,7 @@ void prettyPrintClosure_ (StgClosure *obj)
            
     while (type == IND ||
            type == IND_STATIC ||
-           type == IND_OLDGEN ||
-           type == IND_PERM ||
-           type == IND_OLDGEN_PERM) 
+           type == IND_PERM)
     {
       obj = ((StgInd *)obj)->indirectee;
       type = get_itbl(obj)->type;
@@ -1108,9 +1094,7 @@ char *closure_type_names[] = {
  [PAP]                   = "PAP",
  [AP_STACK]              = "AP_STACK",
  [IND]                   = "IND",
- [IND_OLDGEN]            = "IND_OLDGEN",
  [IND_PERM]              = "IND_PERM",
- [IND_OLDGEN_PERM]       = "IND_OLDGEN_PERM",
  [IND_STATIC]            = "IND_STATIC",
  [RET_BCO]               = "RET_BCO",
  [RET_SMALL]             = "RET_SMALL",
index 4a2816c..d398afd 100644 (file)
@@ -876,8 +876,6 @@ heapCensusChain( Census *census, bdescr *bd )
            case CONSTR:
            case FUN:
            case IND_PERM:
-           case IND_OLDGEN:
-           case IND_OLDGEN_PERM:
            case BLACKHOLE:
            case BLOCKING_QUEUE:
            case FUN_1_0:
index b5db15a..d14ba06 100644 (file)
@@ -466,8 +466,6 @@ push( StgClosure *c, retainer c_child_r, StgClosure **first_child )
        *first_child = ((StgSelector *)c)->selectee;
        return;
     case IND_PERM:
-    case IND_OLDGEN_PERM:
-    case IND_OLDGEN:
     case BLACKHOLE:
        *first_child = ((StgInd *)c)->indirectee;
        return;
@@ -921,8 +919,6 @@ pop( StgClosure **c, StgClosure **cp, retainer *r )
        case MUT_VAR_DIRTY:
        case THUNK_SELECTOR:
        case IND_PERM:
-       case IND_OLDGEN_PERM:
-       case IND_OLDGEN:
        case CONSTR_1_1:
            // cannot appear
        case PAP:
@@ -1058,8 +1054,6 @@ isRetainer( StgClosure *c )
     case PAP:
        // indirection
     case IND_PERM:
-    case IND_OLDGEN_PERM:
-    case IND_OLDGEN:
     case BLACKHOLE:
        // static objects
     case CONSTR_STATIC:
index b427c94..c46f8b2 100644 (file)
@@ -188,9 +188,7 @@ removeIndirections(StgClosure* p)
 
   while (get_itbl(q)->type == IND ||
          get_itbl(q)->type == IND_STATIC ||
-         get_itbl(q)->type == IND_OLDGEN ||
-         get_itbl(q)->type == IND_PERM ||
-         get_itbl(q)->type == IND_OLDGEN_PERM ) {
+         get_itbl(q)->type == IND_PERM) {
       q = ((StgInd *)q)->indirectee;
       tag = GET_CLOSURE_TAG(q);
       q = UNTAG_CLOSURE(q);
index 1dec6e6..1bc6dc6 100644 (file)
@@ -235,45 +235,6 @@ INFO_TABLE(stg_IND_PERM,1,0,IND_PERM,"IND_PERM","IND_PERM")
     jump %GET_ENTRY(R1);
 }  
 
-
-INFO_TABLE(stg_IND_OLDGEN,1,0,IND_OLDGEN,"IND_OLDGEN","IND_OLDGEN")
-{
-    TICK_ENT_STATIC_IND();     /* tick */
-    R1 = UNTAG(StgInd_indirectee(R1));
-    TICK_ENT_VIA_NODE();
-    jump %GET_ENTRY(R1);
-}
-
-INFO_TABLE(stg_IND_OLDGEN_PERM,1,0,IND_OLDGEN_PERM,"IND_OLDGEN_PERM","IND_OLDGEN_PERM")
-{
-    /* Don't: TICK_ENT_STATIC_IND(Node); for ticky-ticky; 
-       this ind is here only to help profiling */
-
-#if defined(TICKY_TICKY) && !defined(PROFILING)
-    /* TICKY_TICKY && !PROFILING means PERM_IND *replaces* an IND, 
-       rather than being extra  */
-    TICK_ENT_PERM_IND(); /* tick */
-#endif
-
-    LDV_ENTER(R1);
-
-    /* Enter PAP cost centre -- lexical scoping only */
-    ENTER_CCS_PAP_CL(R1);
-
-    /* see comment in IND_PERM */
-#ifdef TICKY_TICKY
-#  ifdef PROFILING
-#    error Profiling and ticky-ticky do not mix at present!
-#  endif  /* PROFILING */
-    StgHeader_info(R1) = stg_IND_OLDGEN_info;
-#endif /* TICKY_TICKY */
-
-    R1 = UNTAG(StgInd_indirectee(R1));
-
-    TICK_ENT_VIA_NODE();
-    jump %GET_ENTRY(R1);
-}
-
 /* ----------------------------------------------------------------------------
    Black holes.
 
index de9276c..4872adf 100644 (file)
@@ -22,8 +22,8 @@ BEGIN_RTS_PRIVATE
  * which p1 resides.
  *
  * Note: 
- *   After all, we do *NOT* need to call LDV_RECORD_CREATE() for both IND and 
- *   IND_OLDGEN closures because they are inherently used. But, it corrupts
+ *   After all, we do *NOT* need to call LDV_RECORD_CREATE() for IND
+ *   closures because they are inherently used. But, it corrupts
  *   the invariants that every closure keeps its creation time in the profiling
  *  field. So, we call LDV_RECORD_CREATE().
  */
index 7eeb90f..fd6c92f 100644 (file)
@@ -664,8 +664,6 @@ thread_obj (StgInfoTable *info, StgPtr p)
     
     case IND:
     case IND_PERM:
-    case IND_OLDGEN:
-    case IND_OLDGEN_PERM:
        thread(&((StgInd *)p)->indirectee);
        return p + sizeofW(StgInd);
 
index 9577b2d..61cf10b 100644 (file)
@@ -620,7 +620,6 @@ loop:
 
   case FUN:
   case IND_PERM:
-  case IND_OLDGEN_PERM:
   case CONSTR:
       copy_tag_nolock(p,info,q,sizeW_fromITBL(INFO_PTR_TO_STRUCT(info)),gen,tag);
       return;
@@ -666,7 +665,6 @@ loop:
       return;
 
   case IND:
-  case IND_OLDGEN:
     // follow chains of indirections, don't evacuate them 
     q = ((StgInd*)q)->indirectee;
     *p = q;
@@ -971,8 +969,6 @@ selector_loop:
                   switch (info->type) {
                   case IND:
                   case IND_PERM:
-                  case IND_OLDGEN:
-                  case IND_OLDGEN_PERM:
                   case IND_STATIC:
                       val = ((StgInd *)val)->indirectee;
                       goto val_loop;
@@ -1006,8 +1002,6 @@ selector_loop:
 
       case IND:
       case IND_PERM:
-      case IND_OLDGEN:
-      case IND_OLDGEN_PERM:
       case IND_STATIC:
           // Again, we might need to untag a constructor.
           selectee = UNTAG_CLOSURE( ((StgInd *)selectee)->indirectee );
index 0fb8e1f..cbbb8b6 100644 (file)
@@ -90,8 +90,6 @@ isAlive(StgClosure *p)
     case IND:
     case IND_STATIC:
     case IND_PERM:
-    case IND_OLDGEN:           // rely on compatible layout with StgInd 
-    case IND_OLDGEN_PERM:
       // follow indirections 
       p = ((StgInd *)q)->indirectee;
       continue;
index 2069711..a2cdfc0 100644 (file)
@@ -303,8 +303,6 @@ checkClosure( StgClosure* p )
     case CONSTR_0_2:
     case CONSTR_2_0:
     case IND_PERM:
-    case IND_OLDGEN:
-    case IND_OLDGEN_PERM:
     case BLACKHOLE:
     case PRIM:
     case MUT_PRIM:
index ae9e81c..54bf47c 100644 (file)
@@ -550,23 +550,6 @@ scavenge_block (bdescr *bd)
     }
 
     case IND_PERM:
-      if (bd->gen_no != 0) {
-#ifdef PROFILING
-        // @LDV profiling
-        // No need to call LDV_recordDead_FILL_SLOP_DYNAMIC() because an 
-        // IND_OLDGEN_PERM closure is larger than an IND_PERM closure.
-        LDV_recordDead((StgClosure *)p, sizeofW(StgInd));
-#endif        
-        // 
-        // Todo: maybe use SET_HDR() and remove LDV_RECORD_CREATE()?
-        //
-       SET_INFO(((StgClosure *)p), &stg_IND_OLDGEN_PERM_info);
-
-        // We pretend that p has just been created.
-        LDV_RECORD_CREATE((StgClosure *)p);
-      }
-       // fall through 
-    case IND_OLDGEN_PERM:
     case BLACKHOLE:
        evacuate(&((StgInd *)p)->indirectee);
        p += sizeofW(StgInd);
@@ -896,8 +879,6 @@ scavenge_mark_stack(void)
            break;
 
        case IND:
-       case IND_OLDGEN:
-       case IND_OLDGEN_PERM:
         case BLACKHOLE:
            evacuate(&((StgInd *)p)->indirectee);
            break;
@@ -1284,8 +1265,6 @@ scavenge_one(StgPtr p)
         // IND can happen, for example, when the interpreter allocates
         // a gigantic AP closure (more than one block), which ends up
         // on the large-object list and then gets updated.  See #3424.
-    case IND_OLDGEN:
-    case IND_OLDGEN_PERM:
     case BLACKHOLE:
     case IND_STATIC:
        evacuate(&((StgInd *)p)->indirectee);
index 16d3394..d9e6041 100644 (file)
@@ -467,10 +467,8 @@ genApply regstatus args =
 --        print "    [THUNK_STATIC]    &&thunk_lbl,"
 --        print "    [THUNK_SELECTOR]  &&thunk_lbl,"
 --        print "    [IND]           &&ind_lbl,"
---        print "    [IND_OLDGEN]      &&ind_lbl,"
 --        print "    [IND_STATIC]      &&ind_lbl,"
 --        print "    [IND_PERM]              &&ind_lbl,"
---        print "    [IND_OLDGEN_PERM] &&ind_lbl"
 --        print "  };"
     
        tickForArity (length args),
@@ -590,10 +588,8 @@ genApply regstatus args =
 --        print "    ind_lbl:"
 --    else:
         text "case IND,",
-        text "     IND_OLDGEN,",
         text "     IND_STATIC,",
-        text "     IND_PERM,",
-        text "     IND_OLDGEN_PERM: {",
+        text "     IND_PERM: {",
        nest 4 (vcat [
          text "R1 = StgInd_indirectee(R1);",
             -- An indirection node might contain a tagged pointer