Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/jfr/leakprofiler/chains/dfsClosure.hpp
48481 views
/*1* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_VM_JFR_LEAKPROFILER_CHAINS_DFSCLOSURE_HPP25#define SHARE_VM_JFR_LEAKPROFILER_CHAINS_DFSCLOSURE_HPP2627#include "memory/iterator.hpp"2829class BitSet;30class Edge;31class EdgeStore;32class EdgeQueue;3334// Class responsible for iterating the heap depth-first35class DFSClosure : public ExtendedOopClosure { // XXX BasicOopIterateClosure36private:37static EdgeStore* _edge_store;38static BitSet* _mark_bits;39static const Edge*_start_edge;40static size_t _max_depth;41static bool _ignore_root_set;42DFSClosure* _parent;43const oop* _reference;44size_t _depth;4546void add_chain();47void closure_impl(const oop* reference, const oop pointee);4849DFSClosure* parent() const { return _parent; }50const oop* reference() const { return _reference; }5152DFSClosure(DFSClosure* parent, size_t depth);53DFSClosure();5455public:56static void find_leaks_from_edge(EdgeStore* edge_store, BitSet* mark_bits, const Edge* start_edge);57static void find_leaks_from_root_set(EdgeStore* edge_store, BitSet* mark_bits);58void do_root(const oop* ref);5960virtual void do_oop(oop* ref);61virtual void do_oop(narrowOop* ref);62};6364#endif // SHARE_VM_JFR_LEAKPROFILER_CHAINS_DFSCLOSURE_HPP656667