aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2013-09-16 20:26:10 -0400
committerRuss Cox <rsc@golang.org>2013-09-16 20:26:10 -0400
commit30ecb4cd05ac41805593c95bd7967b808e5f4ca5 (patch)
tree6b9023fb344bec0e59603d82934529b51f89cb5c /src/pkg/runtime
parent2a5dcfafec11744d55692838912901c58ba43bd2 (diff)
downloadgo-30ecb4cd05ac41805593c95bd7967b808e5f4ca5.tar.xz
build: disable precise collection of stack frames
The code for call site-specific pointer bitmaps was not ready in time, but the zeroing required without it is too expensive to use by default. We will have to wait for precise collection of stack frames until Go 1.3. The precise collection can be re-enabled by GOEXPERIMENT=precisestack ./all.bash but that will not be the default for a Go 1.2 build. Fixes #6087. R=golang-dev, jeremyjackins, dan.kortschak, r CC=golang-dev https://golang.org/cl/13677045
Diffstat (limited to 'src/pkg/runtime')
-rw-r--r--src/pkg/runtime/mgc0.c2
-rw-r--r--src/pkg/runtime/proc.c24
-rw-r--r--src/pkg/runtime/runtime.h2
3 files changed, 27 insertions, 1 deletions
diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c
index 9b6a9d5e96..fe9c18177c 100644
--- a/src/pkg/runtime/mgc0.c
+++ b/src/pkg/runtime/mgc0.c
@@ -1345,7 +1345,7 @@ scaninterfacedata(uintptr bits, byte *scanp, bool afterprologue)
Itab *tab;
Type *type;
- if(afterprologue) {
+ if(runtime·precisestack && afterprologue) {
if(bits == BitsIface) {
tab = *(Itab**)scanp;
if(tab->type->size <= sizeof(void*) && (tab->type->kind & KindNoPointers))
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index 07515c54f9..e34e9e5067 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -4,6 +4,7 @@
#include "runtime.h"
#include "arch_GOARCH.h"
+#include "zaexperiment.h"
#include "malloc.h"
#include "stack.h"
#include "race.h"
@@ -112,6 +113,7 @@ static void injectglist(G*);
static bool preemptall(void);
static bool preemptone(P*);
static bool exitsyscallfast(void);
+static bool haveexperiment(int8*);
// The bootstrap sequence is:
//
@@ -128,6 +130,7 @@ runtime·schedinit(void)
byte *p;
runtime·sched.maxmcount = 10000;
+ runtime·precisestack = haveexperiment("precisestack");
m->nomemprof++;
runtime·mprofinit();
@@ -2929,3 +2932,24 @@ runtime∕debug·setMaxThreads(intgo in, intgo out)
runtime·unlock(&runtime·sched);
FLUSH(&out);
}
+
+static int8 experiment[] = GOEXPERIMENT; // defined in zaexperiment.h
+
+static bool
+haveexperiment(int8 *name)
+{
+ int32 i, j;
+
+ for(i=0; i<sizeof(experiment); i++) {
+ if((i == 0 || experiment[i-1] == ',') && experiment[i] == name[0]) {
+ for(j=0; name[j]; j++)
+ if(experiment[i+j] != name[j])
+ goto nomatch;
+ if(experiment[i+j] != '\0' && experiment[i+j] != ',')
+ goto nomatch;
+ return 1;
+ }
+ nomatch:;
+ }
+ return 0;
+}
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h
index 9974fa3269..920e86c312 100644
--- a/src/pkg/runtime/runtime.h
+++ b/src/pkg/runtime/runtime.h
@@ -539,6 +539,8 @@ struct DebugVars
int32 scheddetail;
};
+extern bool runtime·precisestack;
+
/*
* defined macros
* you need super-gopher-guru privilege