]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix gogetcallerpc.
authorKeith Randall <khr@golang.org>
Wed, 18 Jun 2014 04:59:50 +0000 (21:59 -0700)
committerKeith Randall <khr@golang.org>
Wed, 18 Jun 2014 04:59:50 +0000 (21:59 -0700)
Make assembly govet-clean.
Clean up fixes for CL 93380044.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/107160047

src/pkg/runtime/asm_386.s
src/pkg/runtime/asm_amd64.s
src/pkg/runtime/asm_amd64p32.s
src/pkg/runtime/asm_arm.s
src/pkg/runtime/string.go
src/pkg/runtime/stubs.goc

index 2009a6019ad381a6a7ab4b8f44554a21a98aa6ae..8ba72eb1fc5a60d98783a571dfe43a94c8894f5c 100644 (file)
@@ -782,9 +782,9 @@ TEXT runtime·getcallerpc(SB),NOSPLIT,$0-4
        RET
 
 TEXT runtime·gogetcallerpc(SB),NOSPLIT,$0-8
-       MOVL    x+0(FP),AX              // addr of first arg
+       MOVL    p+0(FP),AX              // addr of first arg
        MOVL    -4(AX),AX               // get calling pc
-       MOVL    AX, r+4(FP)
+       MOVL    AX, ret+4(FP)
        RET
 
 TEXT runtime·setcallerpc(SB),NOSPLIT,$0-8
index d15b37210f3b123067347a79c656bb836c07019c..b712e3415a2d786433e024cc7e998fbf4667b9a3 100644 (file)
@@ -858,10 +858,10 @@ TEXT runtime·getcallerpc(SB),NOSPLIT,$0-8
        MOVQ    -8(AX),AX               // get calling pc
        RET
 
-TEXT runtime·gogetcallerpc(SB),NOSPLIT,$0-8
-       MOVQ    x+0(FP),AX              // addr of first arg
+TEXT runtime·gogetcallerpc(SB),NOSPLIT,$0-16
+       MOVQ    p+0(FP),AX              // addr of first arg
        MOVQ    -8(AX),AX               // get calling pc
-       MOVQ    AX,r+4(FP)
+       MOVQ    AX,ret+8(FP)
        RET
 
 TEXT runtime·setcallerpc(SB),NOSPLIT,$0-16
index 4e1fb0a5d5cae1d496e150c6e5fbc648599c0a2d..b70ab698af5bd41506debfd16d8598157783085d 100644 (file)
@@ -664,9 +664,9 @@ TEXT runtime·getcallerpc(SB),NOSPLIT,$0-8
        RET
 
 TEXT runtime·gogetcallerpc(SB),NOSPLIT,$0-8
-       MOVL    x+0(FP),AX              // addr of first arg
+       MOVL    p+0(FP),AX              // addr of first arg
        MOVL    -8(AX),AX               // get calling pc
-       MOVL    AX, r+4(FP)
+       MOVL    AX, ret+4(FP)
        RET
 
 TEXT runtime·setcallerpc(SB),NOSPLIT,$0-16
@@ -686,7 +686,7 @@ TEXT runtime·cputicks(SB),NOSPLIT,$0-0
        ADDQ    DX, AX
        RET
 
-TEXT runtime·stackguard(SB),NOSPLIT,$0-16
+TEXT runtime·stackguard(SB),NOSPLIT,$0-8
        MOVL    SP, DX
        MOVL    DX, sp+0(FP)
        get_tls(CX)
index 5af58954770608e56ce384b165832efe74235cd9..bc0dd3ca7c885ffd0531bc3fead2805a1d602ac2 100644 (file)
@@ -561,7 +561,7 @@ TEXT runtime·getcallerpc(SB),NOSPLIT,$-4-4
        RET
 
 TEXT runtime·gogetcallerpc(SB),NOSPLIT,$-4-8
-       MOVW    R14, 4(FP)
+       MOVW    R14, ret+4(FP)
        RET
 
 TEXT runtime·setcallerpc(SB),NOSPLIT,$-4-8
index 9805dd51282dd57eeeb85dcba0d3f65a1de235e5..69516af0667d2cc0620fb1274e6959d3b6a29810 100644 (file)
@@ -143,15 +143,19 @@ func slicerunetostring(a []rune) string {
        return s[:size2]
 }
 
+type stringStruct struct {
+       str *byte
+       len int
+}
+
 func cstringToGo(str uintptr) (s string) {
-       // Note: we need i to be the same type as _string.len and to start at 0.
-       i := _string{}.len
+       i := 0
        for ; ; i++ {
                if *(*byte)(unsafe.Pointer(str + uintptr(i))) == 0 {
                        break
                }
        }
-       t := (*_string)(unsafe.Pointer(&s))
+       t := (*stringStruct)(unsafe.Pointer(&s))
        t.str = (*byte)(unsafe.Pointer(str))
        t.len = i
        return
index 1cdc0fabea91e4762504cf711801725e1c297d81..901efa4d199a3ebb1668ba665c55d0c64ba54cae 100644 (file)
@@ -19,9 +19,8 @@ package runtime
 //    out to only NOSPLIT functions (recursively).
 // 2) Functions should not block.
 
-// During conversion, we can still call out to splittable
-// functions.  But once conversion is done the invariants
-// above should hold.
+// These invariants do not hold yet but will be established once we have
+// finished converting runtime support code from C to Go.
 
 #pragma textflag NOSPLIT
 func rawstring(size intgo) (s String, b Slice) {