1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/vm/memory/generationSpec.hpp Wed Apr 27 01:25:04 2016 +0800 1.3 @@ -0,0 +1,70 @@ 1.4 +/* 1.5 + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 + * or visit www.oracle.com if you need additional information or have any 1.24 + * questions. 1.25 + * 1.26 + */ 1.27 + 1.28 +#ifndef SHARE_VM_MEMORY_GENERATIONSPEC_HPP 1.29 +#define SHARE_VM_MEMORY_GENERATIONSPEC_HPP 1.30 + 1.31 +#include "memory/generation.hpp" 1.32 + 1.33 +// The specification of a generation. This class also encapsulates 1.34 +// some generation-specific behavior. This is done here rather than as a 1.35 +// virtual function of Generation because these methods are needed in 1.36 +// initialization of the Generations. 1.37 +class GenerationSpec : public CHeapObj<mtGC> { 1.38 + friend class VMStructs; 1.39 +private: 1.40 + Generation::Name _name; 1.41 + size_t _init_size; 1.42 + size_t _max_size; 1.43 + 1.44 +public: 1.45 + GenerationSpec(Generation::Name name, size_t init_size, size_t max_size) { 1.46 + _name = name; 1.47 + _init_size = init_size; 1.48 + _max_size = max_size; 1.49 + } 1.50 + 1.51 + Generation* init(ReservedSpace rs, int level, GenRemSet* remset); 1.52 + 1.53 + // Accessors 1.54 + Generation::Name name() const { return _name; } 1.55 + size_t init_size() const { return _init_size; } 1.56 + void set_init_size(size_t size) { _init_size = size; } 1.57 + size_t max_size() const { return _max_size; } 1.58 + void set_max_size(size_t size) { _max_size = size; } 1.59 + 1.60 + // Alignment 1.61 + void align(size_t alignment) { 1.62 + set_init_size(align_size_up(init_size(), alignment)); 1.63 + set_max_size(align_size_up(max_size(), alignment)); 1.64 + } 1.65 + 1.66 + // Return the number of regions contained in the generation which 1.67 + // might need to be independently covered by a remembered set. 1.68 + virtual int n_covered_regions() const { return 1; } 1.69 +}; 1.70 + 1.71 +typedef GenerationSpec* GenerationSpecPtr; 1.72 + 1.73 +#endif // SHARE_VM_MEMORY_GENERATIONSPEC_HPP