reflect: use direct calls to runtime string functions

The runtime.stringFromBytesTyped and runtime.stringToBytesTyped
functions aren't really necessary, because they have the same LLVM IR
signature. Therefore, remove them and link directly to the functions
that the compiler uses internally.
This commit is contained in:
Ayke van Laethem
2023-03-27 18:55:46 +02:00
committed by Ron Evans
parent 2c0f61cad1
commit 31043628d8
2 changed files with 2 additions and 18 deletions
+2 -2
View File
@@ -1209,7 +1209,7 @@ func cvtFloat(v Value, t *rawType) Value {
return makeFloat(v.flags, v.Float(), t)
}
//go:linkname stringToBytes runtime.stringToBytesTyped
//go:linkname stringToBytes runtime.stringToBytes
func stringToBytes(x string) []byte
func cvtStringBytes(v Value, t *rawType) Value {
@@ -1221,7 +1221,7 @@ func cvtStringBytes(v Value, t *rawType) Value {
}
}
//go:linkname stringFromBytes runtime.stringFromBytesTyped
//go:linkname stringFromBytes runtime.stringFromBytes
func stringFromBytes(x []byte) string
func cvtBytesString(v Value, t *rawType) Value {