/[guile]/guile/guile-core/libguile/gc-mark.c
ViewVC logotype

Diff of /guile/guile-core/libguile/gc-mark.c

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

revision 1.1 by hanwen, Sun Aug 4 00:18:33 2002 UTC revision 1.2 by hanwen, Mon Aug 5 17:46:34 2002 UTC
# Line 192  scm_gc_mark (SCM ptr) Line 192  scm_gc_mark (SCM ptr)
192    
193  Mark the dependencies of an object.  Mark the dependencies of an object.
194    
195  TODO:  Prefetching:
196    
197  Should prefetch objects before marking, i.e. if marking a cell, we  Should prefetch objects before marking, i.e. if marking a cell, we
198  should prefetch the car, and then mark the cdr. This will improve CPU  should prefetch the car, and then mark the cdr. This will improve CPU
# Line 204  garbage collector cache misses. Line 204  garbage collector cache misses.
204    
205  Prefetch is supported on GCC >= 3.1  Prefetch is supported on GCC >= 3.1
206    
207   */  (Some time later.)
208    
209    Tried this with GCC 3.1.1 -- the time differences are barely measurable.
210    Perhaps this would work better with an explicit markstack?
211    
212    
213    */
214  void  void
215  scm_gc_mark_dependencies (SCM p)  scm_gc_mark_dependencies (SCM p)
216  #define FUNC_NAME "scm_gc_mark_dependencies"  #define FUNC_NAME "scm_gc_mark_dependencies"
# Line 225  scm_gc_mark_dependencies (SCM p) Line 231  scm_gc_mark_dependencies (SCM p)
231            ptr = SCM_CAR (ptr);            ptr = SCM_CAR (ptr);
232            goto gc_mark_nimp;            goto gc_mark_nimp;
233          }          }
234    
235    
236        scm_gc_mark (SCM_CAR (ptr));        scm_gc_mark (SCM_CAR (ptr));
237        ptr = SCM_CDR (ptr);        ptr = SCM_CDR (ptr);
238        goto gc_mark_nimp;        goto gc_mark_nimp;
# Line 232  scm_gc_mark_dependencies (SCM p) Line 240  scm_gc_mark_dependencies (SCM p)
240        ptr = SCM_CDR (ptr);        ptr = SCM_CDR (ptr);
241        goto gc_mark_loop;        goto gc_mark_loop;
242      case scm_tc7_pws:      case scm_tc7_pws:
243    
244        scm_gc_mark (SCM_SETTER (ptr));        scm_gc_mark (SCM_SETTER (ptr));
245        ptr = SCM_PROCEDURE (ptr);        ptr = SCM_PROCEDURE (ptr);
246        goto gc_mark_loop;        goto gc_mark_loop;
# Line 285  scm_gc_mark_dependencies (SCM p) Line 294  scm_gc_mark_dependencies (SCM p)
294        if (i == 0)        if (i == 0)
295          break;          break;
296        while (--i > 0)        while (--i > 0)
297          if (SCM_NIMP (SCM_VELTS (ptr)[i]))          {
298            scm_gc_mark (SCM_VELTS (ptr)[i]);            if (SCM_NIMP (SCM_VELTS (ptr)[i]))
299                scm_gc_mark (SCM_VELTS (ptr)[i]);
300            }
301        ptr = SCM_VELTS (ptr)[0];        ptr = SCM_VELTS (ptr)[0];
302        goto gc_mark_loop;        goto gc_mark_loop;
303  #ifdef CCLO  #ifdef CCLO

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26