Path: blob/master/src/hotspot/share/gc/serial/serialHeap.hpp
41149 views
/*1* Copyright (c) 2017, 2019, 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_GC_SERIAL_SERIALHEAP_HPP25#define SHARE_GC_SERIAL_SERIALHEAP_HPP2627#include "gc/serial/defNewGeneration.hpp"28#include "gc/serial/tenuredGeneration.hpp"29#include "gc/shared/genCollectedHeap.hpp"30#include "utilities/growableArray.hpp"3132class GCMemoryManager;33class MemoryPool;34class OopIterateClosure;35class TenuredGeneration;3637class SerialHeap : public GenCollectedHeap {38private:39MemoryPool* _eden_pool;40MemoryPool* _survivor_pool;41MemoryPool* _old_pool;4243virtual void initialize_serviceability();4445public:46static SerialHeap* heap();4748SerialHeap();4950virtual Name kind() const {51return CollectedHeap::Serial;52}5354virtual const char* name() const {55return "Serial";56}5758virtual GrowableArray<GCMemoryManager*> memory_managers();59virtual GrowableArray<MemoryPool*> memory_pools();6061DefNewGeneration* young_gen() const {62assert(_young_gen->kind() == Generation::DefNew, "Wrong generation type");63return static_cast<DefNewGeneration*>(_young_gen);64}6566TenuredGeneration* old_gen() const {67assert(_old_gen->kind() == Generation::MarkSweepCompact, "Wrong generation type");68return static_cast<TenuredGeneration*>(_old_gen);69}7071// Apply "cur->do_oop" or "older->do_oop" to all the oops in objects72// allocated since the last call to save_marks in the young generation.73// The "cur" closure is applied to references in the younger generation74// at "level", and the "older" closure to older generations.75template <typename OopClosureType1, typename OopClosureType2>76void oop_since_save_marks_iterate(OopClosureType1* cur,77OopClosureType2* older);7879void young_process_roots(OopIterateClosure* root_closure,80OopIterateClosure* old_gen_closure,81CLDClosure* cld_closure);82};8384#endif // SHARE_GC_SERIAL_SERIALHEAP_HPP858687