author | ehelin |
Wed, 25 Nov 2015 21:54:05 +0100 | |
changeset 34308 | 4496e81c890d |
permissions | -rw-r--r-- |
34308
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
1 |
/* |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
2 |
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
4 |
* |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
8 |
* |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
13 |
* accompanied this code). |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
14 |
* |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
18 |
* |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
21 |
* questions. |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
22 |
* |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
23 |
*/ |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
24 |
|
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
25 |
#include "gc/g1/bufferingOopClosure.hpp" |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
26 |
#include "gc/g1/g1CodeBlobClosure.hpp" |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
27 |
#include "gc/g1/g1CollectedHeap.hpp" |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
28 |
#include "gc/g1/g1OopClosures.inline.hpp" |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
29 |
#include "gc/g1/g1RootClosures.hpp" |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
30 |
|
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
31 |
// Simple holder object for a complete set of closures used by the G1 evacuation code. |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
32 |
template <G1Mark Mark> |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
33 |
class G1SharedClosures VALUE_OBJ_CLASS_SPEC { |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
34 |
public: |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
35 |
G1ParCopyClosure<G1BarrierNone, Mark> _oops; |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
36 |
G1ParCopyClosure<G1BarrierKlass, Mark> _oop_in_klass; |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
37 |
G1KlassScanClosure _klass_in_cld_closure; |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
38 |
CLDToKlassAndOopClosure _clds; |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
39 |
G1CodeBlobClosure _codeblobs; |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
40 |
BufferingOopClosure _buffered_oops; |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
41 |
|
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
42 |
G1SharedClosures(G1CollectedHeap* g1h, G1ParScanThreadState* pss, bool process_only_dirty_klasses, bool must_claim_cld) : |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
43 |
_oops(g1h, pss), |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
44 |
_oop_in_klass(g1h, pss), |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
45 |
_klass_in_cld_closure(&_oop_in_klass, process_only_dirty_klasses), |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
46 |
_clds(&_klass_in_cld_closure, &_oops, must_claim_cld), |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
47 |
_codeblobs(&_oops), |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
48 |
_buffered_oops(&_oops) {} |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
49 |
}; |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
50 |
|
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
51 |
class G1EvacuationClosures : public G1EvacuationRootClosures { |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
52 |
G1SharedClosures<G1MarkNone> _closures; |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
53 |
|
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
54 |
public: |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
55 |
G1EvacuationClosures(G1CollectedHeap* g1h, |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
56 |
G1ParScanThreadState* pss, |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
57 |
bool gcs_are_young) : |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
58 |
_closures(g1h, pss, gcs_are_young, /* must_claim_cld */ false) {} |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
59 |
|
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
60 |
OopClosure* weak_oops() { return &_closures._buffered_oops; } |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
61 |
OopClosure* strong_oops() { return &_closures._buffered_oops; } |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
62 |
|
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
63 |
CLDClosure* weak_clds() { return &_closures._clds; } |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
64 |
CLDClosure* strong_clds() { return &_closures._clds; } |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
65 |
CLDClosure* thread_root_clds() { return NULL; } |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
66 |
CLDClosure* second_pass_weak_clds() { return NULL; } |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
67 |
|
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
68 |
CodeBlobClosure* strong_codeblobs() { return &_closures._codeblobs; } |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
69 |
CodeBlobClosure* weak_codeblobs() { return &_closures._codeblobs; } |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
70 |
|
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
71 |
void flush() { _closures._buffered_oops.done(); } |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
72 |
double closure_app_seconds() { return _closures._buffered_oops.closure_app_seconds(); } |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
73 |
|
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
74 |
OopClosure* raw_strong_oops() { return &_closures._oops; } |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
75 |
|
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
76 |
bool trace_metadata() { return false; } |
4496e81c890d
8142494: Add extension point to G1EvacuationRootClosures
ehelin
parents:
diff
changeset
|
77 |
}; |