Mercurial > hg > graal-compiler
annotate src/share/vm/memory/genRemSet.hpp @ 1751:2528b5bd749c
6980262: Memory leak when exception is thrown in static initializer
Summary: Use resource memory instead of c-heap for the exception message
Reviewed-by: phh, jmasa
author | kamg |
---|---|
date | Fri, 27 Aug 2010 15:05:28 -0400 |
parents | c18cbe5936b8 |
children | f95d63e2154a |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
356
diff
changeset
|
2 * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
356
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
356
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
356
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 // A GenRemSet provides ways of iterating over pointers accross generations. | |
26 // (This is especially useful for older-to-younger.) | |
27 | |
28 class Generation; | |
29 class BarrierSet; | |
30 class OopsInGenClosure; | |
31 class CardTableRS; | |
32 | |
33 class GenRemSet: public CHeapObj { | |
34 friend class Generation; | |
35 | |
36 BarrierSet* _bs; | |
37 | |
38 public: | |
39 enum Name { | |
40 CardTable, | |
41 Other | |
42 }; | |
43 | |
44 GenRemSet(BarrierSet * bs) : _bs(bs) {} | |
342
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
113
diff
changeset
|
45 GenRemSet() : _bs(NULL) {} |
0 | 46 |
47 virtual Name rs_kind() = 0; | |
48 | |
49 // These are for dynamic downcasts. Unfortunately that it names the | |
50 // possible subtypes (but not that they are subtypes!) Return NULL if | |
51 // the cast is invalide. | |
52 virtual CardTableRS* as_CardTableRS() { return NULL; } | |
53 | |
54 // Return the barrier set associated with "this." | |
55 BarrierSet* bs() { return _bs; } | |
56 | |
342
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
113
diff
changeset
|
57 // Set the barrier set. |
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
113
diff
changeset
|
58 void set_bs(BarrierSet* bs) { _bs = bs; } |
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
113
diff
changeset
|
59 |
0 | 60 // Do any (sequential) processing necessary to prepare for (possibly |
61 // "parallel", if that arg is true) calls to younger_refs_iterate. | |
62 virtual void prepare_for_younger_refs_iterate(bool parallel) = 0; | |
63 | |
64 // Apply the "do_oop" method of "blk" to (exactly) all oop locations | |
65 // 1) that are in objects allocated in "g" at the time of the last call | |
66 // to "save_Marks", and | |
67 // 2) that point to objects in younger generations. | |
68 virtual void younger_refs_iterate(Generation* g, OopsInGenClosure* blk) = 0; | |
69 | |
70 virtual void younger_refs_in_space_iterate(Space* sp, | |
71 OopsInGenClosure* cl) = 0; | |
72 | |
73 // This method is used to notify the remembered set that "new_val" has | |
74 // been written into "field" by the garbage collector. | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
6
diff
changeset
|
75 void write_ref_field_gc(void* field, oop new_val); |
0 | 76 protected: |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
6
diff
changeset
|
77 virtual void write_ref_field_gc_work(void* field, oop new_val) = 0; |
0 | 78 public: |
79 | |
80 // A version of the above suitable for use by parallel collectors. | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
6
diff
changeset
|
81 virtual void write_ref_field_gc_par(void* field, oop new_val) = 0; |
0 | 82 |
83 // Resize one of the regions covered by the remembered set. | |
84 virtual void resize_covered_region(MemRegion new_region) = 0; | |
85 | |
86 // If the rem set imposes any alignment restrictions on boundaries | |
87 // within the heap, this function tells whether they are met. | |
88 virtual bool is_aligned(HeapWord* addr) = 0; | |
89 | |
90 // If the RS (or BS) imposes an aligment constraint on maximum heap size. | |
91 // (This must be static, and dispatch on "nm", because it is called | |
92 // before an RS is created.) | |
93 static uintx max_alignment_constraint(Name nm); | |
94 | |
95 virtual void verify() = 0; | |
96 | |
97 // Verify that the remembered set has no entries for | |
6
73e96e5c30df
6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents:
0
diff
changeset
|
98 // the heap interval denoted by mr. If there are any |
73e96e5c30df
6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents:
0
diff
changeset
|
99 // alignment constraints on the remembered set, only the |
73e96e5c30df
6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents:
0
diff
changeset
|
100 // part of the region that is aligned is checked. |
73e96e5c30df
6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents:
0
diff
changeset
|
101 // |
73e96e5c30df
6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents:
0
diff
changeset
|
102 // alignment boundaries |
73e96e5c30df
6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents:
0
diff
changeset
|
103 // +--------+-------+--------+-------+ |
73e96e5c30df
6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents:
0
diff
changeset
|
104 // [ region mr ) |
73e96e5c30df
6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents:
0
diff
changeset
|
105 // [ part checked ) |
73e96e5c30df
6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents:
0
diff
changeset
|
106 virtual void verify_aligned_region_empty(MemRegion mr) = 0; |
0 | 107 |
108 // If appropriate, print some information about the remset on "tty". | |
109 virtual void print() {} | |
110 | |
111 // Informs the RS that the given memregion contains no references to | |
112 // younger generations. | |
113 virtual void clear(MemRegion mr) = 0; | |
114 | |
115 // Informs the RS that there are no references to generations | |
116 // younger than gen from generations gen and older. | |
117 // The parameter clear_perm indicates if the perm_gen's | |
118 // remembered set should also be processed/cleared. | |
119 virtual void clear_into_younger(Generation* gen, bool clear_perm) = 0; | |
120 | |
121 // Informs the RS that refs in the given "mr" may have changed | |
122 // arbitrarily, and therefore may contain old-to-young pointers. | |
342
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
113
diff
changeset
|
123 // If "whole heap" is true, then this invalidation is part of an |
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
113
diff
changeset
|
124 // invalidation of the whole heap, which an implementation might |
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
113
diff
changeset
|
125 // handle differently than that of a sub-part of the heap. |
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
113
diff
changeset
|
126 virtual void invalidate(MemRegion mr, bool whole_heap = false) = 0; |
0 | 127 |
128 // Informs the RS that refs in this generation | |
129 // may have changed arbitrarily, and therefore may contain | |
130 // old-to-young pointers in arbitrary locations. The parameter | |
131 // younger indicates if the same should be done for younger generations | |
132 // as well. The parameter perm indicates if the same should be done for | |
133 // perm gen as well. | |
134 virtual void invalidate_or_clear(Generation* gen, bool younger, bool perm) = 0; | |
135 }; |