Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/runtime/gc/major-gc.c
ViewVC logotype

Diff of /sml/trunk/src/runtime/gc/major-gc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 8, Sun Jan 18 01:01:29 1998 UTC revision 106, Thu May 28 21:30:17 1998 UTC
# Line 712  Line 712 
712    
713      switch (EXTRACT_OBJC(id)) {      switch (EXTRACT_OBJC(id)) {
714        case OBJC_record: {        case OBJC_record: {
715    #ifdef POINTERS_INTO_OBJECTS
716          for (obj_start = obj;  !isDESC(desc = obj_start[-1]);  obj_start--)          for (obj_start = obj;  !isDESC(desc = obj_start[-1]);  obj_start--)
717              continue;              continue;
718    #else
719            obj_start = obj;
720            desc = obj_start[-1];
721    #endif
722          if (desc == DESC_forwarded)          if (desc == DESC_forwarded)
723            /* This object has already been forwarded */            /* This object has already been forwarded */
724              return PTR_CtoML(FOLLOW_FWDOBJ(obj_start, obj));              return PTR_CtoML(FOLLOW_FWDOBJ(obj_start, obj));
# Line 726  Line 731 
731        case OBJC_pair: {        case OBJC_pair: {
732          ml_val_t        w;          ml_val_t        w;
733    
734    #ifdef POINTERS_INTO_OBJECTS
735          obj_start = (ml_val_t *)((Addr_t)obj & ~(PAIR_SZB-1));  /* in case obj is derived */          obj_start = (ml_val_t *)((Addr_t)obj & ~(PAIR_SZB-1));  /* in case obj is derived */
736    #else
737            obj_start = obj;
738    #endif
739          w = obj_start[0];          w = obj_start[0];
740          if (isDESC(w))          if (isDESC(w))
741              return PTR_CtoML(FOLLOW_FWDPAIR(w, obj_start, obj));              return PTR_CtoML(FOLLOW_FWDPAIR(w, obj_start, obj));
# Line 741  Line 750 
750              new_obj[1] = obj_start[1];              new_obj[1] = obj_start[1];
751            /* setup the forward pointer in the old pair */            /* setup the forward pointer in the old pair */
752              obj_start[0] =  MAKE_PAIR_FP(new_obj);              obj_start[0] =  MAKE_PAIR_FP(new_obj);
753    #ifdef POINTERS_INTO_OBJECTS
754              return PTR_CtoML(new_obj + (obj - obj_start));              return PTR_CtoML(new_obj + (obj - obj_start));
755    #else
756                return PTR_CtoML(new_obj);
757    #endif
758          }          }
759        } break;        } break;
760    
# Line 798  Line 811 
811        }        }
812    
813        case OBJC_array: {        case OBJC_array: {
814    #ifdef POINTERS_INTO_OBJECTS
815          for (obj_start = obj;  !isDESC(desc = obj_start[-1]);  obj_start--)          for (obj_start = obj;  !isDESC(desc = obj_start[-1]);  obj_start--)
816              continue;              continue;
817    #else
818            obj_start = obj;
819            desc = obj_start[-1];
820    #endif
821          switch (GET_TAG(desc)) {          switch (GET_TAG(desc)) {
822            case DTAG_forwarded:            case DTAG_forwarded:
823            /* This object has already been forwarded */            /* This object has already been forwarded */
# Line 833  Line 851 
851    /* set up the forward pointer, and return the new object. */    /* set up the forward pointer, and return the new object. */
852      obj_start[-1] = DESC_forwarded;      obj_start[-1] = DESC_forwarded;
853      obj_start[0] = (ml_val_t)(Addr_t)new_obj;      obj_start[0] = (ml_val_t)(Addr_t)new_obj;
854    #ifdef POINTERS_INTO_OBJECTS
855      return PTR_CtoML(new_obj + (obj - obj_start));      return PTR_CtoML(new_obj + (obj - obj_start));
856    #else
857        return PTR_CtoML(new_obj);
858    #endif
859    
860  } /* end of MajorGC_ForwardObj */  } /* end of MajorGC_ForwardObj */
861    

Legend:
Removed from v.8  
changed lines
  Added in v.106

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0