< prev index next >
src/hotspot/share/memory/metaspaceClosure.hpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2017, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2017, 2018, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 27,37 ****
#include "logging/log.hpp"
#include "memory/allocation.hpp"
#include "oops/array.hpp"
#include "utilities/growableArray.hpp"
! #include "utilities/resourceHash.hpp"
// The metadata hierarchy is separate from the oop hierarchy
class MetaspaceObj; // no C++ vtable
//class Array; // no C++ vtable
class Annotations; // no C++ vtable
--- 27,37 ----
#include "logging/log.hpp"
#include "memory/allocation.hpp"
#include "oops/array.hpp"
#include "utilities/growableArray.hpp"
! #include "utilities/hashtable.inline.hpp"
// The metadata hierarchy is separate from the oop hierarchy
class MetaspaceObj; // no C++ vtable
//class Array; // no C++ vtable
class Annotations; // no C++ vtable
*** 262,282 ****
virtual bool do_ref(Ref* ref, bool read_only);
public:
// Gets called the first time we discover an object.
virtual void do_unique_ref(Ref* ref, bool read_only) = 0;
private:
! static unsigned my_hash(const address& a) {
! return primitive_hash<address>(a);
! }
! static bool my_equals(const address& a0, const address& a1) {
! return primitive_equals<address>(a0, a1);
! }
! ResourceHashtable<
! address, bool,
! UniqueMetaspaceClosure::my_hash, // solaris compiler doesn't like: primitive_hash<address>
! UniqueMetaspaceClosure::my_equals, // solaris compiler doesn't like: primitive_equals<address>
! 15889, // prime number
! ResourceObj::C_HEAP> _has_been_visited;
};
#endif // SHARE_VM_MEMORY_METASPACE_ITERATOR_HPP
--- 262,273 ----
virtual bool do_ref(Ref* ref, bool read_only);
public:
// Gets called the first time we discover an object.
virtual void do_unique_ref(Ref* ref, bool read_only) = 0;
+ UniqueMetaspaceClosure() : _has_been_visited(15889) {}
+
private:
! KVHashtable<address, bool, mtInternal> _has_been_visited;
};
#endif // SHARE_VM_MEMORY_METASPACE_ITERATOR_HPP
< prev index next >