Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/jfr/leakprofiler/chains/bfsClosure.hpp
48524 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_BFSCLOSURE_HPP25#define SHARE_VM_JFR_LEAKPROFILER_CHAINS_BFSCLOSURE_HPP2627#include "memory/iterator.hpp"2829class BitSet;30class Edge;31class EdgeStore;32class EdgeQueue;3334// Class responsible for iterating the heap breadth-first35class BFSClosure : public ExtendedOopClosure { // XXX BasicOopIterateClosure36private:37EdgeQueue* _edge_queue;38EdgeStore* _edge_store;39BitSet* _mark_bits;40const Edge* _current_parent;41mutable size_t _current_frontier_level;42mutable size_t _next_frontier_idx;43mutable size_t _prev_frontier_idx;44size_t _dfs_fallback_idx;45bool _use_dfs;4647void log_completed_frontier() const;48void log_dfs_fallback() const;4950bool is_complete() const;51void step_frontier() const;5253void closure_impl(const oop* reference, const oop pointee);54void add_chain(const oop* reference, const oop pointee);55void dfs_fallback();5657void iterate(const Edge* parent);58void process(const oop* reference, const oop pointee);5960void process_root_set();61void process_queue();6263public:64BFSClosure(EdgeQueue* edge_queue, EdgeStore* edge_store, BitSet* mark_bits);65void process();66void do_root(const oop* ref);6768virtual void do_oop(oop* ref);69virtual void do_oop(narrowOop* ref);70};7172#endif // SHARE_VM_JFR_LEAKPROFILER_CHAINS_BFSCLOSURE_HPP737475