130 // pd_disjoint_words is word-atomic in this implementation. |
130 // pd_disjoint_words is word-atomic in this implementation. |
131 pd_disjoint_words(from, to, count); |
131 pd_disjoint_words(from, to, count); |
132 #endif // AMD64 |
132 #endif // AMD64 |
133 } |
133 } |
134 |
134 |
135 static void pd_aligned_conjoint_words(HeapWord* from, HeapWord* to, size_t count) { |
135 static void pd_aligned_conjoint_words(const HeapWord* from, HeapWord* to, size_t count) { |
136 pd_conjoint_words(from, to, count); |
136 pd_conjoint_words(from, to, count); |
137 } |
137 } |
138 |
138 |
139 static void pd_aligned_disjoint_words(HeapWord* from, HeapWord* to, size_t count) { |
139 static void pd_aligned_disjoint_words(const HeapWord* from, HeapWord* to, size_t count) { |
140 pd_disjoint_words(from, to, count); |
140 pd_disjoint_words(from, to, count); |
141 } |
141 } |
142 |
142 |
143 static void pd_conjoint_bytes(void* from, void* to, size_t count) { |
143 static void pd_conjoint_bytes(const void* from, void* to, size_t count) { |
144 #ifdef AMD64 |
144 #ifdef AMD64 |
145 (void)memmove(to, from, count); |
145 (void)memmove(to, from, count); |
146 #else |
146 #else |
147 // Includes a zero-count check. |
147 // Includes a zero-count check. |
148 intx temp = 0; |
148 intx temp = 0; |
217 : "0" (from), "1" (to), "2" (count), "3" (temp) |
217 : "0" (from), "1" (to), "2" (count), "3" (temp) |
218 : "memory", "flags", "%edx"); |
218 : "memory", "flags", "%edx"); |
219 #endif // AMD64 |
219 #endif // AMD64 |
220 } |
220 } |
221 |
221 |
222 static void pd_conjoint_bytes_atomic(void* from, void* to, size_t count) { |
222 static void pd_conjoint_bytes_atomic(const void* from, void* to, size_t count) { |
223 pd_conjoint_bytes(from, to, count); |
223 pd_conjoint_bytes(from, to, count); |
224 } |
224 } |
225 |
225 |
226 static void pd_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) { |
226 static void pd_conjoint_jshorts_atomic(const jshort* from, jshort* to, size_t count) { |
227 _Copy_conjoint_jshorts_atomic(from, to, count); |
227 _Copy_conjoint_jshorts_atomic(from, to, count); |
228 } |
228 } |
229 |
229 |
230 static void pd_conjoint_jints_atomic(jint* from, jint* to, size_t count) { |
230 static void pd_conjoint_jints_atomic(const jint* from, jint* to, size_t count) { |
231 #ifdef AMD64 |
231 #ifdef AMD64 |
232 _Copy_conjoint_jints_atomic(from, to, count); |
232 _Copy_conjoint_jints_atomic(from, to, count); |
233 #else |
233 #else |
234 assert(HeapWordSize == BytesPerInt, "heapwords and jints must be the same size"); |
234 assert(HeapWordSize == BytesPerInt, "heapwords and jints must be the same size"); |
235 // pd_conjoint_words is word-atomic in this implementation. |
235 // pd_conjoint_words is word-atomic in this implementation. |
236 pd_conjoint_words((HeapWord*)from, (HeapWord*)to, count); |
236 pd_conjoint_words((const HeapWord*)from, (HeapWord*)to, count); |
237 #endif // AMD64 |
237 #endif // AMD64 |
238 } |
238 } |
239 |
239 |
240 static void pd_conjoint_jlongs_atomic(jlong* from, jlong* to, size_t count) { |
240 static void pd_conjoint_jlongs_atomic(const jlong* from, jlong* to, size_t count) { |
241 #ifdef AMD64 |
241 #ifdef AMD64 |
242 _Copy_conjoint_jlongs_atomic(from, to, count); |
242 _Copy_conjoint_jlongs_atomic(from, to, count); |
243 #else |
243 #else |
244 // Guarantee use of fild/fistp or xmm regs via some asm code, because compilers won't. |
244 // Guarantee use of fild/fistp or xmm regs via some asm code, because compilers won't. |
245 if (from > to) { |
245 if (from > to) { |
260 } |
260 } |
261 } |
261 } |
262 #endif // AMD64 |
262 #endif // AMD64 |
263 } |
263 } |
264 |
264 |
265 static void pd_conjoint_oops_atomic(oop* from, oop* to, size_t count) { |
265 static void pd_conjoint_oops_atomic(const oop* from, oop* to, size_t count) { |
266 #ifdef AMD64 |
266 #ifdef AMD64 |
267 assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size"); |
267 assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size"); |
268 _Copy_conjoint_jlongs_atomic((jlong*)from, (jlong*)to, count); |
268 _Copy_conjoint_jlongs_atomic((const jlong*)from, (jlong*)to, count); |
269 #else |
269 #else |
270 assert(HeapWordSize == BytesPerOop, "heapwords and oops must be the same size"); |
270 assert(HeapWordSize == BytesPerOop, "heapwords and oops must be the same size"); |
271 // pd_conjoint_words is word-atomic in this implementation. |
271 // pd_conjoint_words is word-atomic in this implementation. |
272 pd_conjoint_words((HeapWord*)from, (HeapWord*)to, count); |
272 pd_conjoint_words((const HeapWord*)from, (HeapWord*)to, count); |
273 #endif // AMD64 |
273 #endif // AMD64 |
274 } |
274 } |
275 |
275 |
276 static void pd_arrayof_conjoint_bytes(HeapWord* from, HeapWord* to, size_t count) { |
276 static void pd_arrayof_conjoint_bytes(const HeapWord* from, HeapWord* to, size_t count) { |
277 _Copy_arrayof_conjoint_bytes(from, to, count); |
277 _Copy_arrayof_conjoint_bytes(from, to, count); |
278 } |
278 } |
279 |
279 |
280 static void pd_arrayof_conjoint_jshorts(HeapWord* from, HeapWord* to, size_t count) { |
280 static void pd_arrayof_conjoint_jshorts(const HeapWord* from, HeapWord* to, size_t count) { |
281 _Copy_arrayof_conjoint_jshorts(from, to, count); |
281 _Copy_arrayof_conjoint_jshorts(from, to, count); |
282 } |
282 } |
283 |
283 |
284 static void pd_arrayof_conjoint_jints(HeapWord* from, HeapWord* to, size_t count) { |
284 static void pd_arrayof_conjoint_jints(const HeapWord* from, HeapWord* to, size_t count) { |
285 #ifdef AMD64 |
285 #ifdef AMD64 |
286 _Copy_arrayof_conjoint_jints(from, to, count); |
286 _Copy_arrayof_conjoint_jints(from, to, count); |
287 #else |
287 #else |
288 pd_conjoint_jints_atomic((jint*)from, (jint*)to, count); |
288 pd_conjoint_jints_atomic((const jint*)from, (jint*)to, count); |
289 #endif // AMD64 |
289 #endif // AMD64 |
290 } |
290 } |
291 |
291 |
292 static void pd_arrayof_conjoint_jlongs(HeapWord* from, HeapWord* to, size_t count) { |
292 static void pd_arrayof_conjoint_jlongs(const HeapWord* from, HeapWord* to, size_t count) { |
293 #ifdef AMD64 |
293 #ifdef AMD64 |
294 _Copy_arrayof_conjoint_jlongs(from, to, count); |
294 _Copy_arrayof_conjoint_jlongs(from, to, count); |
295 #else |
295 #else |
296 pd_conjoint_jlongs_atomic((jlong*)from, (jlong*)to, count); |
296 pd_conjoint_jlongs_atomic((const jlong*)from, (jlong*)to, count); |
297 #endif // AMD64 |
297 #endif // AMD64 |
298 } |
298 } |
299 |
299 |
300 static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) { |
300 static void pd_arrayof_conjoint_oops(const HeapWord* from, HeapWord* to, size_t count) { |
301 #ifdef AMD64 |
301 #ifdef AMD64 |
302 assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size"); |
302 assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size"); |
303 _Copy_arrayof_conjoint_jlongs(from, to, count); |
303 _Copy_arrayof_conjoint_jlongs(from, to, count); |
304 #else |
304 #else |
305 pd_conjoint_oops_atomic((oop*)from, (oop*)to, count); |
305 pd_conjoint_oops_atomic((const oop*)from, (oop*)to, count); |
306 #endif // AMD64 |
306 #endif // AMD64 |
307 } |
307 } |
308 |
308 |
309 #endif // OS_CPU_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP |
309 #endif // OS_CPU_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP |