Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp
38921 views
/*1* Copyright (c) 2003, 2013, 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_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGGENERATIONS_HPP25#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGGENERATIONS_HPP2627#include "gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp"28#include "gc_implementation/parallelScavenge/asPSOldGen.hpp"29#include "gc_implementation/parallelScavenge/asPSYoungGen.hpp"30#include "gc_implementation/parallelScavenge/generationSizer.hpp"313233// Contains two generations that both use an AdjoiningVirtualSpaces.34// The two generations are adjacent in the reserved space for the35// heap. Each generation has a virtual space and shrinking and36// expanding of the generations can still be down with that37// virtual space as was previously done. If expanding of reserved38// size of a generation is required, the adjacent generation39// must be shrunk. Adjusting the boundary between the generations40// is called for in this class.4142class AdjoiningGenerations : public CHeapObj<mtGC> {43friend class VMStructs;44private:45// The young generation and old generation, respectively46PSYoungGen* _young_gen;47PSOldGen* _old_gen;4849// The spaces used by the two generations.50AdjoiningVirtualSpaces _virtual_spaces;5152// Move boundary up to expand old gen. Checks are made to53// determine if the move can be done with specified limits.54void request_old_gen_expansion(size_t desired_change_in_bytes);55// Move boundary down to expand young gen.56bool request_young_gen_expansion(size_t desired_change_in_bytes);5758public:59AdjoiningGenerations(ReservedSpace rs, GenerationSizer* policy, size_t alignment);6061// Accessors62PSYoungGen* young_gen() { return _young_gen; }63PSOldGen* old_gen() { return _old_gen; }6465AdjoiningVirtualSpaces* virtual_spaces() { return &_virtual_spaces; }6667// Additional space is needed in the old generation. Check68// the available space and attempt to move the boundary if more space69// is needed. The growth is not guaranteed to occur.70void adjust_boundary_for_old_gen_needs(size_t desired_change_in_bytes);71// Similary for a growth of the young generation.72void adjust_boundary_for_young_gen_needs(size_t eden_size, size_t survivor_size);7374// Return the total byte size of the reserved space75// for the adjoining generations.76size_t reserved_byte_size();77};7879#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGGENERATIONS_HPP808182