Commit c64986f7 authored by Russ Cox's avatar Russ Cox

merge first pass into main loop in span calculation.

having one copy will cut nacl changes in half.

R=ken
OCL=34815
CL=34815
parent 46e392e0
...@@ -65,27 +65,9 @@ span(void) ...@@ -65,27 +65,9 @@ span(void)
} }
} }
n = 0; n = 0;
start: start:
if(debug['v']) do{
Bprint(&bso, "%5.2f span\n", cputime()); again = 0;
Bflush(&bso);
c = INITTEXT;
for(p = firstp; p != P; p = p->link) {
if(p->as == ATEXT)
curtext = p;
if(p->to.type == D_BRANCH)
if(p->back)
p->pc = c;
asmins(p);
p->pc = c;
m = andptr-and;
p->mark = m;
c += m;
}
loop:
n++;
if(debug['v']) if(debug['v'])
Bprint(&bso, "%5.2f span %d\n", cputime(), n); Bprint(&bso, "%5.2f span %d\n", cputime(), n);
Bflush(&bso); Bflush(&bso);
...@@ -93,28 +75,27 @@ loop: ...@@ -93,28 +75,27 @@ loop:
print("span must be looping\n"); print("span must be looping\n");
errorexit(); errorexit();
} }
again = 0;
c = INITTEXT; c = INITTEXT;
for(p = firstp; p != P; p = p->link) { for(p = firstp; p != P; p = p->link) {
if(p->as == ATEXT) if(p->as == ATEXT)
curtext = p; curtext = p;
if(p->to.type == D_BRANCH) { if(p->to.type == D_BRANCH)
if(p->back) if(p->back)
p->pc = c; p->pc = c;
if(n == 0 || p->to.type == D_BRANCH) {
asmins(p); asmins(p);
m = andptr-and; m = andptr-and;
if(m != p->mark) {
p->mark = m; p->mark = m;
again++;
}
} }
if(c != p->pc)
again = 1;
p->pc = c; p->pc = c;
c += p->mark; c += p->mark;
} }
if(again) {
textsize = c; textsize = c;
goto loop; n++;
} }while(again);
if(INITRND) { if(INITRND) {
INITDAT = rnd(c, INITRND); INITDAT = rnd(c, INITRND);
if(INITDAT != idat) { if(INITDAT != idat) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment