diff --git a/src/hotspot/share/oops/symbol.cpp b/src/hotspot/share/oops/symbol.cpp index 5b278317a7d..88f125b8a8f 100644 --- a/src/hotspot/share/oops/symbol.cpp +++ b/src/hotspot/share/oops/symbol.cpp @@ -52,9 +52,7 @@ Symbol::Symbol(const u1* name, int length, int refcount) { _hash_and_refcount = pack_hash_and_refcount((short)os::random(), refcount); _length = length; _body[0] = 0; // in case length == 0 - for (int i = 0; i < length; i++) { - byte_at_put(i, name[i]); - } + memcpy(_body, name, length); } void* Symbol::operator new(size_t sz, int len) throw() { diff --git a/src/hotspot/share/oops/symbol.hpp b/src/hotspot/share/oops/symbol.hpp index 18bc0ae387f..51add5ad42a 100644 --- a/src/hotspot/share/oops/symbol.hpp +++ b/src/hotspot/share/oops/symbol.hpp @@ -125,11 +125,6 @@ class Symbol : public MetaspaceObj { return (int)heap_word_size(byte_size(length)); } - void byte_at_put(int index, u1 value) { - assert(index >=0 && index < length(), "symbol index overflow"); - _body[index] = value; - } - Symbol(const u1* name, int length, int refcount); void* operator new(size_t size, int len) throw(); void* operator new(size_t size, int len, Arena* arena) throw();