aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorGerrit Code Review <noreply-gerritcodereview@google.com>2016-03-01 21:36:45 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-03-01 21:36:45 +0000
commita6fb2aede7c8d47b4d913eb83fa45bbeca76c433 (patch)
tree1dd5039e5515959a8d162fbdac964663dd2ec778 /src/runtime
parent998aaf8a64b7d90269815a2ae9d778da519d0a87 (diff)
parent9d854fd44ae669f60c15133a4d2ce407ea2bccc4 (diff)
downloadgo-a6fb2aede7c8d47b4d913eb83fa45bbeca76c433.tar.xz
Merge "Merge branch 'dev.ssa' into mergebranch"
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/mgc.go7
-rw-r--r--src/runtime/race_amd64.s16
-rw-r--r--src/runtime/runtime-gdb_test.go7
3 files changed, 19 insertions, 11 deletions
diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go
index df8b4536fa..138a623ca5 100644
--- a/src/runtime/mgc.go
+++ b/src/runtime/mgc.go
@@ -216,9 +216,10 @@ var gcphase uint32
// The compiler knows about this variable.
// If you change it, you must change the compiler too.
var writeBarrier struct {
- enabled bool // compiler emits a check of this before calling write barrier
- needed bool // whether we need a write barrier for current GC phase
- cgo bool // whether we need a write barrier for a cgo check
+ enabled bool // compiler emits a check of this before calling write barrier
+ needed bool // whether we need a write barrier for current GC phase
+ cgo bool // whether we need a write barrier for a cgo check
+ alignme uint64 // guarantee alignment so that compiler can use a 32 or 64-bit load
}
// gcBlackenEnabled is 1 if mutator assists and background mark
diff --git a/src/runtime/race_amd64.s b/src/runtime/race_amd64.s
index d9e674b61f..80c4d79a7d 100644
--- a/src/runtime/race_amd64.s
+++ b/src/runtime/race_amd64.s
@@ -159,14 +159,28 @@ call:
ret:
RET
+// func runtime·racefuncenterfp(fp uintptr)
+// Called from instrumented code.
+// Like racefuncenter but passes FP, not PC
+TEXT runtime·racefuncenterfp(SB), NOSPLIT, $0-8
+ MOVQ fp+0(FP), R11
+ MOVQ -8(R11), R11
+ JMP racefuncenter<>(SB)
+
// func runtime·racefuncenter(pc uintptr)
// Called from instrumented code.
TEXT runtime·racefuncenter(SB), NOSPLIT, $0-8
+ MOVQ callpc+0(FP), R11
+ JMP racefuncenter<>(SB)
+
+// Common code for racefuncenter/racefuncenterfp
+// R11 = caller's return address
+TEXT racefuncenter<>(SB), NOSPLIT, $0-0
MOVQ DX, R15 // save function entry context (for closures)
get_tls(R12)
MOVQ g(R12), R14
MOVQ g_racectx(R14), RARG0 // goroutine context
- MOVQ callpc+0(FP), RARG1
+ MOVQ R11, RARG1
// void __tsan_func_enter(ThreadState *thr, void *pc);
MOVQ $__tsan_func_enter(SB), AX
// racecall<> preserves R15
diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go
index 6ebc69a424..110d99064f 100644
--- a/src/runtime/runtime-gdb_test.go
+++ b/src/runtime/runtime-gdb_test.go
@@ -98,9 +98,6 @@ func TestGdbPython(t *testing.T) {
"-ex", "echo END\n",
"-ex", "echo BEGIN print strvar\n",
"-ex", "print strvar",
- "-ex", "echo END\n",
- "-ex", "echo BEGIN print ptrvar\n",
- "-ex", "print ptrvar",
"-ex", "echo END\n"}
// without framepointer, gdb cannot backtrace our non-standard
@@ -158,10 +155,6 @@ func TestGdbPython(t *testing.T) {
t.Fatalf("print strvar failed: %s", bl)
}
- if bl := blocks["print ptrvar"]; !strVarRe.MatchString(bl) {
- t.Fatalf("print ptrvar failed: %s", bl)
- }
-
btGoroutineRe := regexp.MustCompile(`^#0\s+runtime.+at`)
if bl := blocks["goroutine 2 bt"]; canBackTrace && !btGoroutineRe.MatchString(bl) {
t.Fatalf("goroutine 2 bt failed: %s", bl)