hotspot/src/share/vm/oops/symbol.hpp
changeset 46492 5848b57c9dc5
parent 40655 9f644073d3a0
child 46746 ea379ebb9447
--- a/hotspot/src/share/vm/oops/symbol.hpp	Tue May 23 20:14:52 2017 -0700
+++ b/hotspot/src/share/vm/oops/symbol.hpp	Wed May 24 12:42:44 2017 +0200
@@ -175,7 +175,16 @@
   int utf8_length() const { return _length; }
 
   // Compares the symbol with a string.
-  bool equals(const char* str, int len) const;
+  bool equals(const char* str, int len) const {
+    int l = utf8_length();
+    if (l != len) return false;
+    while (l-- > 0) {
+      if (str[l] != (char) byte_at(l))
+        return false;
+    }
+    assert(l == -1, "we should be at the beginning");
+    return true;
+  }
   bool equals(const char* str) const { return equals(str, (int) strlen(str)); }
 
   // Tests if the symbol starts with the given prefix.