From: Russ Cox Date: Mon, 20 Feb 2012 18:41:44 +0000 (-0500) Subject: 5g, 6g, 8g: flush modified globals aggressively X-Git-Tag: weekly.2012-02-22~75 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8998835543c0055b66c034fbca53d7c294f3956e;p=gostls13.git 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 --- diff --git a/src/cmd/5g/reg.c b/src/cmd/5g/reg.c index b72b9c1657..93724d0326 100644 --- a/src/cmd/5g/reg.c +++ b/src/cmd/5g/reg.c @@ -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; zset.b[z]) | diff --git a/src/cmd/6g/reg.c b/src/cmd/6g/reg.c index 82a2ce3125..bed9f8da68 100644 --- a/src/cmd/6g/reg.c +++ b/src/cmd/6g/reg.c @@ -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; zset.b[z]) | diff --git a/src/cmd/8g/reg.c b/src/cmd/8g/reg.c index 4ff68625d2..29270c8203 100644 --- a/src/cmd/8g/reg.c +++ b/src/cmd/8g/reg.c @@ -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; zset.b[z]) |