aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorShenghou Ma <minux@golang.org>2014-12-29 01:08:40 -0500
committerKeith Randall <khr@golang.org>2014-12-29 07:36:07 +0000
commitab0535ae3fb45ba734d47542cc4845f27f708d1b (patch)
tree0357ccba7c596a90470785ebd189416d15b6d74e /src/runtime
parent3b76b017cabb0ea29a184670e081edfe11afb8de (diff)
downloadgo-ab0535ae3fb45ba734d47542cc4845f27f708d1b.tar.xz
liblink, cmd/ld, runtime: remove stackguard1
Now that we've removed all the C code in runtime and the C compilers, there is no need to have a separate stackguard field to check for C code on Go stack. Remove field g.stackguard1 and rename g.stackguard0 to g.stackguard. Adjust liblink and cmd/ld as necessary. Change-Id: I54e75db5a93d783e86af5ff1a6cd497d669d8d33 Reviewed-on: https://go-review.googlesource.com/2144 Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/asm_386.s6
-rw-r--r--src/runtime/asm_amd64.s6
-rw-r--r--src/runtime/asm_amd64p32.s3
-rw-r--r--src/runtime/asm_arm.s6
-rw-r--r--src/runtime/asm_ppc64x.s3
-rw-r--r--src/runtime/lock_futex.go2
-rw-r--r--src/runtime/lock_sema.go2
-rw-r--r--src/runtime/malloc.go6
-rw-r--r--src/runtime/proc1.go49
-rw-r--r--src/runtime/runtime1.go2
-rw-r--r--src/runtime/runtime2.go12
-rw-r--r--src/runtime/stack1.go21
-rw-r--r--src/runtime/stack2.go2
-rw-r--r--src/runtime/sys_plan9_386.s3
-rw-r--r--src/runtime/sys_plan9_amd64.s3
-rw-r--r--src/runtime/sys_solaris_amd64.s3
-rw-r--r--src/runtime/sys_windows_386.s6
-rw-r--r--src/runtime/sys_windows_amd64.s6
18 files changed, 55 insertions, 86 deletions
diff --git a/src/runtime/asm_386.s b/src/runtime/asm_386.s
index 5ae869b1de..40b5c2e010 100644
--- a/src/runtime/asm_386.s
+++ b/src/runtime/asm_386.s
@@ -20,8 +20,7 @@ TEXT runtime·rt0_go(SB),NOSPLIT,$0
// _cgo_init may update stackguard.
MOVL $runtime·g0(SB), BP
LEAL (-64*1024+104)(SP), BX
- MOVL BX, g_stackguard0(BP)
- MOVL BX, g_stackguard1(BP)
+ MOVL BX, g_stackguard(BP)
MOVL BX, (g_stack+stack_lo)(BP)
MOVL SP, (g_stack+stack_hi)(BP)
@@ -51,8 +50,7 @@ nocpuinfo:
MOVL $runtime·g0(SB), CX
MOVL (g_stack+stack_lo)(CX), AX
ADDL $const__StackGuard, AX
- MOVL AX, g_stackguard0(CX)
- MOVL AX, g_stackguard1(CX)
+ MOVL AX, g_stackguard(CX)
// skip runtime·ldt0setup(SB) and tls test after _cgo_init for non-windows
CMPL runtime·iswindows(SB), $0
diff --git a/src/runtime/asm_amd64.s b/src/runtime/asm_amd64.s
index 0ec5d7a806..3d96d09014 100644
--- a/src/runtime/asm_amd64.s
+++ b/src/runtime/asm_amd64.s
@@ -20,8 +20,7 @@ TEXT runtime·rt0_go(SB),NOSPLIT,$0
// _cgo_init may update stackguard.
MOVQ $runtime·g0(SB), DI
LEAQ (-64*1024+104)(SP), BX
- MOVQ BX, g_stackguard0(DI)
- MOVQ BX, g_stackguard1(DI)
+ MOVQ BX, g_stackguard(DI)
MOVQ BX, (g_stack+stack_lo)(DI)
MOVQ SP, (g_stack+stack_hi)(DI)
@@ -49,8 +48,7 @@ nocpuinfo:
MOVQ $runtime·g0(SB), CX
MOVQ (g_stack+stack_lo)(CX), AX
ADDQ $const__StackGuard, AX
- MOVQ AX, g_stackguard0(CX)
- MOVQ AX, g_stackguard1(CX)
+ MOVQ AX, g_stackguard(CX)
CMPL runtime·iswindows(SB), $0
JEQ ok
diff --git a/src/runtime/asm_amd64p32.s b/src/runtime/asm_amd64p32.s
index 0749b3e85f..6a8544ed45 100644
--- a/src/runtime/asm_amd64p32.s
+++ b/src/runtime/asm_amd64p32.s
@@ -22,8 +22,7 @@ TEXT runtime·rt0_go(SB),NOSPLIT,$0
// create istack out of the given (operating system) stack.
MOVL $runtime·g0(SB), DI
LEAL (-64*1024+104)(SP), BX
- MOVL BX, g_stackguard0(DI)
- MOVL BX, g_stackguard1(DI)
+ MOVL BX, g_stackguard(DI)
MOVL BX, (g_stack+stack_lo)(DI)
MOVL SP, (g_stack+stack_hi)(DI)
diff --git a/src/runtime/asm_arm.s b/src/runtime/asm_arm.s
index fdcc0e67c1..6fe931bd89 100644
--- a/src/runtime/asm_arm.s
+++ b/src/runtime/asm_arm.s
@@ -32,8 +32,7 @@ TEXT runtime·rt0_go(SB),NOSPLIT,$-4
// create istack out of the OS stack
MOVW $(-8192+104)(R13), R0
- MOVW R0, g_stackguard0(g)
- MOVW R0, g_stackguard1(g)
+ MOVW R0, g_stackguard(g)
MOVW R0, (g_stack+stack_lo)(g)
MOVW R13, (g_stack+stack_hi)(g)
@@ -56,8 +55,7 @@ nocgo:
// update stackguard after _cgo_init
MOVW (g_stack+stack_lo)(g), R0
ADD $const__StackGuard, R0
- MOVW R0, g_stackguard0(g)
- MOVW R0, g_stackguard1(g)
+ MOVW R0, g_stackguard(g)
BL runtime·checkgoarm(SB)
BL runtime·check(SB)
diff --git a/src/runtime/asm_ppc64x.s b/src/runtime/asm_ppc64x.s
index 1360c6ed3b..86cf685747 100644
--- a/src/runtime/asm_ppc64x.s
+++ b/src/runtime/asm_ppc64x.s
@@ -22,8 +22,7 @@ TEXT runtime·rt0_go(SB),NOSPLIT,$0
MOVD $runtime·g0(SB), g
MOVD $(-64*1024), R31
ADD R31, R1, R3
- MOVD R3, g_stackguard0(g)
- MOVD R3, g_stackguard1(g)
+ MOVD R3, g_stackguard(g)
MOVD R3, (g_stack+stack_lo)(g)
MOVD R1, (g_stack+stack_hi)(g)
diff --git a/src/runtime/lock_futex.go b/src/runtime/lock_futex.go
index 6e1f1e9da4..d1a45eb6e9 100644
--- a/src/runtime/lock_futex.go
+++ b/src/runtime/lock_futex.go
@@ -114,7 +114,7 @@ func unlock(l *mutex) {
throw("runtime·unlock: lock count")
}
if gp.m.locks == 0 && gp.preempt { // restore the preemption request in case we've cleared it in newstack
- gp.stackguard0 = stackPreempt
+ gp.stackguard = stackPreempt
}
}
diff --git a/src/runtime/lock_sema.go b/src/runtime/lock_sema.go
index c995e08441..556551f3b5 100644
--- a/src/runtime/lock_sema.go
+++ b/src/runtime/lock_sema.go
@@ -115,7 +115,7 @@ func unlock(l *mutex) {
throw("runtime·unlock: lock count")
}
if gp.m.locks == 0 && gp.preempt { // restore the preemption request in case we've cleared it in newstack
- gp.stackguard0 = stackPreempt
+ gp.stackguard = stackPreempt
}
}
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go
index 9774cbf26f..d6353d95fd 100644
--- a/src/runtime/malloc.go
+++ b/src/runtime/malloc.go
@@ -64,7 +64,7 @@ func mallocgc(size uintptr, typ *_type, flags uint32) unsafe.Pointer {
}
mp.mallocing = 1
if mp.curg != nil {
- mp.curg.stackguard0 = ^uintptr(0xfff) | 0xbad
+ mp.curg.stackguard = ^uintptr(0xfff) | 0xbad
}
}
@@ -127,7 +127,7 @@ func mallocgc(size uintptr, typ *_type, flags uint32) unsafe.Pointer {
}
mp.mallocing = 0
if mp.curg != nil {
- mp.curg.stackguard0 = mp.curg.stack.lo + _StackGuard
+ mp.curg.stackguard = mp.curg.stack.lo + _StackGuard
}
// Note: one releasem for the acquirem just above.
// The other for the acquirem at start of malloc.
@@ -319,7 +319,7 @@ marked:
}
mp.mallocing = 0
if mp.curg != nil {
- mp.curg.stackguard0 = mp.curg.stack.lo + _StackGuard
+ mp.curg.stackguard = mp.curg.stack.lo + _StackGuard
}
// Note: one releasem for the acquirem just above.
// The other for the acquirem at start of malloc.
diff --git a/src/runtime/proc1.go b/src/runtime/proc1.go
index cc4630088a..32c9754fa9 100644
--- a/src/runtime/proc1.go
+++ b/src/runtime/proc1.go
@@ -179,9 +179,6 @@ func mcommoninit(mp *m) {
sched.mcount++
checkmcount()
mpreinit(mp)
- if mp.gsignal != nil {
- mp.gsignal.stackguard1 = mp.gsignal.stack.lo + _StackGuard
- }
// Add to allm so garbage collector doesn't free g->m
// when it is just in a register or thread-local storage.
@@ -213,7 +210,7 @@ func ready(gp *g) {
}
_g_.m.locks--
if _g_.m.locks == 0 && _g_.preempt { // restore the preemption request in case we've cleared it in newstack
- _g_.stackguard0 = stackPreempt
+ _g_.stackguard = stackPreempt
}
}
@@ -463,7 +460,7 @@ func stopg(gp *g) bool {
if !gp.gcworkdone {
gp.preemptscan = true
gp.preempt = true
- gp.stackguard0 = stackPreempt
+ gp.stackguard = stackPreempt
}
// Unclaim.
@@ -545,7 +542,7 @@ func mquiesce(gpmaster *g) {
gp.gcworkdone = true // scan is a noop
break
}
- if status == _Grunning && gp.stackguard0 == uintptr(stackPreempt) && notetsleep(&sched.stopnote, 100*1000) { // nanosecond arg
+ if status == _Grunning && gp.stackguard == uintptr(stackPreempt) && notetsleep(&sched.stopnote, 100*1000) { // nanosecond arg
noteclear(&sched.stopnote)
} else {
stopscanstart(gp)
@@ -704,7 +701,7 @@ func starttheworld() {
}
_g_.m.locks--
if _g_.m.locks == 0 && _g_.preempt { // restore the preemption request in case we've cleared it in newstack
- _g_.stackguard0 = stackPreempt
+ _g_.stackguard = stackPreempt
}
}
@@ -725,8 +722,7 @@ func mstart() {
}
// Initialize stack guards so that we can start calling
// both Go and C functions with stack growth prologues.
- _g_.stackguard0 = _g_.stack.lo + _StackGuard
- _g_.stackguard1 = _g_.stackguard0
+ _g_.stackguard = _g_.stack.lo + _StackGuard
mstart1()
}
@@ -806,7 +802,7 @@ func allocm(_p_ *p) *m {
}
_g_.m.locks--
if _g_.m.locks == 0 && _g_.preempt { // restore the preemption request in case we've cleared it in newstack
- _g_.stackguard0 = stackPreempt
+ _g_.stackguard = stackPreempt
}
return mp
@@ -883,7 +879,7 @@ func needm(x byte) {
_g_ := getg()
_g_.stack.hi = uintptr(noescape(unsafe.Pointer(&x))) + 1024
_g_.stack.lo = uintptr(noescape(unsafe.Pointer(&x))) - 32*1024
- _g_.stackguard0 = _g_.stack.lo + _StackGuard
+ _g_.stackguard = _g_.stack.lo + _StackGuard
// Initialize this thread to use the m.
asminit()
@@ -1221,7 +1217,7 @@ func execute(gp *g) {
casgstatus(gp, _Grunnable, _Grunning)
gp.waitsince = 0
gp.preempt = false
- gp.stackguard0 = gp.stack.lo + _StackGuard
+ gp.stackguard = gp.stack.lo + _StackGuard
_g_.m.p.schedtick++
_g_.m.curg = gp
gp.m = _g_.m
@@ -1617,7 +1613,7 @@ func reentersyscall(pc, sp uintptr) {
// (See details in comment above.)
// Catch calls that might, by replacing the stack guard with something that
// will trip any stack check and leaving a flag to tell newstack to die.
- _g_.stackguard0 = stackPreempt
+ _g_.stackguard = stackPreempt
_g_.throwsplit = true
// Leave SP around for GC and traceback.
@@ -1648,7 +1644,7 @@ func reentersyscall(pc, sp uintptr) {
// Goroutines must not split stacks in Gsyscall status (it would corrupt g->sched).
// We set _StackGuard to StackPreempt so that first split stack check calls morestack.
// Morestack detects this case and throws.
- _g_.stackguard0 = stackPreempt
+ _g_.stackguard = stackPreempt
_g_.m.locks--
}
@@ -1686,7 +1682,7 @@ func entersyscallblock(dummy int32) {
_g_.m.locks++ // see comment in entersyscall
_g_.throwsplit = true
- _g_.stackguard0 = stackPreempt // see comment in entersyscall
+ _g_.stackguard = stackPreempt // see comment in entersyscall
// Leave SP around for GC and traceback.
pc := getcallerpc(unsafe.Pointer(&dummy))
@@ -1752,10 +1748,10 @@ func exitsyscall(dummy int32) {
_g_.m.locks--
if _g_.preempt {
// restore the preemption request in case we've cleared it in newstack
- _g_.stackguard0 = stackPreempt
+ _g_.stackguard = stackPreempt
} else {
// otherwise restore the real _StackGuard, we've spoiled it in entersyscall/entersyscallblock
- _g_.stackguard0 = _g_.stack.lo + _StackGuard
+ _g_.stackguard = _g_.stack.lo + _StackGuard
}
_g_.throwsplit = false
return
@@ -1873,7 +1869,7 @@ func beforefork() {
// Code between fork and exec must not allocate memory nor even try to grow stack.
// Here we spoil g->_StackGuard to reliably detect any attempts to grow stack.
// runtime_AfterFork will undo this in parent process, but not in child.
- gp.stackguard0 = stackFork
+ gp.stackguard = stackFork
}
// Called from syscall package before fork.
@@ -1887,7 +1883,7 @@ func afterfork() {
gp := getg().m.curg
// See the comment in beforefork.
- gp.stackguard0 = gp.stack.lo + _StackGuard
+ gp.stackguard = gp.stack.lo + _StackGuard
hz := sched.profilehz
if hz != 0 {
@@ -1911,8 +1907,7 @@ func malg(stacksize int32) *g {
systemstack(func() {
newg.stack = stackalloc(uint32(stacksize))
})
- newg.stackguard0 = newg.stack.lo + _StackGuard
- newg.stackguard1 = ^uintptr(0)
+ newg.stackguard = newg.stack.lo + _StackGuard
}
return newg
}
@@ -2008,7 +2003,7 @@ func newproc1(fn *funcval, argp *uint8, narg int32, nret int32, callerpc uintptr
}
_g_.m.locks--
if _g_.m.locks == 0 && _g_.preempt { // restore the preemption request in case we've cleared it in newstack
- _g_.stackguard0 = stackPreempt
+ _g_.stackguard = stackPreempt
}
return newg
}
@@ -2027,7 +2022,7 @@ func gfput(_p_ *p, gp *g) {
stackfree(gp.stack)
gp.stack.lo = 0
gp.stack.hi = 0
- gp.stackguard0 = 0
+ gp.stackguard = 0
}
gp.schedlink = _p_.gfree
@@ -2073,7 +2068,7 @@ retry:
systemstack(func() {
gp.stack = stackalloc(_FixedStack)
})
- gp.stackguard0 = gp.stack.lo + _StackGuard
+ gp.stackguard = gp.stack.lo + _StackGuard
} else {
if raceenabled {
racemalloc(unsafe.Pointer(gp.stack.lo), gp.stack.hi-gp.stack.lo)
@@ -2778,10 +2773,10 @@ func preemptone(_p_ *p) bool {
gp.preempt = true
// Every call in a go routine checks for stack overflow by
- // comparing the current stack pointer to gp->stackguard0.
- // Setting gp->stackguard0 to StackPreempt folds
+ // comparing the current stack pointer to gp->stackguard.
+ // Setting gp->stackguard to StackPreempt folds
// preemption into the normal stack overflow check.
- gp.stackguard0 = stackPreempt
+ gp.stackguard = stackPreempt
return true
}
diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go
index 371275dbb8..6b806da2b6 100644
--- a/src/runtime/runtime1.go
+++ b/src/runtime/runtime1.go
@@ -386,7 +386,7 @@ func releasem(mp *m) {
mp.locks--
if mp.locks == 0 && _g_.preempt {
// restore the preemption request in case we've cleared it in newstack
- _g_.stackguard0 = stackPreempt
+ _g_.stackguard = stackPreempt
}
}
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index 3b7db1e412..8425729fff 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -154,14 +154,10 @@ type stack struct {
type g struct {
// Stack parameters.
// stack describes the actual stack memory: [stack.lo, stack.hi).
- // stackguard0 is the stack pointer compared in the Go stack growth prologue.
+ // stackguard is the stack pointer compared in the Go stack growth prologue.
// It is stack.lo+StackGuard normally, but can be StackPreempt to trigger a preemption.
- // stackguard1 is the stack pointer compared in the C stack growth prologue.
- // It is stack.lo+StackGuard on g0 and gsignal stacks.
- // It is ~0 on other goroutine stacks, to trigger a call to morestackc (and crash).
- stack stack // offset known to runtime/cgo
- stackguard0 uintptr // offset known to liblink
- stackguard1 uintptr // offset known to liblink
+ stack stack // offset known to runtime/cgo
+ stackguard uintptr // offset known to liblink
_panic *_panic // innermost panic - offset known to liblink
_defer *_defer // innermost defer
@@ -175,7 +171,7 @@ type g struct {
waitreason string // if status==gwaiting
schedlink *g
issystem bool // do not output in stack dump, ignore in deadlock detector
- preempt bool // preemption signal, duplicates stackguard0 = stackpreempt
+ preempt bool // preemption signal, duplicates stackguard = stackpreempt
paniconfault bool // panic (instead of crash) on unexpected fault address
preemptscan bool // preempted g does scan for gc
gcworkdone bool // debug: cleared at begining of gc work phase cycle, set by gcphasework, tested at end of cycle
diff --git a/src/runtime/stack1.go b/src/runtime/stack1.go
index 198aa50a76..6e6569f55e 100644
--- a/src/runtime/stack1.go
+++ b/src/runtime/stack1.go
@@ -26,13 +26,13 @@ const (
poisonStack = uintptrMask & 0x6868686868686868
// Goroutine preemption request.
- // Stored into g->stackguard0 to cause split stack check failure.
+ // Stored into g->stackguard to cause split stack check failure.
// Must be greater than any real sp.
// 0xfffffade in hex.
stackPreempt = uintptrMask & -1314
// Thread is forking.
- // Stored into g->stackguard0 to cause split stack check failure.
+ // Stored into g->stackguard to cause split stack check failure.
// Must be greater than any real sp.
stackFork = uintptrMask & -1234
)
@@ -566,7 +566,7 @@ func copystack(gp *g, newsize uintptr) {
// Swap out old stack for new one
gp.stack = new
- gp.stackguard0 = new.lo + _StackGuard // NOTE: might clobber a preempt request
+ gp.stackguard = new.lo + _StackGuard // NOTE: might clobber a preempt request
gp.sched.sp = new.hi - used
// free old stack
@@ -611,7 +611,7 @@ func round2(x int32) int32 {
func newstack() {
thisg := getg()
// TODO: double check all gp. shouldn't be getg().
- if thisg.m.morebuf.g.stackguard0 == stackFork {
+ if thisg.m.morebuf.g.stackguard == stackFork {
throw("stack growth after fork")
}
if thisg.m.morebuf.g != thisg.m.curg {
@@ -674,7 +674,7 @@ func newstack() {
writebarrierptr_nostore((*uintptr)(unsafe.Pointer(&gp.sched.ctxt)), uintptr(gp.sched.ctxt))
}
- if gp.stackguard0 == stackPreempt {
+ if gp.stackguard == stackPreempt {
if gp == thisg.m.g0 {
throw("runtime: preempt g0")
}
@@ -689,7 +689,7 @@ func newstack() {
gcphasework(gp)
casfrom_Gscanstatus(gp, _Gscanwaiting, _Gwaiting)
casgstatus(gp, _Gwaiting, _Grunning)
- gp.stackguard0 = gp.stack.lo + _StackGuard
+ gp.stackguard = gp.stack.lo + _StackGuard
gp.preempt = false
gp.preemptscan = false // Tells the GC premption was successful.
gogo(&gp.sched) // never return
@@ -700,7 +700,7 @@ func newstack() {
if thisg.m.locks != 0 || thisg.m.mallocing != 0 || thisg.m.gcing != 0 || thisg.m.p.status != _Prunning {
// Let the goroutine keep running for now.
// gp->preempt is set, so it will be preempted next time.
- gp.stackguard0 = gp.stack.lo + _StackGuard
+ gp.stackguard = gp.stack.lo + _StackGuard
casgstatus(gp, _Gwaiting, _Grunning)
gogo(&gp.sched) // never return
}
@@ -804,10 +804,3 @@ func shrinkfinish() {
s = t
}
}
-
-//go:nosplit
-func morestackc() {
- systemstack(func() {
- throw("attempt to execute C code on Go stack")
- })
-}
diff --git a/src/runtime/stack2.go b/src/runtime/stack2.go
index 8a78b1ad96..8cc74968ee 100644
--- a/src/runtime/stack2.go
+++ b/src/runtime/stack2.go
@@ -97,7 +97,7 @@ const (
)
// Goroutine preemption request.
-// Stored into g->stackguard0 to cause split stack check failure.
+// Stored into g->stackguard to cause split stack check failure.
// Must be greater than any real sp.
// 0xfffffade in hex.
const (
diff --git a/src/runtime/sys_plan9_386.s b/src/runtime/sys_plan9_386.s
index b9db8cbf1a..13ead5dccc 100644
--- a/src/runtime/sys_plan9_386.s
+++ b/src/runtime/sys_plan9_386.s
@@ -148,8 +148,7 @@ TEXT runtime·tstart_plan9(SB),NOSPLIT,$0
MOVL AX, (g_stack+stack_hi)(DX)
SUBL $(64*1024), AX // stack size
MOVL AX, (g_stack+stack_lo)(DX)
- MOVL AX, g_stackguard0(DX)
- MOVL AX, g_stackguard1(DX)
+ MOVL AX, g_stackguard(DX)
// Initialize procid from TOS struct.
MOVL _tos(SB), AX
diff --git a/src/runtime/sys_plan9_amd64.s b/src/runtime/sys_plan9_amd64.s
index 02c7c8743e..a958ce8a95 100644
--- a/src/runtime/sys_plan9_amd64.s
+++ b/src/runtime/sys_plan9_amd64.s
@@ -145,8 +145,7 @@ TEXT runtime·tstart_plan9(SB),NOSPLIT,$0
MOVQ AX, (g_stack+stack_hi)(DX)
SUBQ $(64*1024), AX // stack size
MOVQ AX, (g_stack+stack_lo)(DX)
- MOVQ AX, g_stackguard0(DX)
- MOVQ AX, g_stackguard1(DX)
+ MOVQ AX, g_stackguard(DX)
// Initialize procid from TOS struct.
MOVQ _tos(SB), AX
diff --git a/src/runtime/sys_solaris_amd64.s b/src/runtime/sys_solaris_amd64.s
index 54aeaeaf54..64a5224e98 100644
--- a/src/runtime/sys_solaris_amd64.s
+++ b/src/runtime/sys_solaris_amd64.s
@@ -134,8 +134,7 @@ TEXT runtime·tstart_sysvicall(SB),NOSPLIT,$0
SUBQ $(0x100000), AX // stack size
MOVQ AX, (g_stack+stack_lo)(DX)
ADDQ $const__StackGuard, AX
- MOVQ AX, g_stackguard0(DX)
- MOVQ AX, g_stackguard1(DX)
+ MOVQ AX, g_stackguard(DX)
// Someday the convention will be D is always cleared.
CLD
diff --git a/src/runtime/sys_windows_386.s b/src/runtime/sys_windows_386.s
index c8a830cdf8..eee65736e9 100644
--- a/src/runtime/sys_windows_386.s
+++ b/src/runtime/sys_windows_386.s
@@ -209,8 +209,7 @@ TEXT runtime·externalthreadhandler(SB),NOSPLIT,$0
LEAL -8192(SP), CX
MOVL CX, (g_stack+stack_lo)(SP)
ADDL $const__StackGuard, CX
- MOVL CX, g_stackguard0(SP)
- MOVL CX, g_stackguard1(SP)
+ MOVL CX, g_stackguard(SP)
MOVL DX, (g_stack+stack_hi)(SP)
PUSHL 16(BP) // arg for handler
@@ -315,8 +314,7 @@ TEXT runtime·tstart(SB),NOSPLIT,$0
SUBL $(64*1024), AX // stack size
MOVL AX, (g_stack+stack_lo)(DX)
ADDL $const__StackGuard, AX
- MOVL AX, g_stackguard0(DX)
- MOVL AX, g_stackguard1(DX)
+ MOVL AX, g_stackguard(DX)
// Set up tls.
LEAL m_tls(CX), SI
diff --git a/src/runtime/sys_windows_amd64.s b/src/runtime/sys_windows_amd64.s
index 68f7cd3924..aa8100ecb5 100644
--- a/src/runtime/sys_windows_amd64.s
+++ b/src/runtime/sys_windows_amd64.s
@@ -246,8 +246,7 @@ TEXT runtime·externalthreadhandler(SB),NOSPLIT,$0
LEAQ -8192(SP), CX
MOVQ CX, (g_stack+stack_lo)(SP)
ADDQ $const__StackGuard, CX
- MOVQ CX, g_stackguard0(SP)
- MOVQ CX, g_stackguard1(SP)
+ MOVQ CX, g_stackguard(SP)
MOVQ DX, (g_stack+stack_hi)(SP)
PUSHQ 32(BP) // arg for handler
@@ -356,8 +355,7 @@ TEXT runtime·tstart_stdcall(SB),NOSPLIT,$0
SUBQ $(64*1024), AX // stack size
MOVQ AX, (g_stack+stack_lo)(DX)
ADDQ $const__StackGuard, AX
- MOVQ AX, g_stackguard0(DX)
- MOVQ AX, g_stackguard1(DX)
+ MOVQ AX, g_stackguard(DX)
// Set up tls.
LEAQ m_tls(CX), SI