author | coleenp |
Wed, 24 Jul 2019 10:22:11 -0400 | |
changeset 57511 | 00ae3b739184 |
parent 50389 | 7e8c0409a747 |
permissions | -rw-r--r-- |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
1 |
/* |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
2 |
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
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 |
#include "precompiled.hpp" |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
26 |
#include "accessBackend.inline.hpp" |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
27 |
#include "gc/shared/collectedHeap.hpp" |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
28 |
#include "oops/oop.inline.hpp" |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
29 |
#include "runtime/mutexLocker.hpp" |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
30 |
#include "runtime/vm_version.hpp" |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
31 |
#include "utilities/copy.hpp" |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
32 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
33 |
namespace AccessInternal { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
34 |
// VM_Version::supports_cx8() is a surrogate for 'supports atomic long memory ops'. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
35 |
// |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
36 |
// On platforms which do not support atomic compare-and-swap of jlong (8 byte) |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
37 |
// values we have to use a lock-based scheme to enforce atomicity. This has to be |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
38 |
// applied to all Unsafe operations that set the value of a jlong field. Even so |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
39 |
// the compareAndSwapLong operation will not be atomic with respect to direct stores |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
40 |
// to the field from Java code. It is important therefore that any Java code that |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
41 |
// utilizes these Unsafe jlong operations does not perform direct stores. To permit |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
42 |
// direct loads of the field from Java code we must also use Atomic::store within the |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
43 |
// locked regions. And for good measure, in case there are direct stores, we also |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
44 |
// employ Atomic::load within those regions. Note that the field in question must be |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
45 |
// volatile and so must have atomic load/store accesses applied at the Java level. |
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 |
// The locking scheme could utilize a range of strategies for controlling the locking |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
48 |
// granularity: from a lock per-field through to a single global lock. The latter is |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
49 |
// the simplest and is used for the current implementation. Note that the Java object |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
50 |
// that contains the field, can not, in general, be used for locking. To do so can lead |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
51 |
// to deadlocks as we may introduce locking into what appears to the Java code to be a |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
52 |
// lock-free path. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
53 |
// |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
54 |
// As all the locked-regions are very short and themselves non-blocking we can treat |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
55 |
// them as leaf routines and elide safepoint checks (ie we don't perform any thread |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
56 |
// state transitions even when blocking for the lock). Note that if we do choose to |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
57 |
// add safepoint checks and thread state transitions, we must ensure that we calculate |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
58 |
// the address of the field _after_ we have acquired the lock, else the object may have |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
59 |
// been moved by the GC |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
60 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
61 |
#ifndef SUPPORTS_NATIVE_CX8 |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
62 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
63 |
// This is intentionally in the cpp file rather than the .inline.hpp file. It seems |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
64 |
// desirable to trade faster JDK build times (not propagating vm_version.hpp) |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
65 |
// for slightly worse runtime atomic jlong performance on 32 bit machines with |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
66 |
// support for 64 bit atomics. |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
67 |
bool wide_atomic_needs_locking() { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
68 |
return !VM_Version::supports_cx8(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
69 |
} |
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 |
AccessLocker::AccessLocker() { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
72 |
assert(!VM_Version::supports_cx8(), "why else?"); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
73 |
UnsafeJlong_lock->lock_without_safepoint_check(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
74 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
75 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
76 |
AccessLocker::~AccessLocker() { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
77 |
UnsafeJlong_lock->unlock(); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
78 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
79 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
80 |
#endif |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
81 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
82 |
// These forward copying calls to Copy without exposing the Copy type in headers unnecessarily |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
83 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
84 |
void arraycopy_arrayof_conjoint_oops(void* src, void* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
85 |
Copy::arrayof_conjoint_oops(reinterpret_cast<HeapWord*>(src), |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
86 |
reinterpret_cast<HeapWord*>(dst), length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
87 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
88 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
89 |
void arraycopy_conjoint_oops(oop* src, oop* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
90 |
Copy::conjoint_oops_atomic(src, dst, length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
91 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
92 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
93 |
void arraycopy_conjoint_oops(narrowOop* src, narrowOop* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
94 |
Copy::conjoint_oops_atomic(src, dst, length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
95 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
96 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
97 |
void arraycopy_disjoint_words(void* src, void* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
98 |
Copy::disjoint_words(reinterpret_cast<HeapWord*>(src), |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
99 |
reinterpret_cast<HeapWord*>(dst), length); |
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 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
102 |
void arraycopy_disjoint_words_atomic(void* src, void* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
103 |
Copy::disjoint_words_atomic(reinterpret_cast<HeapWord*>(src), |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
104 |
reinterpret_cast<HeapWord*>(dst), length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
105 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
106 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
107 |
template<> |
50389
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
108 |
void arraycopy_conjoint<jboolean>(jboolean* src, jboolean* dst, size_t length) { |
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
109 |
Copy::conjoint_jbytes(reinterpret_cast<jbyte*>(src), reinterpret_cast<jbyte*>(dst), length); |
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
110 |
} |
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
111 |
|
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
112 |
template<> |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
113 |
void arraycopy_conjoint<jbyte>(jbyte* src, jbyte* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
114 |
Copy::conjoint_jbytes(src, dst, length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
115 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
116 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
117 |
template<> |
50389
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
118 |
void arraycopy_conjoint<jchar>(jchar* src, jchar* dst, size_t length) { |
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
119 |
Copy::conjoint_jshorts_atomic(reinterpret_cast<jshort*>(src), reinterpret_cast<jshort*>(dst), length); |
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
120 |
} |
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
121 |
|
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
122 |
template<> |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
123 |
void arraycopy_conjoint<jshort>(jshort* src, jshort* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
124 |
Copy::conjoint_jshorts_atomic(src, dst, length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
125 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
126 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
127 |
template<> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
128 |
void arraycopy_conjoint<jint>(jint* src, jint* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
129 |
Copy::conjoint_jints_atomic(src, dst, length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
130 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
131 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
132 |
template<> |
50389
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
133 |
void arraycopy_conjoint<jfloat>(jfloat* src, jfloat* dst, size_t length) { |
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
134 |
Copy::conjoint_jints_atomic(reinterpret_cast<jint*>(src), reinterpret_cast<jint*>(dst), length); |
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
135 |
} |
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
136 |
|
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
137 |
template<> |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
138 |
void arraycopy_conjoint<jlong>(jlong* src, jlong* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
139 |
Copy::conjoint_jlongs_atomic(src, dst, length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
140 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
141 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
142 |
template<> |
50389
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
143 |
void arraycopy_conjoint<jdouble>(jdouble* src, jdouble* dst, size_t length) { |
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
144 |
Copy::conjoint_jlongs_atomic(reinterpret_cast<jlong*>(src), reinterpret_cast<jlong*>(dst), length); |
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
145 |
} |
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
146 |
|
7e8c0409a747
8198285: More consistent Access API for arraycopy
rkennke
parents:
49383
diff
changeset
|
147 |
template<> |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
148 |
void arraycopy_arrayof_conjoint<jbyte>(jbyte* src, jbyte* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
149 |
Copy::arrayof_conjoint_jbytes(reinterpret_cast<HeapWord*>(src), |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
150 |
reinterpret_cast<HeapWord*>(dst), |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
151 |
length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
152 |
} |
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 |
template<> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
155 |
void arraycopy_arrayof_conjoint<jshort>(jshort* src, jshort* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
156 |
Copy::arrayof_conjoint_jshorts(reinterpret_cast<HeapWord*>(src), |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
157 |
reinterpret_cast<HeapWord*>(dst), |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
158 |
length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
159 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
160 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
161 |
template<> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
162 |
void arraycopy_arrayof_conjoint<jint>(jint* src, jint* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
163 |
Copy::arrayof_conjoint_jints(reinterpret_cast<HeapWord*>(src), |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
164 |
reinterpret_cast<HeapWord*>(dst), |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
165 |
length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
166 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
167 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
168 |
template<> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
169 |
void arraycopy_arrayof_conjoint<jlong>(jlong* src, jlong* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
170 |
Copy::arrayof_conjoint_jlongs(reinterpret_cast<HeapWord*>(src), |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
171 |
reinterpret_cast<HeapWord*>(dst), |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
172 |
length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
173 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
174 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
175 |
template<> |
49383
bf2ff45e592f
8198445: Access API for primitive/native arraycopy
rkennke
parents:
48824
diff
changeset
|
176 |
void arraycopy_conjoint<void>(void* src, void* dst, size_t length) { |
bf2ff45e592f
8198445: Access API for primitive/native arraycopy
rkennke
parents:
48824
diff
changeset
|
177 |
Copy::conjoint_jbytes(reinterpret_cast<jbyte*>(src), |
bf2ff45e592f
8198445: Access API for primitive/native arraycopy
rkennke
parents:
48824
diff
changeset
|
178 |
reinterpret_cast<jbyte*>(dst), |
bf2ff45e592f
8198445: Access API for primitive/native arraycopy
rkennke
parents:
48824
diff
changeset
|
179 |
length); |
bf2ff45e592f
8198445: Access API for primitive/native arraycopy
rkennke
parents:
48824
diff
changeset
|
180 |
} |
bf2ff45e592f
8198445: Access API for primitive/native arraycopy
rkennke
parents:
48824
diff
changeset
|
181 |
|
bf2ff45e592f
8198445: Access API for primitive/native arraycopy
rkennke
parents:
48824
diff
changeset
|
182 |
template<> |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
183 |
void arraycopy_conjoint_atomic<jbyte>(jbyte* src, jbyte* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
184 |
Copy::conjoint_jbytes_atomic(src, dst, length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
185 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
186 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
187 |
template<> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
188 |
void arraycopy_conjoint_atomic<jshort>(jshort* src, jshort* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
189 |
Copy::conjoint_jshorts_atomic(src, dst, length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
190 |
} |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
191 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
192 |
template<> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
193 |
void arraycopy_conjoint_atomic<jint>(jint* src, jint* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
194 |
Copy::conjoint_jints_atomic(src, dst, length); |
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 |
|
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
197 |
template<> |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
198 |
void arraycopy_conjoint_atomic<jlong>(jlong* src, jlong* dst, size_t length) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
199 |
Copy::conjoint_jlongs_atomic(src, dst, length); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
200 |
} |
49383
bf2ff45e592f
8198445: Access API for primitive/native arraycopy
rkennke
parents:
48824
diff
changeset
|
201 |
|
bf2ff45e592f
8198445: Access API for primitive/native arraycopy
rkennke
parents:
48824
diff
changeset
|
202 |
template<> |
bf2ff45e592f
8198445: Access API for primitive/native arraycopy
rkennke
parents:
48824
diff
changeset
|
203 |
void arraycopy_conjoint_atomic<void>(void* src, void* dst, size_t length) { |
bf2ff45e592f
8198445: Access API for primitive/native arraycopy
rkennke
parents:
48824
diff
changeset
|
204 |
Copy::conjoint_memory_atomic(src, dst, length); |
bf2ff45e592f
8198445: Access API for primitive/native arraycopy
rkennke
parents:
48824
diff
changeset
|
205 |
} |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
diff
changeset
|
206 |
} |