author | ihse |
Mon, 26 Nov 2018 14:18:22 +0100 | |
branch | ihse-manpages-branch |
changeset 57043 | 23d7457ca4c6 |
parent 49011 | a0e246b7403a |
child 53244 | 9807daeb47c4 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
48951 | 2 |
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
670
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
670
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
670
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef SHARE_VM_UTILITIES_COPY_HPP |
26 |
#define SHARE_VM_UTILITIES_COPY_HPP |
|
27 |
||
28 |
#include "runtime/stubRoutines.hpp" |
|
46625 | 29 |
#include "utilities/align.hpp" |
49011 | 30 |
#include "utilities/debug.hpp" |
40010 | 31 |
#include "utilities/macros.hpp" |
7397 | 32 |
|
1 | 33 |
// Assembly code for platforms that need it. |
34 |
extern "C" { |
|
48951 | 35 |
void _Copy_conjoint_words(const HeapWord* from, HeapWord* to, size_t count); |
36 |
void _Copy_disjoint_words(const HeapWord* from, HeapWord* to, size_t count); |
|
1 | 37 |
|
48951 | 38 |
void _Copy_conjoint_words_atomic(const HeapWord* from, HeapWord* to, size_t count); |
39 |
void _Copy_disjoint_words_atomic(const HeapWord* from, HeapWord* to, size_t count); |
|
1 | 40 |
|
48951 | 41 |
void _Copy_aligned_conjoint_words(const HeapWord* from, HeapWord* to, size_t count); |
42 |
void _Copy_aligned_disjoint_words(const HeapWord* from, HeapWord* to, size_t count); |
|
1 | 43 |
|
48951 | 44 |
void _Copy_conjoint_bytes(const void* from, void* to, size_t count); |
1 | 45 |
|
48951 | 46 |
void _Copy_conjoint_bytes_atomic (const void* from, void* to, size_t count); |
47 |
void _Copy_conjoint_jshorts_atomic(const jshort* from, jshort* to, size_t count); |
|
48 |
void _Copy_conjoint_jints_atomic (const jint* from, jint* to, size_t count); |
|
49 |
void _Copy_conjoint_jlongs_atomic (const jlong* from, jlong* to, size_t count); |
|
50 |
void _Copy_conjoint_oops_atomic (const oop* from, oop* to, size_t count); |
|
1 | 51 |
|
48951 | 52 |
void _Copy_arrayof_conjoint_bytes (const HeapWord* from, HeapWord* to, size_t count); |
53 |
void _Copy_arrayof_conjoint_jshorts(const HeapWord* from, HeapWord* to, size_t count); |
|
54 |
void _Copy_arrayof_conjoint_jints (const HeapWord* from, HeapWord* to, size_t count); |
|
55 |
void _Copy_arrayof_conjoint_jlongs (const HeapWord* from, HeapWord* to, size_t count); |
|
56 |
void _Copy_arrayof_conjoint_oops (const HeapWord* from, HeapWord* to, size_t count); |
|
1 | 57 |
} |
58 |
||
59 |
class Copy : AllStatic { |
|
60 |
public: |
|
61 |
// Block copy methods have four attributes. We don't define all possibilities. |
|
5694
1e0532a6abff
6916623: Align object to 16 bytes to use Compressed Oops with java heap up to 64Gb
kvn
parents:
670
diff
changeset
|
62 |
// alignment: aligned to BytesPerLong |
1 | 63 |
// arrayof: arraycopy operation with both operands aligned on the same |
64 |
// boundary as the first element of an array of the copy unit. |
|
65 |
// This is currently a HeapWord boundary on all platforms, except |
|
66 |
// for long and double arrays, which are aligned on an 8-byte |
|
67 |
// boundary on all platforms. |
|
68 |
// arraycopy operations are implicitly atomic on each array element. |
|
69 |
// overlap: disjoint or conjoint. |
|
70 |
// copy unit: bytes or words (i.e., HeapWords) or oops (i.e., pointers). |
|
71 |
// atomicity: atomic or non-atomic on the copy unit. |
|
72 |
// |
|
73 |
// Names are constructed thusly: |
|
74 |
// |
|
75 |
// [ 'aligned_' | 'arrayof_' ] |
|
76 |
// ('conjoint_' | 'disjoint_') |
|
77 |
// ('words' | 'bytes' | 'jshorts' | 'jints' | 'jlongs' | 'oops') |
|
78 |
// [ '_atomic' ] |
|
79 |
// |
|
80 |
// Except in the arrayof case, whatever the alignment is, we assume we can copy |
|
5694
1e0532a6abff
6916623: Align object to 16 bytes to use Compressed Oops with java heap up to 64Gb
kvn
parents:
670
diff
changeset
|
81 |
// whole alignment units. E.g., if BytesPerLong is 2x word alignment, an odd |
1 | 82 |
// count may copy an extra word. In the arrayof case, we are allowed to copy |
83 |
// only the number of copy units specified. |
|
5883
8dc4bdc132d5
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
5702
diff
changeset
|
84 |
// |
8dc4bdc132d5
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
5702
diff
changeset
|
85 |
// All callees check count for 0. |
8dc4bdc132d5
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
5702
diff
changeset
|
86 |
// |
1 | 87 |
|
88 |
// HeapWords |
|
89 |
||
90 |
// Word-aligned words, conjoint, not atomic on each word |
|
48951 | 91 |
static void conjoint_words(const HeapWord* from, HeapWord* to, size_t count) { |
49011 | 92 |
assert_params_ok(from, to, HeapWordSize); |
1 | 93 |
pd_conjoint_words(from, to, count); |
94 |
} |
|
95 |
||
96 |
// Word-aligned words, disjoint, not atomic on each word |
|
48951 | 97 |
static void disjoint_words(const HeapWord* from, HeapWord* to, size_t count) { |
49011 | 98 |
assert_params_ok(from, to, HeapWordSize); |
1 | 99 |
assert_disjoint(from, to, count); |
100 |
pd_disjoint_words(from, to, count); |
|
101 |
} |
|
102 |
||
103 |
// Word-aligned words, disjoint, atomic on each word |
|
48951 | 104 |
static void disjoint_words_atomic(const HeapWord* from, HeapWord* to, size_t count) { |
49011 | 105 |
assert_params_ok(from, to, HeapWordSize); |
1 | 106 |
assert_disjoint(from, to, count); |
107 |
pd_disjoint_words_atomic(from, to, count); |
|
108 |
} |
|
109 |
||
110 |
// Object-aligned words, conjoint, not atomic on each word |
|
48951 | 111 |
static void aligned_conjoint_words(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 112 |
assert_params_aligned(from, to); |
113 |
pd_aligned_conjoint_words(from, to, count); |
|
114 |
} |
|
115 |
||
116 |
// Object-aligned words, disjoint, not atomic on each word |
|
48951 | 117 |
static void aligned_disjoint_words(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 118 |
assert_params_aligned(from, to); |
119 |
assert_disjoint(from, to, count); |
|
120 |
pd_aligned_disjoint_words(from, to, count); |
|
121 |
} |
|
122 |
||
123 |
// bytes, jshorts, jints, jlongs, oops |
|
124 |
||
125 |
// bytes, conjoint, not atomic on each byte (not that it matters) |
|
48951 | 126 |
static void conjoint_jbytes(const void* from, void* to, size_t count) { |
1 | 127 |
pd_conjoint_bytes(from, to, count); |
128 |
} |
|
129 |
||
130 |
// bytes, conjoint, atomic on each byte (not that it matters) |
|
48951 | 131 |
static void conjoint_jbytes_atomic(const void* from, void* to, size_t count) { |
1 | 132 |
pd_conjoint_bytes(from, to, count); |
133 |
} |
|
134 |
||
135 |
// jshorts, conjoint, atomic on each jshort |
|
48951 | 136 |
static void conjoint_jshorts_atomic(const jshort* from, jshort* to, size_t count) { |
49011 | 137 |
assert_params_ok(from, to, BytesPerShort); |
1 | 138 |
pd_conjoint_jshorts_atomic(from, to, count); |
139 |
} |
|
140 |
||
141 |
// jints, conjoint, atomic on each jint |
|
48951 | 142 |
static void conjoint_jints_atomic(const jint* from, jint* to, size_t count) { |
49011 | 143 |
assert_params_ok(from, to, BytesPerInt); |
1 | 144 |
pd_conjoint_jints_atomic(from, to, count); |
145 |
} |
|
146 |
||
147 |
// jlongs, conjoint, atomic on each jlong |
|
48951 | 148 |
static void conjoint_jlongs_atomic(const jlong* from, jlong* to, size_t count) { |
49011 | 149 |
assert_params_ok(from, to, BytesPerLong); |
1 | 150 |
pd_conjoint_jlongs_atomic(from, to, count); |
151 |
} |
|
152 |
||
153 |
// oops, conjoint, atomic on each oop |
|
48951 | 154 |
static void conjoint_oops_atomic(const oop* from, oop* to, size_t count) { |
49011 | 155 |
assert_params_ok(from, to, BytesPerHeapOop); |
1 | 156 |
pd_conjoint_oops_atomic(from, to, count); |
157 |
} |
|
158 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
159 |
// overloaded for UseCompressedOops |
48951 | 160 |
static void conjoint_oops_atomic(const narrowOop* from, narrowOop* to, size_t count) { |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
161 |
assert(sizeof(narrowOop) == sizeof(jint), "this cast is wrong"); |
49011 | 162 |
assert_params_ok(from, to, BytesPerInt); |
48951 | 163 |
pd_conjoint_jints_atomic((const jint*)from, (jint*)to, count); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
164 |
} |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
165 |
|
1 | 166 |
// Copy a span of memory. If the span is an integral number of aligned |
167 |
// longs, words, or ints, copy those units atomically. |
|
168 |
// The largest atomic transfer unit is 8 bytes, or the largest power |
|
169 |
// of two which divides all of from, to, and size, whichever is smaller. |
|
48951 | 170 |
static void conjoint_memory_atomic(const void* from, void* to, size_t size); |
1 | 171 |
|
172 |
// bytes, conjoint array, atomic on each byte (not that it matters) |
|
48951 | 173 |
static void arrayof_conjoint_jbytes(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 174 |
pd_arrayof_conjoint_bytes(from, to, count); |
175 |
} |
|
176 |
||
177 |
// jshorts, conjoint array, atomic on each jshort |
|
48951 | 178 |
static void arrayof_conjoint_jshorts(const HeapWord* from, HeapWord* to, size_t count) { |
49011 | 179 |
assert_params_ok(from, to, BytesPerShort); |
1 | 180 |
pd_arrayof_conjoint_jshorts(from, to, count); |
181 |
} |
|
182 |
||
183 |
// jints, conjoint array, atomic on each jint |
|
48951 | 184 |
static void arrayof_conjoint_jints(const HeapWord* from, HeapWord* to, size_t count) { |
49011 | 185 |
assert_params_ok(from, to, BytesPerInt); |
1 | 186 |
pd_arrayof_conjoint_jints(from, to, count); |
187 |
} |
|
188 |
||
189 |
// jlongs, conjoint array, atomic on each jlong |
|
48951 | 190 |
static void arrayof_conjoint_jlongs(const HeapWord* from, HeapWord* to, size_t count) { |
49011 | 191 |
assert_params_ok(from, to, BytesPerLong); |
1 | 192 |
pd_arrayof_conjoint_jlongs(from, to, count); |
193 |
} |
|
194 |
||
195 |
// oops, conjoint array, atomic on each oop |
|
48951 | 196 |
static void arrayof_conjoint_oops(const HeapWord* from, HeapWord* to, size_t count) { |
49011 | 197 |
assert_params_ok(from, to, BytesPerHeapOop); |
1 | 198 |
pd_arrayof_conjoint_oops(from, to, count); |
199 |
} |
|
200 |
||
201 |
// Known overlap methods |
|
202 |
||
203 |
// Copy word-aligned words from higher to lower addresses, not atomic on each word |
|
48951 | 204 |
inline static void conjoint_words_to_lower(const HeapWord* from, HeapWord* to, size_t byte_count) { |
1 | 205 |
// byte_count is in bytes to check its alignment |
49011 | 206 |
assert_params_ok(from, to, HeapWordSize); |
1 | 207 |
assert_byte_count_ok(byte_count, HeapWordSize); |
208 |
||
46620
750c6edff33b
8178500: Replace usages of round_to and round_down with align_up and align_down
stefank
parents:
46504
diff
changeset
|
209 |
size_t count = align_up(byte_count, HeapWordSize) >> LogHeapWordSize; |
1 | 210 |
assert(to <= from || from + count <= to, "do not overwrite source data"); |
211 |
||
212 |
while (count-- > 0) { |
|
213 |
*to++ = *from++; |
|
214 |
} |
|
215 |
} |
|
216 |
||
217 |
// Copy word-aligned words from lower to higher addresses, not atomic on each word |
|
48951 | 218 |
inline static void conjoint_words_to_higher(const HeapWord* from, HeapWord* to, size_t byte_count) { |
1 | 219 |
// byte_count is in bytes to check its alignment |
49011 | 220 |
assert_params_ok(from, to, HeapWordSize); |
1 | 221 |
assert_byte_count_ok(byte_count, HeapWordSize); |
222 |
||
46620
750c6edff33b
8178500: Replace usages of round_to and round_down with align_up and align_down
stefank
parents:
46504
diff
changeset
|
223 |
size_t count = align_up(byte_count, HeapWordSize) >> LogHeapWordSize; |
1 | 224 |
assert(from <= to || to + count <= from, "do not overwrite source data"); |
225 |
||
226 |
from += count - 1; |
|
227 |
to += count - 1; |
|
228 |
while (count-- > 0) { |
|
229 |
*to-- = *from--; |
|
230 |
} |
|
231 |
} |
|
232 |
||
36086 | 233 |
/** |
46504
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
234 |
* Copy elements |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
235 |
* |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
236 |
* @param src address of source |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
237 |
* @param dst address of destination |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
238 |
* @param byte_count number of bytes to copy |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
239 |
* @param elem_size size of the elements to copy-swap |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
240 |
*/ |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
241 |
static void conjoint_copy(const void* src, void* dst, size_t byte_count, size_t elem_size); |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
242 |
|
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
243 |
/** |
36086 | 244 |
* Copy and *unconditionally* byte swap elements |
245 |
* |
|
246 |
* @param src address of source |
|
247 |
* @param dst address of destination |
|
248 |
* @param byte_count number of bytes to copy |
|
249 |
* @param elem_size size of the elements to copy-swap |
|
250 |
*/ |
|
46504
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
251 |
static void conjoint_swap(const void* src, void* dst, size_t byte_count, size_t elem_size); |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
252 |
|
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
253 |
/** |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
254 |
* Copy and byte swap elements from the specified endian to the native (cpu) endian if needed (if they differ) |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
255 |
* |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
256 |
* @param src address of source |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
257 |
* @param dst address of destination |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
258 |
* @param byte_count number of bytes to copy |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
259 |
* @param elem_size size of the elements to copy-swap |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
260 |
*/ |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
261 |
template <Endian::Order endian> |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
262 |
static void conjoint_swap_if_needed(const void* src, void* dst, size_t byte_count, size_t elem_size) { |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
263 |
if (Endian::NATIVE != endian) { |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
264 |
conjoint_swap(src, dst, byte_count, elem_size); |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
265 |
} else { |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
266 |
conjoint_copy(src, dst, byte_count, elem_size); |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
267 |
} |
38048d4d20e7
8180032: Unaligned pointer dereference in ClassFileParser
mikael
parents:
40010
diff
changeset
|
268 |
} |
36086 | 269 |
|
1 | 270 |
// Fill methods |
271 |
||
272 |
// Fill word-aligned words, not atomic on each word |
|
273 |
// set_words |
|
274 |
static void fill_to_words(HeapWord* to, size_t count, juint value = 0) { |
|
49011 | 275 |
assert_params_ok(to, HeapWordSize); |
1 | 276 |
pd_fill_to_words(to, count, value); |
277 |
} |
|
278 |
||
279 |
static void fill_to_aligned_words(HeapWord* to, size_t count, juint value = 0) { |
|
280 |
assert_params_aligned(to); |
|
281 |
pd_fill_to_aligned_words(to, count, value); |
|
282 |
} |
|
283 |
||
284 |
// Fill bytes |
|
285 |
static void fill_to_bytes(void* to, size_t count, jubyte value = 0) { |
|
286 |
pd_fill_to_bytes(to, count, value); |
|
287 |
} |
|
288 |
||
289 |
// Fill a span of memory. If the span is an integral number of aligned |
|
290 |
// longs, words, or ints, store to those units atomically. |
|
291 |
// The largest atomic transfer unit is 8 bytes, or the largest power |
|
292 |
// of two which divides both to and size, whichever is smaller. |
|
293 |
static void fill_to_memory_atomic(void* to, size_t size, jubyte value = 0); |
|
294 |
||
295 |
// Zero-fill methods |
|
296 |
||
297 |
// Zero word-aligned words, not atomic on each word |
|
298 |
static void zero_to_words(HeapWord* to, size_t count) { |
|
49011 | 299 |
assert_params_ok(to, HeapWordSize); |
1 | 300 |
pd_zero_to_words(to, count); |
301 |
} |
|
302 |
||
303 |
// Zero bytes |
|
304 |
static void zero_to_bytes(void* to, size_t count) { |
|
305 |
pd_zero_to_bytes(to, count); |
|
306 |
} |
|
307 |
||
308 |
private: |
|
48951 | 309 |
static bool params_disjoint(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 310 |
if (from < to) { |
311 |
return pointer_delta(to, from) >= count; |
|
312 |
} |
|
313 |
return pointer_delta(from, to) >= count; |
|
314 |
} |
|
315 |
||
316 |
// These methods raise a fatal if they detect a problem. |
|
317 |
||
48951 | 318 |
static void assert_disjoint(const HeapWord* from, HeapWord* to, size_t count) { |
49011 | 319 |
assert(params_disjoint(from, to, count), "source and dest overlap"); |
320 |
} |
|
321 |
||
322 |
static void assert_params_ok(const void* from, void* to, intptr_t alignment) { |
|
323 |
assert(is_aligned(from, alignment), "must be aligned: " INTPTR_FORMAT, p2i(from)); |
|
324 |
assert(is_aligned(to, alignment), "must be aligned: " INTPTR_FORMAT, p2i(to)); |
|
1 | 325 |
} |
326 |
||
49011 | 327 |
static void assert_params_ok(HeapWord* to, intptr_t alignment) { |
328 |
assert(is_aligned(to, alignment), "must be aligned: " INTPTR_FORMAT, p2i(to)); |
|
1 | 329 |
} |
330 |
||
48951 | 331 |
static void assert_params_aligned(const HeapWord* from, HeapWord* to) { |
49011 | 332 |
assert(is_aligned(from, BytesPerLong), "must be aligned: " INTPTR_FORMAT, p2i(from)); |
333 |
assert(is_aligned(to, BytesPerLong), "must be aligned: " INTPTR_FORMAT, p2i(to)); |
|
1 | 334 |
} |
335 |
||
336 |
static void assert_params_aligned(HeapWord* to) { |
|
49011 | 337 |
assert(is_aligned(to, BytesPerLong), "must be aligned: " INTPTR_FORMAT, p2i(to)); |
1 | 338 |
} |
339 |
||
340 |
static void assert_byte_count_ok(size_t byte_count, size_t unit_size) { |
|
49011 | 341 |
assert(is_aligned(byte_count, unit_size), "byte count must be aligned"); |
1 | 342 |
} |
343 |
||
344 |
// Platform dependent implementations of the above methods. |
|
40010 | 345 |
#include CPU_HEADER(copy) |
7397 | 346 |
|
1 | 347 |
}; |
7397 | 348 |
|
349 |
#endif // SHARE_VM_UTILITIES_COPY_HPP |