1 /* 2 * Copyright (c) 2021, Amazon.com, Inc. or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHYOUNGGENERATION_HPP 26 #define SHARE_VM_GC_SHENANDOAH_SHENANDOAHYOUNGGENERATION_HPP 27 28 #include "gc/shenandoah/shenandoahGeneration.hpp" 29 30 class ShenandoahYoungGeneration : public ShenandoahGeneration { 31 private: 32 ShenandoahObjToScanQueueSet* _old_gen_task_queues; 33 34 public: 35 ShenandoahYoungGeneration(uint max_queues, size_t max_capacity, size_t max_soft_capacity); 36 37 const char* name() const override; 38 39 void set_concurrent_mark_in_progress(bool in_progress) override; 40 void parallel_heap_region_iterate(ShenandoahHeapRegionClosure* cl) override; 41 42 void heap_region_iterate(ShenandoahHeapRegionClosure* cl) override; 43 44 bool contains(ShenandoahHeapRegion* region) const override; 45 bool contains(oop obj) const override; 46 47 void set_old_gen_task_queues(ShenandoahObjToScanQueueSet* old_gen_queues) { 48 _old_gen_task_queues = old_gen_queues; 49 } 50 51 ShenandoahObjToScanQueueSet* old_gen_task_queues() const override { 52 return _old_gen_task_queues; 53 } 54 55 void reserve_task_queues(uint workers) override; 56 57 virtual ShenandoahHeuristics* initialize_heuristics(ShenandoahMode* gc_mode) override; 58 59 protected: 60 bool is_concurrent_mark_in_progress() override; 61 62 }; 63 64 #endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAHYOUNGGENERATION_HPP