8261868: Reduce inclusion of metaspace.hpp

Reviewed-by: stuefe, ccheung
This commit is contained in:
Ioi Lam 2021-02-25 04:31:12 +00:00
parent 3a0d6a64bc
commit 0f8be6e433
52 changed files with 253 additions and 161 deletions

View file

@ -25,11 +25,11 @@
#ifndef SHARE_OOPS_ARRAY_HPP
#define SHARE_OOPS_ARRAY_HPP
#include "memory/allocation.hpp"
#include "memory/metaspace.hpp"
#include "runtime/atomic.hpp"
#include "utilities/align.hpp"
#include "utilities/exceptions.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/ostream.hpp"
// Array for metadata allocation
@ -52,11 +52,7 @@ protected:
private:
NONCOPYABLE(Array);
void* operator new(size_t size, ClassLoaderData* loader_data, int length, TRAPS) throw() {
size_t word_size = Array::size(length);
return (void*) Metaspace::allocate(loader_data, word_size,
MetaspaceObj::array_type(sizeof(T)), THREAD);
}
inline void* operator new(size_t size, ClassLoaderData* loader_data, int length, TRAPS) throw();
static size_t byte_sizeof(int length, size_t elm_byte_size) {
return sizeof(Array<T>) + MAX2(length - 1, 0) * elm_byte_size;