author | rkennke |
Tue, 06 Nov 2018 17:28:14 +0100 | |
changeset 52426 | 38bf0c9c4e64 |
parent 52220 | 9c260a6b6471 |
child 52568 | 40474b7105f4 |
permissions | -rw-r--r-- |
50180 | 1 |
/* |
2 |
* Copyright (c) 2018, 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_GC_SHARED_C2_G1BARRIERSETC2_HPP |
|
26 |
#define SHARE_GC_SHARED_C2_G1BARRIERSETC2_HPP |
|
27 |
||
28 |
#include "gc/shared/c2/cardTableBarrierSetC2.hpp" |
|
29 |
||
30 |
class PhaseTransform; |
|
31 |
class Type; |
|
32 |
class TypeFunc; |
|
33 |
||
34 |
class G1BarrierSetC2: public CardTableBarrierSetC2 { |
|
35 |
protected: |
|
36 |
virtual void pre_barrier(GraphKit* kit, |
|
37 |
bool do_load, |
|
38 |
Node* ctl, |
|
39 |
Node* obj, |
|
40 |
Node* adr, |
|
41 |
uint adr_idx, |
|
42 |
Node* val, |
|
43 |
const TypeOopPtr* val_type, |
|
44 |
Node* pre_val, |
|
45 |
BasicType bt) const; |
|
46 |
||
47 |
virtual void post_barrier(GraphKit* kit, |
|
48 |
Node* ctl, |
|
49 |
Node* store, |
|
50 |
Node* obj, |
|
51 |
Node* adr, |
|
52 |
uint adr_idx, |
|
53 |
Node* val, |
|
54 |
BasicType bt, |
|
55 |
bool use_precise) const; |
|
56 |
||
57 |
bool g1_can_remove_pre_barrier(GraphKit* kit, |
|
58 |
PhaseTransform* phase, |
|
59 |
Node* adr, |
|
60 |
BasicType bt, |
|
61 |
uint adr_idx) const; |
|
62 |
||
63 |
bool g1_can_remove_post_barrier(GraphKit* kit, |
|
64 |
PhaseTransform* phase, Node* store, |
|
65 |
Node* adr) const; |
|
66 |
||
67 |
void g1_mark_card(GraphKit* kit, |
|
68 |
IdealKit& ideal, |
|
69 |
Node* card_adr, |
|
70 |
Node* oop_store, |
|
71 |
uint oop_alias_idx, |
|
72 |
Node* index, |
|
73 |
Node* index_adr, |
|
74 |
Node* buffer, |
|
75 |
const TypeFunc* tf) const; |
|
76 |
||
77 |
// Helper for unsafe accesses, that may or may not be on the referent field. |
|
78 |
// Generates the guards that check whether the result of |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
50375
diff
changeset
|
79 |
// Unsafe.getReference should be recorded in an SATB log buffer. |
50180 | 80 |
void insert_pre_barrier(GraphKit* kit, Node* base_oop, Node* offset, Node* pre_val, bool need_mem_bar) const; |
81 |
||
50375
bfbe7d8369bb
8202547: Move G1 runtime calls used by generated code to G1BarrierSetRuntime
eosterlund
parents:
50180
diff
changeset
|
82 |
static const TypeFunc* write_ref_field_pre_entry_Type(); |
bfbe7d8369bb
8202547: Move G1 runtime calls used by generated code to G1BarrierSetRuntime
eosterlund
parents:
50180
diff
changeset
|
83 |
static const TypeFunc* write_ref_field_post_entry_Type(); |
50180 | 84 |
|
85 |
virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const; |
|
86 |
||
87 |
public: |
|
88 |
virtual bool is_gc_barrier_node(Node* node) const; |
|
89 |
virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const; |
|
90 |
virtual Node* step_over_gc_barrier(Node* c) const; |
|
52426
38bf0c9c4e64
8213384: Move G1/C2 barrier verification into G1BarrierSetC2
rkennke
parents:
52220
diff
changeset
|
91 |
|
38bf0c9c4e64
8213384: Move G1/C2 barrier verification into G1BarrierSetC2
rkennke
parents:
52220
diff
changeset
|
92 |
#ifdef ASSERT |
38bf0c9c4e64
8213384: Move G1/C2 barrier verification into G1BarrierSetC2
rkennke
parents:
52220
diff
changeset
|
93 |
virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const; |
38bf0c9c4e64
8213384: Move G1/C2 barrier verification into G1BarrierSetC2
rkennke
parents:
52220
diff
changeset
|
94 |
#endif |
50180 | 95 |
}; |
96 |
||
97 |
#endif // SHARE_GC_SHARED_C2_G1BARRIERSETC2_HPP |