From 609c7da9ab08b009fb7a9cacf68a40b3b39231b3 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 24 Jun 2019 17:54:07 +0000 Subject: compiler: open code string equality Open code string equality with builtin memcmp. This allows further optimizations in the backend. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/183538 From-SVN: r272624 --- libgo/go/runtime/alg.go | 1 - libgo/go/runtime/stubs.go | 12 ------------ 2 files changed, 13 deletions(-) (limited to 'libgo') diff --git a/libgo/go/runtime/alg.go b/libgo/go/runtime/alg.go index ec951e3..a2bb5bb 100644 --- a/libgo/go/runtime/alg.go +++ b/libgo/go/runtime/alg.go @@ -44,7 +44,6 @@ import ( //go:linkname ifacevaleq runtime.ifacevaleq //go:linkname ifaceefaceeq runtime.ifaceefaceeq //go:linkname efacevaleq runtime.efacevaleq -//go:linkname eqstring runtime.eqstring //go:linkname cmpstring runtime.cmpstring // // Temporary to be called from C code. diff --git a/libgo/go/runtime/stubs.go b/libgo/go/runtime/stubs.go index 530997b..e00d759 100644 --- a/libgo/go/runtime/stubs.go +++ b/libgo/go/runtime/stubs.go @@ -273,18 +273,6 @@ func checkASM() bool { return true } -func eqstring(x, y string) bool { - a := stringStructOf(&x) - b := stringStructOf(&y) - if a.len != b.len { - return false - } - if a.str == b.str { - return true - } - return memequal(a.str, b.str, uintptr(a.len)) -} - // For gccgo this is in the C code. func osyield() -- cgit v1.1