1
0
mirror of https://github.com/golang/go synced 2024-11-22 03:44:39 -07:00

5g, 6g, 8g: flush modified globals aggressively

The alternative is to record enough information that the
trap handler know which registers contain cached globals
and can flush the registers back to their original locations.
That's significantly more work.

This only affects globals that have been written to.
Code that reads from a global should continue to registerize
as well as before.

Fixes #1304.

R=ken2
CC=golang-dev
https://golang.org/cl/5687046
This commit is contained in:
Russ Cox 2012-02-20 13:41:44 -05:00
parent f274551f96
commit 8998835543
3 changed files with 21 additions and 0 deletions

View File

@ -1029,6 +1029,13 @@ prop(Reg *r, Bits ref, Bits cal)
ref.b[z] = 0;
}
break;
default:
// Work around for issue 1304:
// flush modified globals before each instruction.
for(z=0; z<BITS; z++)
cal.b[z] |= externs.b[z];
break;
}
for(z=0; z<BITS; z++) {
ref.b[z] = (ref.b[z] & ~r1->set.b[z]) |

View File

@ -1085,6 +1085,13 @@ prop(Reg *r, Bits ref, Bits cal)
ref.b[z] = 0;
}
break;
default:
// Work around for issue 1304:
// flush modified globals before each instruction.
for(z=0; z<BITS; z++)
cal.b[z] |= externs.b[z];
break;
}
for(z=0; z<BITS; z++) {
ref.b[z] = (ref.b[z] & ~r1->set.b[z]) |

View File

@ -968,6 +968,13 @@ prop(Reg *r, Bits ref, Bits cal)
ref.b[z] = 0;
}
break;
default:
// Work around for issue 1304:
// flush modified globals before each instruction.
for(z=0; z<BITS; z++)
cal.b[z] |= externs.b[z];
break;
}
for(z=0; z<BITS; z++) {
ref.b[z] = (ref.b[z] & ~r1->set.b[z]) |