Path: blob/master/src/hotspot/share/gc/z/zDriver.hpp
66644 views
/*1* Copyright (c) 2015, 2021, 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*/2223#ifndef SHARE_GC_Z_ZDRIVER_HPP24#define SHARE_GC_Z_ZDRIVER_HPP2526#include "gc/shared/concurrentGCThread.hpp"27#include "gc/shared/gcCause.hpp"28#include "gc/z/zMessagePort.hpp"2930class VM_ZOperation;3132class ZDriverRequest {33private:34GCCause::Cause _cause;35uint _nworkers;3637public:38ZDriverRequest();39ZDriverRequest(GCCause::Cause cause);40ZDriverRequest(GCCause::Cause cause, uint nworkers);4142bool operator==(const ZDriverRequest& other) const;4344GCCause::Cause cause() const;45uint nworkers() const;46};4748class ZDriver : public ConcurrentGCThread {49private:50ZMessagePort<ZDriverRequest> _gc_cycle_port;51ZRendezvousPort _gc_locker_port;5253template <typename T> bool pause();5455void pause_mark_start();56void concurrent_mark();57bool pause_mark_end();58void concurrent_mark_continue();59void concurrent_mark_free();60void concurrent_process_non_strong_references();61void concurrent_reset_relocation_set();62void pause_verify();63void concurrent_select_relocation_set();64void pause_relocate_start();65void concurrent_relocate();6667void check_out_of_memory();6869void gc(const ZDriverRequest& request);7071protected:72virtual void run_service();73virtual void stop_service();7475public:76ZDriver();7778bool is_busy() const;7980void collect(const ZDriverRequest& request);81};8283#endif // SHARE_GC_Z_ZDRIVER_HPP848586