Commit 15a5c35c authored by Russ Cox's avatar Russ Cox

runtime: move gosched to Go, to add stack frame information

LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/134520044
parent 724fa12f
...@@ -477,7 +477,7 @@ func gogc(force int32) { ...@@ -477,7 +477,7 @@ func gogc(force int32) {
// now that gc is done, kick off finalizer thread if needed // now that gc is done, kick off finalizer thread if needed
if !concurrentSweep { if !concurrentSweep {
// give the queued finalizers, if any, a chance to run // give the queued finalizers, if any, a chance to run
gosched() Gosched()
} }
} }
......
...@@ -89,7 +89,7 @@ func bgsweep() { ...@@ -89,7 +89,7 @@ func bgsweep() {
for { for {
for gosweepone() != ^uintptr(0) { for gosweepone() != ^uintptr(0) {
sweep.nbgsweep++ sweep.nbgsweep++
gosched() Gosched()
} }
lock(&gclock) lock(&gclock)
if !gosweepdone() { if !gosweepdone() {
......
...@@ -1677,18 +1677,7 @@ runtime·park_m(G *gp) ...@@ -1677,18 +1677,7 @@ runtime·park_m(G *gp)
schedule(); schedule();
} }
// Scheduler yield. // Gosched continuation on g0.
#pragma textflag NOSPLIT
void
runtime·gosched(void)
{
void (*fn)(G*);
fn = runtime·gosched_m;
runtime·mcall(&fn);
}
// runtime·gosched continuation on g0.
void void
runtime·gosched_m(G *gp) runtime·gosched_m(G *gp)
{ {
......
...@@ -852,7 +852,6 @@ void runtime·setg(G*); ...@@ -852,7 +852,6 @@ void runtime·setg(G*);
void runtime·newextram(void); void runtime·newextram(void);
void runtime·exit(int32); void runtime·exit(int32);
void runtime·breakpoint(void); void runtime·breakpoint(void);
void runtime·gosched(void);
void runtime·gosched_m(G*); void runtime·gosched_m(G*);
void runtime·schedtrace(bool); void runtime·schedtrace(bool);
void runtime·park(bool(*)(G*, void*), void*, String); void runtime·park(bool(*)(G*, void*), void*, String);
......
...@@ -130,7 +130,6 @@ func memclr(ptr unsafe.Pointer, n uintptr) ...@@ -130,7 +130,6 @@ func memclr(ptr unsafe.Pointer, n uintptr)
//go:noescape //go:noescape
func memmove(to unsafe.Pointer, from unsafe.Pointer, n uintptr) func memmove(to unsafe.Pointer, from unsafe.Pointer, n uintptr)
func gosched()
func starttheworld() func starttheworld()
func stoptheworld() func stoptheworld()
func newextram() func newextram()
......
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