Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp
40976 views
1
/*
2
* Copyright (c) 2015, 2019, 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
#ifndef SHARE_GC_Z_C2_ZBARRIERSETC2_HPP
25
#define SHARE_GC_Z_C2_ZBARRIERSETC2_HPP
26
27
#include "gc/shared/c2/barrierSetC2.hpp"
28
#include "memory/allocation.hpp"
29
#include "opto/node.hpp"
30
#include "utilities/growableArray.hpp"
31
32
const uint8_t ZLoadBarrierElided = 0;
33
const uint8_t ZLoadBarrierStrong = 1;
34
const uint8_t ZLoadBarrierWeak = 2;
35
const uint8_t ZLoadBarrierPhantom = 4;
36
const uint8_t ZLoadBarrierNoKeepalive = 8;
37
38
class ZLoadBarrierStubC2 : public ResourceObj {
39
private:
40
const MachNode* _node;
41
const Address _ref_addr;
42
const Register _ref;
43
const Register _tmp;
44
const uint8_t _barrier_data;
45
Label _entry;
46
Label _continuation;
47
48
ZLoadBarrierStubC2(const MachNode* node, Address ref_addr, Register ref, Register tmp, uint8_t barrier_data);
49
50
public:
51
static ZLoadBarrierStubC2* create(const MachNode* node, Address ref_addr, Register ref, Register tmp, uint8_t barrier_data);
52
53
Address ref_addr() const;
54
Register ref() const;
55
Register tmp() const;
56
address slow_path() const;
57
RegMask& live() const;
58
Label* entry();
59
Label* continuation();
60
};
61
62
class ZBarrierSetC2 : public BarrierSetC2 {
63
private:
64
void compute_liveness_at_stubs() const;
65
void analyze_dominating_barriers() const;
66
67
protected:
68
virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const;
69
virtual Node* atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access,
70
Node* expected_val,
71
Node* new_val,
72
const Type* val_type) const;
73
virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& access,
74
Node* expected_val,
75
Node* new_val,
76
const Type* value_type) const;
77
virtual Node* atomic_xchg_at_resolved(C2AtomicParseAccess& access,
78
Node* new_val,
79
const Type* val_type) const;
80
81
public:
82
virtual void* create_barrier_state(Arena* comp_arena) const;
83
virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc,
84
BasicType type,
85
bool is_clone,
86
bool is_clone_instance,
87
ArrayCopyPhase phase) const;
88
virtual void clone_at_expansion(PhaseMacroExpand* phase,
89
ArrayCopyNode* ac) const;
90
91
virtual void late_barrier_analysis() const;
92
virtual int estimate_stub_size() const;
93
virtual void emit_stubs(CodeBuffer& cb) const;
94
};
95
96
#endif // SHARE_GC_Z_C2_ZBARRIERSETC2_HPP
97
98