8247818: GCC 10 warning stringop-overflow with symbol code

8249875: GCC 10 warnings -Wtype-limits with JFR code

Reviewed-by: bae
Backport-of: ed31b661d35a72948af6cf117cccea2e7537b920
This commit is contained in:
Yuri Nesterenko 2022-09-06 11:57:12 +00:00
parent 753beccf54
commit bcc79e2003
4 changed files with 4 additions and 12 deletions

View File

@ -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<T>::remove(T* const node) {
prev->set_next(next);
}
--_count;
assert(_count >= 0, "invariant");
assert(!in_list(node), "still in list error");
return node;
}

View File

@ -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<mtTracing> {
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; }

View File

@ -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() {

View File

@ -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();