1 /*
2 * Copyright (c) 2001, 2008, Oracle and/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 class EdenSpace;
26 class ContiguousSpace;
27 class ScanClosure;
28
29 // DefNewGeneration is a young generation containing eden, from- and
30 // to-space.
31
32 class DefNewGeneration: public Generation {
33 friend class VMStructs;
34
35 protected:
36 Generation* _next_gen;
37 int _tenuring_threshold; // Tenuring threshold for next collection.
38 ageTable _age_table;
39 // Size of object to pretenure in words; command line provides bytes
40 size_t _pretenure_size_threshold_words;
41
42 ageTable* age_table() { return &_age_table; }
43 // Initialize state to optimistically assume no promotion failure will
44 // happen.
327
328 // PrintHeapAtGC support.
329 void print_on(outputStream* st) const;
330
331 void verify(bool allow_dirty);
332
333 bool promo_failure_scan_is_complete() const {
334 return _promo_failure_scan_stack.is_empty();
335 }
336
337 protected:
338 // If clear_space is true, clear the survivor spaces. Eden is
339 // cleared if the minimum size of eden is 0. If mangle_space
340 // is true, also mangle the space in debug mode.
341 void compute_space_boundaries(uintx minimum_eden_size,
342 bool clear_space,
343 bool mangle_space);
344 // Scavenge support
345 void swap_spaces();
346 };
|
1 /*
2 * Copyright (c) 2001, 2010, Oracle and/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_MEMORY_DEFNEWGENERATION_HPP
26 #define SHARE_VM_MEMORY_DEFNEWGENERATION_HPP
27
28 #include "gc_implementation/shared/ageTable.hpp"
29 #include "gc_implementation/shared/cSpaceCounters.hpp"
30 #include "gc_implementation/shared/generationCounters.hpp"
31 #include "memory/generation.inline.hpp"
32 #include "utilities/stack.hpp"
33
34 class EdenSpace;
35 class ContiguousSpace;
36 class ScanClosure;
37
38 // DefNewGeneration is a young generation containing eden, from- and
39 // to-space.
40
41 class DefNewGeneration: public Generation {
42 friend class VMStructs;
43
44 protected:
45 Generation* _next_gen;
46 int _tenuring_threshold; // Tenuring threshold for next collection.
47 ageTable _age_table;
48 // Size of object to pretenure in words; command line provides bytes
49 size_t _pretenure_size_threshold_words;
50
51 ageTable* age_table() { return &_age_table; }
52 // Initialize state to optimistically assume no promotion failure will
53 // happen.
336
337 // PrintHeapAtGC support.
338 void print_on(outputStream* st) const;
339
340 void verify(bool allow_dirty);
341
342 bool promo_failure_scan_is_complete() const {
343 return _promo_failure_scan_stack.is_empty();
344 }
345
346 protected:
347 // If clear_space is true, clear the survivor spaces. Eden is
348 // cleared if the minimum size of eden is 0. If mangle_space
349 // is true, also mangle the space in debug mode.
350 void compute_space_boundaries(uintx minimum_eden_size,
351 bool clear_space,
352 bool mangle_space);
353 // Scavenge support
354 void swap_spaces();
355 };
356
357 #endif // SHARE_VM_MEMORY_DEFNEWGENERATION_HPP
|