author | Camm Maguire <camm@debian.org> | 2014年11月04日 16:11:05 -0500 |
---|---|---|
committer | Camm Maguire <camm@debian.org> | 2014年11月04日 16:11:05 -0500 |
commit | d270430e214772c832a8ee2a7f8aca4e25a50d74 (patch) | |
tree | 80765b3baa7b4f75067ad9a6934ef5c1eeacf90d | |
parent | 8124395463d00b936d19bee630503690411eec8c (diff) | |
download | gcl-fsgc.tar.gz |
-rwxr-xr-x | gcl/o/sgbc.c | 67 |
diff --git a/gcl/o/sgbc.c b/gcl/o/sgbc.c index 9e0f53a53..938a55b34 100755 --- a/gcl/o/sgbc.c +++ b/gcl/o/sgbc.c @@ -109,12 +109,18 @@ joe() {;} inline void sgc_mark_cons(object x) { + bool w=0; + ufixnum p,lp=0; + do { object d=x->c.c_cdr; mark(x); sgc_mark_object(x->c.c_car); - x=d; - if (!IS_WRITABLE(page(x)) || is_marked_or_free(x))/*catches Cnil*/ + if ((p=page(x=d))!=lp||!w) { + lp=p; + w=IS_WRITABLE(p); + } + if (!w || is_marked_or_free(x))/*catches Cnil*/ return; } while (cdr_listp(x)); sgc_mark_object(x); @@ -226,10 +232,18 @@ sgc_mark_object1(object x) { sgc_mark_object(x->ht.ht_rhthresh); if (x->ht.ht_self == NULL) break; - for (i = 0, j = x->ht.ht_size; i < j; i++) { - if (ON_WRITABLE_PAGE(&x->ht.ht_self[i])) { - sgc_mark_object(x->ht.ht_self[i].hte_key); - sgc_mark_object(x->ht.ht_self[i].hte_value); + j = x->ht.ht_size; + { + struct htent *e=x->ht.ht_self,*ee=e+j; + ufixnum p=page(e),pe=page(ee); + for (;p<=pe;p++) { + bool w=WRITABLE_PAGE_P(p); + struct htent *en=(void *)pagetoinfo(p+1); + for (;e<ee && e<en;e++) + if (w) { + sgc_mark_object(x->ht.ht_self[i].hte_key); + sgc_mark_object(x->ht.ht_self[i].hte_value); + } } } if (inheap(x->ht.ht_self)) { @@ -291,10 +305,20 @@ sgc_mark_object1(object x) { ) break; j=0; - if (x->a.a_displaced->c.c_car == Cnil) - for (i = 0, j = x->a.a_dim; i < j; i++) - if (ON_WRITABLE_PAGE(&p[i])) - sgc_mark_object(p[i]); + if (x->a.a_displaced->c.c_car == Cnil) { + object *o=p,*oe=p+(j=x->a.a_dim); + ufixnum p=page(o),pe=page(oe); + for (;p<=pe;p++) { + bool w=WRITABLE_PAGE_P(p); + object *on=(void *)pagetoinfo(p+1); + for (;o<oe && o<on;o++) + if (w) + sgc_mark_object(*o); + } + } + /* for (i = 0, j = x->a.a_dim; i < j; i++) */ + /* if (ON_WRITABLE_PAGE(&p[i])) */ + /* sgc_mark_object(p[i]); */ cp = (char *)p; j *= sizeof(object); COPY: @@ -389,9 +413,26 @@ sgc_mark_object1(object x) { object def=x->str.str_def; unsigned char *s_type = &SLOT_TYPE(def,0); unsigned short *s_pos = &SLOT_POS (def,0); - for (i = 0, j = S_DATA(def)->length; i < j; i++) - if (s_type[i]==0 && ON_WRITABLE_PAGE(&STREF(object,x,s_pos[i]))) - sgc_mark_object(STREF(object,x,s_pos[i])); + ufixnum lp=0; + bool w=FALSE; + + for (i=0,j=S_DATA(def)->length;i<j;i++) { + + object *o=&STREF(object,x,s_pos[i]); + ufixnum p=page(o); + + if (i==0 || p!=lp) { + lp=p; + w=WRITABLE_PAGE_P(p); + } + + if (s_type[i]==0 && w) + sgc_mark_object(*o); + + } + /* for (i = 0, j = S_DATA(def)->length; i < j; i++) */ + /* if (s_type[i]==0 && ON_WRITABLE_PAGE(&STREF(object,x,s_pos[i]))) */ + /* sgc_mark_object(STREF(object,x,s_pos[i])); */ if (inheap(x->str.str_self)) { if (what_to_collect == t_contiguous) mark_contblock((char *)p,S_DATA(def)->size); |