diff --git a/src/hotspot/share/jfr/utilities/jfrDoublyLinkedList.hpp b/src/hotspot/share/jfr/utilities/jfrDoublyLinkedList.hpp index eb92de630ef..a0048b1d26e 100644 --- a/src/hotspot/share/jfr/utilities/jfrDoublyLinkedList.hpp +++ b/src/hotspot/share/jfr/utilities/jfrDoublyLinkedList.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -135,7 +135,6 @@ T* JfrDoublyLinkedList::remove(T* const node) { prev->set_next(next); } --_count; - assert(_count >= 0, "invariant"); assert(!in_list(node), "still in list error"); return node; } diff --git a/src/hotspot/share/jfr/utilities/jfrHashtable.hpp b/src/hotspot/share/jfr/utilities/jfrHashtable.hpp index 4953b69757a..0a18bdebbc6 100644 --- a/src/hotspot/share/jfr/utilities/jfrHashtable.hpp +++ b/src/hotspot/share/jfr/utilities/jfrHashtable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -83,7 +83,7 @@ class JfrBasicHashtable : public CHeapObj { size_t hash_to_index(uintptr_t full_hash) const { const uintptr_t h = full_hash % _table_size; - assert(h >= 0 && h < _table_size, "Illegal hash value"); + assert(h < _table_size, "Illegal hash value"); return (size_t)h; } size_t entry_size() const { return _entry_size; } diff --git a/src/hotspot/share/oops/symbol.cpp b/src/hotspot/share/oops/symbol.cpp index bcd9771c494..3e6d301da62 100644 --- a/src/hotspot/share/oops/symbol.cpp +++ b/src/hotspot/share/oops/symbol.cpp @@ -51,9 +51,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();