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
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
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
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)
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
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
// 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) {