]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: preserve DX during racefuncenter
authorRuss Cox <rsc@golang.org>
Fri, 22 Feb 2013 18:06:43 +0000 (13:06 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 22 Feb 2013 18:06:43 +0000 (13:06 -0500)
R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/7382049

src/pkg/runtime/race.c
src/pkg/runtime/race_amd64.s [new file with mode: 0644]

index 8f611cb2d86984fb7658e6ae31f4a0613d0e02a4..17573a6978b887b324038b5bfd00be603cb47a9a 100644 (file)
@@ -87,10 +87,10 @@ runtime·raceread(uintptr addr)
        }
 }
 
-// Called from instrumented code.
+// Called from runtime·racefuncenter (assembly).
 #pragma textflag 7
 void
-runtime·racefuncenter(uintptr pc)
+runtime·racefuncenter1(uintptr pc)
 {
        // If the caller PC is lessstack, use slower runtime·callers
        // to walk across the stack split to find the real caller.
diff --git a/src/pkg/runtime/race_amd64.s b/src/pkg/runtime/race_amd64.s
new file mode 100644 (file)
index 0000000..0c6aaaa
--- /dev/null
@@ -0,0 +1,11 @@
+// Copyright 2013 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build race
+
+TEXT   runtime·racefuncenter(SB),7,$0
+       PUSHQ   DX // save function entry context (for closures)
+       CALL    runtime·racefuncenter1(SB)
+       POPQ    DX
+       RET