author | coleenp |
Fri, 23 Feb 2018 07:47:29 -0500 | |
changeset 49056 | 91ada5977172 |
parent 49041 | 44122f767467 |
child 49383 | bf2ff45e592f |
permissions | -rw-r--r-- |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
1 |
/* |
48628
69d65d9dcadb
8193063: Enabling narrowOop values for RawAccess accesses
eosterlund
parents:
47998
diff
changeset
|
2 |
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
4 |
* |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
8 |
* |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
13 |
* accompanied this code). |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
14 |
* |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
18 |
* |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
21 |
* questions. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
22 |
* |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
23 |
*/ |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
24 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
25 |
#ifndef SHARE_VM_RUNTIME_ACCESS_HPP |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
26 |
#define SHARE_VM_RUNTIME_ACCESS_HPP |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
27 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
28 |
#include "memory/allocation.hpp" |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
29 |
#include "metaprogramming/decay.hpp" |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
30 |
#include "metaprogramming/integralConstant.hpp" |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
31 |
#include "oops/oopsHierarchy.hpp" |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
32 |
#include "utilities/debug.hpp" |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
33 |
#include "utilities/globalDefinitions.hpp" |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
34 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
35 |
// = GENERAL = |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
36 |
// Access is an API for performing accesses with declarative semantics. Each access can have a number of "decorators". |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
37 |
// A decorator is an attribute or property that affects the way a memory access is performed in some way. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
38 |
// There are different groups of decorators. Some have to do with memory ordering, others to do with, |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
39 |
// e.g. strength of references, strength of GC barriers, or whether compression should be applied or not. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
40 |
// Some decorators are set at buildtime, such as whether primitives require GC barriers or not, others |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
41 |
// at callsites such as whether an access is in the heap or not, and others are resolved at runtime |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
42 |
// such as GC-specific barriers and encoding/decoding compressed oops. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
43 |
// By pipelining handling of these decorators, the design of the Access API allows separation of concern |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
44 |
// over the different orthogonal concerns of decorators, while providing a powerful way of |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
45 |
// expressing these orthogonal semantic properties in a unified way. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
46 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
47 |
// == OPERATIONS == |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
48 |
// * load: Load a value from an address. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
49 |
// * load_at: Load a value from an internal pointer relative to a base object. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
50 |
// * store: Store a value at an address. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
51 |
// * store_at: Store a value in an internal pointer relative to a base object. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
52 |
// * atomic_cmpxchg: Atomically compare-and-swap a new value at an address if previous value matched the compared value. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
53 |
// * atomic_cmpxchg_at: Atomically compare-and-swap a new value at an internal pointer address if previous value matched the compared value. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
54 |
// * atomic_xchg: Atomically swap a new value at an address if previous value matched the compared value. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
55 |
// * atomic_xchg_at: Atomically swap a new value at an internal pointer address if previous value matched the compared value. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
56 |
// * arraycopy: Copy data from one heap array to another heap array. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
57 |
// * clone: Clone the contents of an object to a newly allocated object. |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
58 |
// * resolve: Resolve a stable to-space invariant oop that is guaranteed not to relocate its payload until a subsequent thread transition. |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
59 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
60 |
typedef uint64_t DecoratorSet; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
61 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
62 |
// == Internal Decorators - do not use == |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
63 |
// * INTERNAL_EMPTY: This is the name for the empty decorator set (in absence of other decorators). |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
64 |
// * INTERNAL_CONVERT_COMPRESSED_OOPS: This is an oop access that will require converting an oop |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
65 |
// to a narrowOop or vice versa, if UseCompressedOops is known to be set. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
66 |
// * INTERNAL_VALUE_IS_OOP: Remember that the involved access is on oop rather than primitive. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
67 |
const DecoratorSet INTERNAL_EMPTY = UCONST64(0); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
68 |
const DecoratorSet INTERNAL_CONVERT_COMPRESSED_OOP = UCONST64(1) << 1; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
69 |
const DecoratorSet INTERNAL_VALUE_IS_OOP = UCONST64(1) << 2; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
70 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
71 |
// == Internal build-time Decorators == |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
72 |
// * INTERNAL_BT_BARRIER_ON_PRIMITIVES: This is set in the barrierSetConfig.hpp file. |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
73 |
// * INTERNAL_BT_TO_SPACE_INVARIANT: This is set in the barrierSetConfig.hpp file iff |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
74 |
// no GC is bundled in the build that is to-space invariant. |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
75 |
const DecoratorSet INTERNAL_BT_BARRIER_ON_PRIMITIVES = UCONST64(1) << 3; |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
76 |
const DecoratorSet INTERNAL_BT_TO_SPACE_INVARIANT = UCONST64(1) << 4; |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
77 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
78 |
// == Internal run-time Decorators == |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
79 |
// * INTERNAL_RT_USE_COMPRESSED_OOPS: This decorator will be set in runtime resolved |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
80 |
// access backends iff UseCompressedOops is true. |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
81 |
const DecoratorSet INTERNAL_RT_USE_COMPRESSED_OOPS = UCONST64(1) << 5; |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
82 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
83 |
const DecoratorSet INTERNAL_DECORATOR_MASK = INTERNAL_CONVERT_COMPRESSED_OOP | INTERNAL_VALUE_IS_OOP | |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
84 |
INTERNAL_BT_BARRIER_ON_PRIMITIVES | INTERNAL_RT_USE_COMPRESSED_OOPS; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
85 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
86 |
// == Memory Ordering Decorators == |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
87 |
// The memory ordering decorators can be described in the following way: |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
88 |
// === Decorator Rules === |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
89 |
// The different types of memory ordering guarantees have a strict order of strength. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
90 |
// Explicitly specifying the stronger ordering implies that the guarantees of the weaker |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
91 |
// property holds too. The names come from the C++11 atomic operations, and typically |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
92 |
// have a JMM equivalent property. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
93 |
// The equivalence may be viewed like this: |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
94 |
// MO_UNORDERED is equivalent to JMM plain. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
95 |
// MO_VOLATILE has no equivalence in JMM, because it's a C++ thing. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
96 |
// MO_RELAXED is equivalent to JMM opaque. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
97 |
// MO_ACQUIRE is equivalent to JMM acquire. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
98 |
// MO_RELEASE is equivalent to JMM release. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
99 |
// MO_SEQ_CST is equivalent to JMM volatile. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
100 |
// |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
101 |
// === Stores === |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
102 |
// * MO_UNORDERED (Default): No guarantees. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
103 |
// - The compiler and hardware are free to reorder aggressively. And they will. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
104 |
// * MO_VOLATILE: Volatile stores (in the C++ sense). |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
105 |
// - The stores are not reordered by the compiler (but possibly the HW) w.r.t. other |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
106 |
// volatile accesses in program order (but possibly non-volatile accesses). |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
107 |
// * MO_RELAXED: Relaxed atomic stores. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
108 |
// - The stores are atomic. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
109 |
// - Guarantees from volatile stores hold. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
110 |
// * MO_RELEASE: Releasing stores. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
111 |
// - The releasing store will make its preceding memory accesses observable to memory accesses |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
112 |
// subsequent to an acquiring load observing this releasing store. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
113 |
// - Guarantees from relaxed stores hold. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
114 |
// * MO_SEQ_CST: Sequentially consistent stores. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
115 |
// - The stores are observed in the same order by MO_SEQ_CST loads on other processors |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
116 |
// - Preceding loads and stores in program order are not reordered with subsequent loads and stores in program order. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
117 |
// - Guarantees from releasing stores hold. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
118 |
// === Loads === |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
119 |
// * MO_UNORDERED (Default): No guarantees |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
120 |
// - The compiler and hardware are free to reorder aggressively. And they will. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
121 |
// * MO_VOLATILE: Volatile loads (in the C++ sense). |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
122 |
// - The loads are not reordered by the compiler (but possibly the HW) w.r.t. other |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
123 |
// volatile accesses in program order (but possibly non-volatile accesses). |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
124 |
// * MO_RELAXED: Relaxed atomic loads. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
125 |
// - The stores are atomic. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
126 |
// - Guarantees from volatile loads hold. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
127 |
// * MO_ACQUIRE: Acquiring loads. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
128 |
// - An acquiring load will make subsequent memory accesses observe the memory accesses |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
129 |
// preceding the releasing store that the acquiring load observed. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
130 |
// - Guarantees from relaxed loads hold. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
131 |
// * MO_SEQ_CST: Sequentially consistent loads. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
132 |
// - These loads observe MO_SEQ_CST stores in the same order on other processors |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
133 |
// - Preceding loads and stores in program order are not reordered with subsequent loads and stores in program order. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
134 |
// - Guarantees from acquiring loads hold. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
135 |
// === Atomic Cmpxchg === |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
136 |
// * MO_RELAXED: Atomic but relaxed cmpxchg. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
137 |
// - Guarantees from MO_RELAXED loads and MO_RELAXED stores hold unconditionally. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
138 |
// * MO_SEQ_CST: Sequentially consistent cmpxchg. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
139 |
// - Guarantees from MO_SEQ_CST loads and MO_SEQ_CST stores hold unconditionally. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
140 |
// === Atomic Xchg === |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
141 |
// * MO_RELAXED: Atomic but relaxed atomic xchg. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
142 |
// - Guarantees from MO_RELAXED loads and MO_RELAXED stores hold. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
143 |
// * MO_SEQ_CST: Sequentially consistent xchg. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
144 |
// - Guarantees from MO_SEQ_CST loads and MO_SEQ_CST stores hold. |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
145 |
const DecoratorSet MO_UNORDERED = UCONST64(1) << 6; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
146 |
const DecoratorSet MO_VOLATILE = UCONST64(1) << 7; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
147 |
const DecoratorSet MO_RELAXED = UCONST64(1) << 8; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
148 |
const DecoratorSet MO_ACQUIRE = UCONST64(1) << 9; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
149 |
const DecoratorSet MO_RELEASE = UCONST64(1) << 10; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
150 |
const DecoratorSet MO_SEQ_CST = UCONST64(1) << 11; |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
151 |
const DecoratorSet MO_DECORATOR_MASK = MO_UNORDERED | MO_VOLATILE | MO_RELAXED | |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
152 |
MO_ACQUIRE | MO_RELEASE | MO_SEQ_CST; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
153 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
154 |
// === Barrier Strength Decorators === |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
155 |
// * AS_RAW: The access will translate into a raw memory access, hence ignoring all semantic concerns |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
156 |
// except memory ordering and compressed oops. This will bypass runtime function pointer dispatching |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
157 |
// in the pipeline and hardwire to raw accesses without going trough the GC access barriers. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
158 |
// - Accesses on oop* translate to raw memory accesses without runtime checks |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
159 |
// - Accesses on narrowOop* translate to encoded/decoded memory accesses without runtime checks |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
160 |
// - Accesses on HeapWord* translate to a runtime check choosing one of the above |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
161 |
// - Accesses on other types translate to raw memory accesses without runtime checks |
48966
e6eb66d2e765
8197454: Need Access decorator for storing oop into uninitialized location
kbarrett
parents:
48784
diff
changeset
|
162 |
// * AS_DEST_NOT_INITIALIZED: This property can be important to e.g. SATB barriers by |
e6eb66d2e765
8197454: Need Access decorator for storing oop into uninitialized location
kbarrett
parents:
48784
diff
changeset
|
163 |
// marking that the previous value is uninitialized nonsense rather than a real value. |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
164 |
// * AS_NO_KEEPALIVE: The barrier is used only on oop references and will not keep any involved objects |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
165 |
// alive, regardless of the type of reference being accessed. It will however perform the memory access |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
166 |
// in a consistent way w.r.t. e.g. concurrent compaction, so that the right field is being accessed, |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
167 |
// or maintain, e.g. intergenerational or interregional pointers if applicable. This should be used with |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
168 |
// extreme caution in isolated scopes. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
169 |
// * AS_NORMAL: The accesses will be resolved to an accessor on the BarrierSet class, giving the |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
170 |
// responsibility of performing the access and what barriers to be performed to the GC. This is the default. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
171 |
// Note that primitive accesses will only be resolved on the barrier set if the appropriate build-time |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
172 |
// decorator for enabling primitive barriers is enabled for the build. |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
173 |
const DecoratorSet AS_RAW = UCONST64(1) << 12; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
174 |
const DecoratorSet AS_DEST_NOT_INITIALIZED = UCONST64(1) << 13; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
175 |
const DecoratorSet AS_NO_KEEPALIVE = UCONST64(1) << 14; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
176 |
const DecoratorSet AS_NORMAL = UCONST64(1) << 15; |
48966
e6eb66d2e765
8197454: Need Access decorator for storing oop into uninitialized location
kbarrett
parents:
48784
diff
changeset
|
177 |
const DecoratorSet AS_DECORATOR_MASK = AS_RAW | AS_DEST_NOT_INITIALIZED | |
e6eb66d2e765
8197454: Need Access decorator for storing oop into uninitialized location
kbarrett
parents:
48784
diff
changeset
|
178 |
AS_NO_KEEPALIVE | AS_NORMAL; |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
179 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
180 |
// === Reference Strength Decorators === |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
181 |
// These decorators only apply to accesses on oop-like types (oop/narrowOop). |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
182 |
// * ON_STRONG_OOP_REF: Memory access is performed on a strongly reachable reference. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
183 |
// * ON_WEAK_OOP_REF: The memory access is performed on a weakly reachable reference. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
184 |
// * ON_PHANTOM_OOP_REF: The memory access is performed on a phantomly reachable reference. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
185 |
// This is the same ring of strength as jweak and weak oops in the VM. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
186 |
// * ON_UNKNOWN_OOP_REF: The memory access is performed on a reference of unknown strength. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
187 |
// This could for example come from the unsafe API. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
188 |
// * Default (no explicit reference strength specified): ON_STRONG_OOP_REF |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
189 |
const DecoratorSet ON_STRONG_OOP_REF = UCONST64(1) << 16; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
190 |
const DecoratorSet ON_WEAK_OOP_REF = UCONST64(1) << 17; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
191 |
const DecoratorSet ON_PHANTOM_OOP_REF = UCONST64(1) << 18; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
192 |
const DecoratorSet ON_UNKNOWN_OOP_REF = UCONST64(1) << 19; |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
193 |
const DecoratorSet ON_DECORATOR_MASK = ON_STRONG_OOP_REF | ON_WEAK_OOP_REF | |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
194 |
ON_PHANTOM_OOP_REF | ON_UNKNOWN_OOP_REF; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
195 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
196 |
// === Access Location === |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
197 |
// Accesses can take place in, e.g. the heap, old or young generation and different native roots. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
198 |
// The location is important to the GC as it may imply different actions. The following decorators are used: |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
199 |
// * IN_HEAP: The access is performed in the heap. Many barriers such as card marking will |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
200 |
// be omitted if this decorator is not set. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
201 |
// * IN_HEAP_ARRAY: The access is performed on a heap allocated array. This is sometimes a special case |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
202 |
// for some GCs, and implies that it is an IN_HEAP. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
203 |
// * IN_ROOT: The access is performed in an off-heap data structure pointing into the Java heap. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
204 |
// * IN_CONCURRENT_ROOT: The access is performed in an off-heap data structure pointing into the Java heap, |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
205 |
// but is notably not scanned during safepoints. This is sometimes a special case for some GCs and |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
206 |
// implies that it is also an IN_ROOT. |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
207 |
const DecoratorSet IN_HEAP = UCONST64(1) << 20; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
208 |
const DecoratorSet IN_HEAP_ARRAY = UCONST64(1) << 21; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
209 |
const DecoratorSet IN_ROOT = UCONST64(1) << 22; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
210 |
const DecoratorSet IN_CONCURRENT_ROOT = UCONST64(1) << 23; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
211 |
const DecoratorSet IN_ARCHIVE_ROOT = UCONST64(1) << 24; |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
212 |
const DecoratorSet IN_DECORATOR_MASK = IN_HEAP | IN_HEAP_ARRAY | |
48784
899b522ed65c
8194741: Refactor oops in constant pool from CDS to use the Access API
eosterlund
parents:
48628
diff
changeset
|
213 |
IN_ROOT | IN_CONCURRENT_ROOT | |
899b522ed65c
8194741: Refactor oops in constant pool from CDS to use the Access API
eosterlund
parents:
48628
diff
changeset
|
214 |
IN_ARCHIVE_ROOT; |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
215 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
216 |
// == Value Decorators == |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
217 |
// * OOP_NOT_NULL: This property can make certain barriers faster such as compressing oops. |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
218 |
const DecoratorSet OOP_NOT_NULL = UCONST64(1) << 25; |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
219 |
const DecoratorSet OOP_DECORATOR_MASK = OOP_NOT_NULL; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
220 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
221 |
// == Arraycopy Decorators == |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
222 |
// * ARRAYCOPY_CHECKCAST: This property means that the class of the objects in source |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
223 |
// are not guaranteed to be subclasses of the class of the destination array. This requires |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
224 |
// a check-cast barrier during the copying operation. If this is not set, it is assumed |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
225 |
// that the array is covariant: (the source array type is-a destination array type) |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
226 |
// * ARRAYCOPY_DISJOINT: This property means that it is known that the two array ranges |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
227 |
// are disjoint. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
228 |
// * ARRAYCOPY_ARRAYOF: The copy is in the arrayof form. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
229 |
// * ARRAYCOPY_ATOMIC: The accesses have to be atomic over the size of its elements. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
230 |
// * ARRAYCOPY_ALIGNED: The accesses have to be aligned on a HeapWord. |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
231 |
const DecoratorSet ARRAYCOPY_CHECKCAST = UCONST64(1) << 26; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
232 |
const DecoratorSet ARRAYCOPY_DISJOINT = UCONST64(1) << 27; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
233 |
const DecoratorSet ARRAYCOPY_ARRAYOF = UCONST64(1) << 28; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
234 |
const DecoratorSet ARRAYCOPY_ATOMIC = UCONST64(1) << 29; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
235 |
const DecoratorSet ARRAYCOPY_ALIGNED = UCONST64(1) << 30; |
48966
e6eb66d2e765
8197454: Need Access decorator for storing oop into uninitialized location
kbarrett
parents:
48784
diff
changeset
|
236 |
const DecoratorSet ARRAYCOPY_DECORATOR_MASK = ARRAYCOPY_CHECKCAST | ARRAYCOPY_DISJOINT | |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
237 |
ARRAYCOPY_DISJOINT | ARRAYCOPY_ARRAYOF | |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
238 |
ARRAYCOPY_ATOMIC | ARRAYCOPY_ALIGNED; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
239 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
240 |
// The HasDecorator trait can help at compile-time determining whether a decorator set |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
241 |
// has an intersection with a certain other decorator set |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
242 |
template <DecoratorSet decorators, DecoratorSet decorator> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
243 |
struct HasDecorator: public IntegralConstant<bool, (decorators & decorator) != 0> {}; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
244 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
245 |
namespace AccessInternal { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
246 |
template <typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
247 |
struct OopOrNarrowOopInternal: AllStatic { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
248 |
typedef oop type; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
249 |
}; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
250 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
251 |
template <> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
252 |
struct OopOrNarrowOopInternal<narrowOop>: AllStatic { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
253 |
typedef narrowOop type; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
254 |
}; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
255 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
256 |
// This metafunction returns a canonicalized oop/narrowOop type for a passed |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
257 |
// in oop-like types passed in from oop_* overloads where the user has sworn |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
258 |
// that the passed in values should be oop-like (e.g. oop, oopDesc*, arrayOop, |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
259 |
// narrowOoop, instanceOopDesc*, and random other things). |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
260 |
// In the oop_* overloads, it must hold that if the passed in type T is not |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
261 |
// narrowOop, then it by contract has to be one of many oop-like types implicitly |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
262 |
// convertible to oop, and hence returns oop as the canonical oop type. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
263 |
// If it turns out it was not, then the implicit conversion to oop will fail |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
264 |
// to compile, as desired. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
265 |
template <typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
266 |
struct OopOrNarrowOop: AllStatic { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
267 |
typedef typename OopOrNarrowOopInternal<typename Decay<T>::type>::type type; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
268 |
}; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
269 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
270 |
inline void* field_addr(oop base, ptrdiff_t byte_offset) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
271 |
return reinterpret_cast<void*>(reinterpret_cast<intptr_t>((void*)base) + byte_offset); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
272 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
273 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
274 |
template <DecoratorSet decorators, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
275 |
void store_at(oop base, ptrdiff_t offset, T value); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
276 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
277 |
template <DecoratorSet decorators, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
278 |
T load_at(oop base, ptrdiff_t offset); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
279 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
280 |
template <DecoratorSet decorators, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
281 |
T atomic_cmpxchg_at(T new_value, oop base, ptrdiff_t offset, T compare_value); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
282 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
283 |
template <DecoratorSet decorators, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
284 |
T atomic_xchg_at(T new_value, oop base, ptrdiff_t offset); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
285 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
286 |
template <DecoratorSet decorators, typename P, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
287 |
void store(P* addr, T value); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
288 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
289 |
template <DecoratorSet decorators, typename P, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
290 |
T load(P* addr); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
291 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
292 |
template <DecoratorSet decorators, typename P, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
293 |
T atomic_cmpxchg(T new_value, P* addr, T compare_value); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
294 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
295 |
template <DecoratorSet decorators, typename P, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
296 |
T atomic_xchg(T new_value, P* addr); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
297 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
298 |
template <DecoratorSet decorators, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
299 |
bool arraycopy(arrayOop src_obj, arrayOop dst_obj, T *src, T *dst, size_t length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
300 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
301 |
template <DecoratorSet decorators> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
302 |
void clone(oop src, oop dst, size_t size); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
303 |
|
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
304 |
template <DecoratorSet decorators> |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
305 |
oop resolve(oop src); |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
306 |
|
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
307 |
// Infer the type that should be returned from a load. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
308 |
template <typename P, DecoratorSet decorators> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
309 |
class LoadProxy: public StackObj { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
310 |
private: |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
311 |
P *const _addr; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
312 |
public: |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
313 |
LoadProxy(P* addr) : _addr(addr) {} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
314 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
315 |
template <typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
316 |
inline operator T() { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
317 |
return load<decorators, P, T>(_addr); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
318 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
319 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
320 |
inline operator P() { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
321 |
return load<decorators, P, P>(_addr); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
322 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
323 |
}; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
324 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
325 |
// Infer the type that should be returned from a load_at. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
326 |
template <DecoratorSet decorators> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
327 |
class LoadAtProxy: public StackObj { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
328 |
private: |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
329 |
const oop _base; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
330 |
const ptrdiff_t _offset; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
331 |
public: |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
332 |
LoadAtProxy(oop base, ptrdiff_t offset) : _base(base), _offset(offset) {} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
333 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
334 |
template <typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
335 |
inline operator T() const { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
336 |
return load_at<decorators, T>(_base, _offset); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
337 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
338 |
}; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
339 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
340 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
341 |
template <DecoratorSet decorators = INTERNAL_EMPTY> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
342 |
class Access: public AllStatic { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
343 |
// This function asserts that if an access gets passed in a decorator outside |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
344 |
// of the expected_decorators, then something is wrong. It additionally checks |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
345 |
// the consistency of the decorators so that supposedly disjoint decorators are indeed |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
346 |
// disjoint. For example, an access can not be both in heap and on root at the |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
347 |
// same time. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
348 |
template <DecoratorSet expected_decorators> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
349 |
static void verify_decorators(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
350 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
351 |
template <DecoratorSet expected_mo_decorators> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
352 |
static void verify_primitive_decorators() { |
48966
e6eb66d2e765
8197454: Need Access decorator for storing oop into uninitialized location
kbarrett
parents:
48784
diff
changeset
|
353 |
const DecoratorSet primitive_decorators = (AS_DECORATOR_MASK ^ AS_NO_KEEPALIVE ^ AS_DEST_NOT_INITIALIZED) | |
e6eb66d2e765
8197454: Need Access decorator for storing oop into uninitialized location
kbarrett
parents:
48784
diff
changeset
|
354 |
IN_HEAP | IN_HEAP_ARRAY; |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
355 |
verify_decorators<expected_mo_decorators | primitive_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
356 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
357 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
358 |
template <DecoratorSet expected_mo_decorators> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
359 |
static void verify_oop_decorators() { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
360 |
const DecoratorSet oop_decorators = AS_DECORATOR_MASK | IN_DECORATOR_MASK | |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
361 |
(ON_DECORATOR_MASK ^ ON_UNKNOWN_OOP_REF) | // no unknown oop refs outside of the heap |
48628
69d65d9dcadb
8193063: Enabling narrowOop values for RawAccess accesses
eosterlund
parents:
47998
diff
changeset
|
362 |
OOP_DECORATOR_MASK; |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
363 |
verify_decorators<expected_mo_decorators | oop_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
364 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
365 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
366 |
template <DecoratorSet expected_mo_decorators> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
367 |
static void verify_heap_oop_decorators() { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
368 |
const DecoratorSet heap_oop_decorators = AS_DECORATOR_MASK | ON_DECORATOR_MASK | |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
369 |
OOP_DECORATOR_MASK | (IN_DECORATOR_MASK ^ |
48628
69d65d9dcadb
8193063: Enabling narrowOop values for RawAccess accesses
eosterlund
parents:
47998
diff
changeset
|
370 |
(IN_ROOT | IN_CONCURRENT_ROOT)); // no root accesses in the heap |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
371 |
verify_decorators<expected_mo_decorators | heap_oop_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
372 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
373 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
374 |
static const DecoratorSet load_mo_decorators = MO_UNORDERED | MO_VOLATILE | MO_RELAXED | MO_ACQUIRE | MO_SEQ_CST; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
375 |
static const DecoratorSet store_mo_decorators = MO_UNORDERED | MO_VOLATILE | MO_RELAXED | MO_RELEASE | MO_SEQ_CST; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
376 |
static const DecoratorSet atomic_xchg_mo_decorators = MO_SEQ_CST; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
377 |
static const DecoratorSet atomic_cmpxchg_mo_decorators = MO_RELAXED | MO_SEQ_CST; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
378 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
379 |
public: |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
380 |
// Primitive heap accesses |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
381 |
static inline AccessInternal::LoadAtProxy<decorators> load_at(oop base, ptrdiff_t offset) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
382 |
verify_primitive_decorators<load_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
383 |
return AccessInternal::LoadAtProxy<decorators>(base, offset); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
384 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
385 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
386 |
template <typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
387 |
static inline void store_at(oop base, ptrdiff_t offset, T value) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
388 |
verify_primitive_decorators<store_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
389 |
AccessInternal::store_at<decorators>(base, offset, value); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
390 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
391 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
392 |
template <typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
393 |
static inline T atomic_cmpxchg_at(T new_value, oop base, ptrdiff_t offset, T compare_value) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
394 |
verify_primitive_decorators<atomic_cmpxchg_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
395 |
return AccessInternal::atomic_cmpxchg_at<decorators>(new_value, base, offset, compare_value); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
396 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
397 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
398 |
template <typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
399 |
static inline T atomic_xchg_at(T new_value, oop base, ptrdiff_t offset) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
400 |
verify_primitive_decorators<atomic_xchg_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
401 |
return AccessInternal::atomic_xchg_at<decorators>(new_value, base, offset); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
402 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
403 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
404 |
template <typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
405 |
static inline bool arraycopy(arrayOop src_obj, arrayOop dst_obj, T *src, T *dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
406 |
verify_decorators<ARRAYCOPY_DECORATOR_MASK | IN_HEAP | |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
407 |
AS_DECORATOR_MASK>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
408 |
return AccessInternal::arraycopy<decorators>(src_obj, dst_obj, src, dst, length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
409 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
410 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
411 |
// Oop heap accesses |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
412 |
static inline AccessInternal::LoadAtProxy<decorators | INTERNAL_VALUE_IS_OOP> oop_load_at(oop base, ptrdiff_t offset) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
413 |
verify_heap_oop_decorators<load_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
414 |
return AccessInternal::LoadAtProxy<decorators | INTERNAL_VALUE_IS_OOP>(base, offset); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
415 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
416 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
417 |
template <typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
418 |
static inline void oop_store_at(oop base, ptrdiff_t offset, T value) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
419 |
verify_heap_oop_decorators<store_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
420 |
typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
421 |
OopType oop_value = value; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
422 |
AccessInternal::store_at<decorators | INTERNAL_VALUE_IS_OOP>(base, offset, oop_value); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
423 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
424 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
425 |
template <typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
426 |
static inline T oop_atomic_cmpxchg_at(T new_value, oop base, ptrdiff_t offset, T compare_value) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
427 |
verify_heap_oop_decorators<atomic_cmpxchg_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
428 |
typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
429 |
OopType new_oop_value = new_value; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
430 |
OopType compare_oop_value = compare_value; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
431 |
return AccessInternal::atomic_cmpxchg_at<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, base, offset, compare_oop_value); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
432 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
433 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
434 |
template <typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
435 |
static inline T oop_atomic_xchg_at(T new_value, oop base, ptrdiff_t offset) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
436 |
verify_heap_oop_decorators<atomic_xchg_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
437 |
typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
438 |
OopType new_oop_value = new_value; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
439 |
return AccessInternal::atomic_xchg_at<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, base, offset); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
440 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
441 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
442 |
template <typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
443 |
static inline bool oop_arraycopy(arrayOop src_obj, arrayOop dst_obj, T *src, T *dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
444 |
verify_decorators<ARRAYCOPY_DECORATOR_MASK | IN_HEAP | AS_DECORATOR_MASK>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
445 |
return AccessInternal::arraycopy<decorators | INTERNAL_VALUE_IS_OOP>(src_obj, dst_obj, src, dst, length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
446 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
447 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
448 |
// Clone an object from src to dst |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
449 |
static inline void clone(oop src, oop dst, size_t size) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
450 |
verify_decorators<IN_HEAP>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
451 |
AccessInternal::clone<decorators>(src, dst, size); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
452 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
453 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
454 |
// Primitive accesses |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
455 |
template <typename P> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
456 |
static inline P load(P* addr) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
457 |
verify_primitive_decorators<load_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
458 |
return AccessInternal::load<decorators, P, P>(addr); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
459 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
460 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
461 |
template <typename P, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
462 |
static inline void store(P* addr, T value) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
463 |
verify_primitive_decorators<store_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
464 |
AccessInternal::store<decorators>(addr, value); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
465 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
466 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
467 |
template <typename P, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
468 |
static inline T atomic_cmpxchg(T new_value, P* addr, T compare_value) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
469 |
verify_primitive_decorators<atomic_cmpxchg_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
470 |
return AccessInternal::atomic_cmpxchg<decorators>(new_value, addr, compare_value); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
471 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
472 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
473 |
template <typename P, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
474 |
static inline T atomic_xchg(T new_value, P* addr) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
475 |
verify_primitive_decorators<atomic_xchg_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
476 |
return AccessInternal::atomic_xchg<decorators>(new_value, addr); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
477 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
478 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
479 |
// Oop accesses |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
480 |
template <typename P> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
481 |
static inline AccessInternal::LoadProxy<P, decorators | INTERNAL_VALUE_IS_OOP> oop_load(P* addr) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
482 |
verify_oop_decorators<load_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
483 |
return AccessInternal::LoadProxy<P, decorators | INTERNAL_VALUE_IS_OOP>(addr); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
484 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
485 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
486 |
template <typename P, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
487 |
static inline void oop_store(P* addr, T value) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
488 |
verify_oop_decorators<store_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
489 |
typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
490 |
OopType oop_value = value; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
491 |
AccessInternal::store<decorators | INTERNAL_VALUE_IS_OOP>(addr, oop_value); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
492 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
493 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
494 |
template <typename P, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
495 |
static inline T oop_atomic_cmpxchg(T new_value, P* addr, T compare_value) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
496 |
verify_oop_decorators<atomic_cmpxchg_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
497 |
typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
498 |
OopType new_oop_value = new_value; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
499 |
OopType compare_oop_value = compare_value; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
500 |
return AccessInternal::atomic_cmpxchg<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, addr, compare_oop_value); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
501 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
502 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
503 |
template <typename P, typename T> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
504 |
static inline T oop_atomic_xchg(T new_value, P* addr) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
505 |
verify_oop_decorators<atomic_xchg_mo_decorators>(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
506 |
typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
507 |
OopType new_oop_value = new_value; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
508 |
return AccessInternal::atomic_xchg<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, addr); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
509 |
} |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
510 |
|
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
511 |
static oop resolve(oop obj) { |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
512 |
verify_decorators<INTERNAL_EMPTY>(); |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
513 |
return AccessInternal::resolve<decorators>(obj); |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48966
diff
changeset
|
514 |
} |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
515 |
}; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
516 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
517 |
// Helper for performing raw accesses (knows only of memory ordering |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
518 |
// atomicity decorators as well as compressed oops) |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
519 |
template <DecoratorSet decorators = INTERNAL_EMPTY> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
520 |
class RawAccess: public Access<AS_RAW | decorators> {}; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
521 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
522 |
// Helper for performing normal accesses on the heap. These accesses |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
523 |
// may resolve an accessor on a GC barrier set |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
524 |
template <DecoratorSet decorators = INTERNAL_EMPTY> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
525 |
class HeapAccess: public Access<IN_HEAP | decorators> {}; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
526 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
527 |
// Helper for performing normal accesses in roots. These accesses |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
528 |
// may resolve an accessor on a GC barrier set |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
529 |
template <DecoratorSet decorators = INTERNAL_EMPTY> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
530 |
class RootAccess: public Access<IN_ROOT | decorators> {}; |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
531 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
532 |
#endif // SHARE_VM_RUNTIME_ACCESS_HPP |