8280019: Remove unused code from metaspace

Reviewed-by: coleenp, hseigel
This commit is contained in:
Thomas Stuefe 2022-01-14 16:17:48 +00:00
parent cf283e2a33
commit d9dd485b95
7 changed files with 14 additions and 34 deletions

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022 SAP SE. 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
@ -101,7 +101,6 @@ void BlockTree::verify() const {
// Traverse the tree and test that all nodes are in the correct order.
MemRangeCounter counter;
int longest_edge = 0;
if (_root != NULL) {
ResourceMark rm;

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021 SAP SE. All rights reserved.
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2022 SAP SE. 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
@ -88,7 +88,6 @@ void ChunkManager::split_chunk_and_add_splinters(Metachunk* c, chunklevel_t targ
DEBUG_ONLY(size_t committed_words_before = c->committed_words();)
const chunklevel_t orig_level = c->level();
c->vsnode()->split(target_level, c, &_chunks);
// Splitting should never fail.

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020 SAP SE. All rights reserved.
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2022 SAP SE. 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
@ -95,12 +95,6 @@ class ChunkManager : public CHeapObj<mtMetaspace> {
// chunks.
void split_chunk_and_add_splinters(Metachunk* c, chunklevel_t target_level);
// See get_chunk(s,s,s)
Metachunk* get_chunk_locked(size_t preferred_word_size, size_t min_word_size, size_t min_committed_words);
// Uncommit all chunks equal or below the given level.
void uncommit_free_chunks(chunklevel_t max_level);
// Return a single chunk to the freelist without doing any merging, and adjust accounting.
void return_chunk_simple_locked(Metachunk* c);
@ -161,9 +155,6 @@ public:
DEBUG_ONLY(void verify() const;)
DEBUG_ONLY(void verify_locked() const;)
// Returns the name of this chunk manager.
const char* name() const { return _name; }
// Returns total number of chunks
int total_num_chunks() const { return _chunks.num_chunks(); }

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022 SAP SE. 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
@ -94,7 +94,6 @@ public:
const MetaWord* base() const { return _base; }
size_t word_size() const { return _word_size; }
const MetaWord* end() const { return _base + word_size(); }
// Given an address, returns true if the address is committed, false if not.
bool is_committed_address(const MetaWord* p) const {

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022 SAP SE. 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
@ -70,8 +70,6 @@ public:
_c -= v;
}
void reset() { _c = 0; }
#ifdef ASSERT
void check(T expected) const {
assert(_c == expected, "Counter mismatch: %d, expected: %d.",

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022 SAP SE. 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
@ -70,7 +70,6 @@ void FreeChunkList::verify() const {
} else {
assert(_last != NULL, "Sanity");
int num = 0;
bool uncommitted = (_first->committed_words() == 0);
for (Metachunk* c = _first; c != NULL; c = c->next()) {
assert(c->is_free(), "Chunks in freelist should be free");
assert(c->used_words() == 0, "Chunk in freelist should have not used words.");

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021 SAP SE. All rights reserved.
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022 SAP SE. 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
@ -103,8 +103,6 @@ void RootChunkArea::split(chunklevel_t target_level, Metachunk* c, FreeChunkList
DEBUG_ONLY(chunklevel::check_valid_level(target_level));
assert(target_level > c->level(), "Wrong target level");
const chunklevel_t starting_level = c->level();
while (c->level() < target_level) {
log_trace(metaspace)("Splitting chunk: " METACHUNK_FULL_FORMAT ".", METACHUNK_FULL_FORMAT_ARGS(c));
@ -199,8 +197,6 @@ Metachunk* RootChunkArea::merge(Metachunk* c, FreeChunkListVector* freelists) {
log_trace(metaspace)("Attempting to merge chunk " METACHUNK_FORMAT ".", METACHUNK_FORMAT_ARGS(c));
const chunklevel_t starting_level = c->level();
bool stop = false;
Metachunk* result = NULL;
@ -389,7 +385,6 @@ void RootChunkArea::verify() const {
const Metachunk* c = _first_chunk;
const MetaWord* expected_next_base = _base;
const MetaWord* const area_end = _base + word_size();
while (c != NULL) {
assrt_(c->is_free() || c->is_in_use(),