runtime: move gostringw and gogobytes test stubs to Go.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/141150043
This commit is contained in:
Keith Randall 2014-09-05 15:01:09 -07:00
parent 005806cab1
commit 0e19a3d6d0
2 changed files with 14 additions and 16 deletions

View file

@ -142,10 +142,19 @@ var MemclrBytes = memclrBytes
var HashLoad = &hashLoad var HashLoad = &hashLoad
func gogoBytes() int32 // For testing.
func GogoBytes() int32 {
return _RuntimeGogoBytes
}
var GogoBytes = gogoBytes // in string.c
//go:noescape
func gostringw(w *uint16) string
func gostringW([]uint16) string // entry point for testing
func GostringW(w []uint16) (s string) {
var GostringW = gostringW onM(func() {
s = gostringw(&w[0])
})
return
}

View file

@ -23,12 +23,6 @@ package runtime
// These invariants do not hold yet but will be established once we have // These invariants do not hold yet but will be established once we have
// finished converting runtime support code from C to Go. // finished converting runtime support code from C to Go.
// entry point for testing
// TODO: mcall and run on M stack
func gostringW(str Slice) (s String) {
s = runtime·gostringw((uint16*)str.array);
}
#pragma textflag NOSPLIT #pragma textflag NOSPLIT
func runtime·getg() (ret *G) { func runtime·getg() (ret *G) {
ret = g; ret = g;
@ -61,8 +55,3 @@ func reflect·typelinks() (ret Slice) {
ret.len = runtime·etypelink - runtime·typelink; ret.len = runtime·etypelink - runtime·typelink;
ret.cap = ret.len; ret.cap = ret.len;
} }
// For testing.
func gogoBytes() (x int32) {
x = RuntimeGogoBytes;
}