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,56 +65,37 @@ span(void) ...@@ -65,56 +65,37 @@ span(void)
} }
} }
n = 0; n = 0;
start: start:
if(debug['v']) do{
Bprint(&bso, "%5.2f span\n", cputime()); again = 0;
Bflush(&bso); if(debug['v'])
c = INITTEXT; Bprint(&bso, "%5.2f span %d\n", cputime(), n);
for(p = firstp; p != P; p = p->link) { Bflush(&bso);
if(p->as == ATEXT) if(n > 50) {
curtext = p; print("span must be looping\n");
if(p->to.type == D_BRANCH) errorexit();
if(p->back) }
p->pc = c; c = INITTEXT;
asmins(p); for(p = firstp; p != P; p = p->link) {
p->pc = c; if(p->as == ATEXT)
m = andptr-and; curtext = p;
p->mark = m; if(p->to.type == D_BRANCH)
c += m; if(p->back)
} p->pc = c;
if(n == 0 || p->to.type == D_BRANCH) {
loop: asmins(p);
n++; m = andptr-and;
if(debug['v'])
Bprint(&bso, "%5.2f span %d\n", cputime(), n);
Bflush(&bso);
if(n > 50) {
print("span must be looping\n");
errorexit();
}
again = 0;
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);
m = andptr-and;
if(m != p->mark) {
p->mark = m; p->mark = m;
again++;
} }
if(c != p->pc)
again = 1;
p->pc = c;
c += p->mark;
} }
p->pc = c;
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