comparison src/share/vm/memory/defNewGeneration.hpp @ 10405:f2110083203d

8005849: JEP 167: Event-Based JVM Tracing Reviewed-by: acorn, coleenp, sla Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
author sla
date Mon, 10 Jun 2013 11:30:51 +0200
parents 001ec9515f84
children 71180a6e5080
comparison
equal deleted inserted replaced
10404:d0add7016434 10405:f2110083203d
1 /* 1 /*
2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
26 #define SHARE_VM_MEMORY_DEFNEWGENERATION_HPP 26 #define SHARE_VM_MEMORY_DEFNEWGENERATION_HPP
27 27
28 #include "gc_implementation/shared/ageTable.hpp" 28 #include "gc_implementation/shared/ageTable.hpp"
29 #include "gc_implementation/shared/cSpaceCounters.hpp" 29 #include "gc_implementation/shared/cSpaceCounters.hpp"
30 #include "gc_implementation/shared/generationCounters.hpp" 30 #include "gc_implementation/shared/generationCounters.hpp"
31 #include "gc_implementation/shared/copyFailedInfo.hpp"
31 #include "memory/generation.inline.hpp" 32 #include "memory/generation.inline.hpp"
32 #include "utilities/stack.hpp" 33 #include "utilities/stack.hpp"
33 34
34 class EdenSpace; 35 class EdenSpace;
35 class ContiguousSpace; 36 class ContiguousSpace;
36 class ScanClosure; 37 class ScanClosure;
38 class STWGCTimer;
37 39
38 // DefNewGeneration is a young generation containing eden, from- and 40 // DefNewGeneration is a young generation containing eden, from- and
39 // to-space. 41 // to-space.
40 42
41 class DefNewGeneration: public Generation { 43 class DefNewGeneration: public Generation {
44 protected: 46 protected:
45 Generation* _next_gen; 47 Generation* _next_gen;
46 uint _tenuring_threshold; // Tenuring threshold for next collection. 48 uint _tenuring_threshold; // Tenuring threshold for next collection.
47 ageTable _age_table; 49 ageTable _age_table;
48 // Size of object to pretenure in words; command line provides bytes 50 // Size of object to pretenure in words; command line provides bytes
49 size_t _pretenure_size_threshold_words; 51 size_t _pretenure_size_threshold_words;
50 52
51 ageTable* age_table() { return &_age_table; } 53 ageTable* age_table() { return &_age_table; }
54
52 // Initialize state to optimistically assume no promotion failure will 55 // Initialize state to optimistically assume no promotion failure will
53 // happen. 56 // happen.
54 void init_assuming_no_promotion_failure(); 57 void init_assuming_no_promotion_failure();
55 // True iff a promotion has failed in the current collection. 58 // True iff a promotion has failed in the current collection.
56 bool _promotion_failed; 59 bool _promotion_failed;
57 bool promotion_failed() { return _promotion_failed; } 60 bool promotion_failed() { return _promotion_failed; }
61 PromotionFailedInfo _promotion_failed_info;
58 62
59 // Handling promotion failure. A young generation collection 63 // Handling promotion failure. A young generation collection
60 // can fail if a live object cannot be copied out of its 64 // can fail if a live object cannot be copied out of its
61 // location in eden or from-space during the collection. If 65 // location in eden or from-space during the collection. If
62 // a collection fails, the young generation is left in a 66 // a collection fails, the young generation is left in a
130 // Spaces 134 // Spaces
131 EdenSpace* _eden_space; 135 EdenSpace* _eden_space;
132 ContiguousSpace* _from_space; 136 ContiguousSpace* _from_space;
133 ContiguousSpace* _to_space; 137 ContiguousSpace* _to_space;
134 138
139 STWGCTimer* _gc_timer;
140
135 enum SomeProtectedConstants { 141 enum SomeProtectedConstants {
136 // Generations are GenGrain-aligned and have size that are multiples of 142 // Generations are GenGrain-aligned and have size that are multiples of
137 // GenGrain. 143 // GenGrain.
138 MinFreeScratchWords = 100 144 MinFreeScratchWords = 100
139 }; 145 };
200 }; 206 };
201 207
202 public: 208 public:
203 DefNewGeneration(ReservedSpace rs, size_t initial_byte_size, int level, 209 DefNewGeneration(ReservedSpace rs, size_t initial_byte_size, int level,
204 const char* policy="Copy"); 210 const char* policy="Copy");
211
212 virtual void ref_processor_init();
205 213
206 virtual Generation::Name kind() { return Generation::DefNew; } 214 virtual Generation::Name kind() { return Generation::DefNew; }
207 215
208 // Accessing spaces 216 // Accessing spaces
209 EdenSpace* eden() const { return _eden_space; } 217 EdenSpace* eden() const { return _eden_space; }