18 * |
18 * |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 * or visit www.oracle.com if you need additional information or have any |
20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. |
21 * questions. |
22 * |
22 * |
|
23 */ |
|
24 |
|
25 /* |
|
26 * This file has been modified by Loongson Technology in 2015. These |
|
27 * modifications are Copyright (c) 2015 Loongson Technology, and are made |
|
28 * available on the same license terms set forth above. |
23 */ |
29 */ |
24 |
30 |
25 #ifndef SHARE_VM_UTILITIES_COPY_HPP |
31 #ifndef SHARE_VM_UTILITIES_COPY_HPP |
26 #define SHARE_VM_UTILITIES_COPY_HPP |
32 #define SHARE_VM_UTILITIES_COPY_HPP |
27 |
33 |
319 basic_fatal("byte count must be aligned"); |
325 basic_fatal("byte count must be aligned"); |
320 } |
326 } |
321 #endif |
327 #endif |
322 } |
328 } |
323 |
329 |
|
330 |
|
331 // SAPJVM AS 2011-09-20. Template for atomic copy. |
|
332 template <class T> static void copy_conjoint_atomic(T* from, T* to, size_t count) |
|
333 { |
|
334 if (from > to) { |
|
335 while (count-- > 0) { |
|
336 // Copy forwards |
|
337 *to++ = *from++; |
|
338 } |
|
339 } else { |
|
340 from += count - 1; |
|
341 to += count - 1; |
|
342 while (count-- > 0) { |
|
343 // Copy backwards |
|
344 *to-- = *from--; |
|
345 } |
|
346 } |
|
347 } |
|
348 |
|
349 |
|
350 |
324 // Platform dependent implementations of the above methods. |
351 // Platform dependent implementations of the above methods. |
325 #ifdef TARGET_ARCH_x86 |
352 #ifdef TARGET_ARCH_x86 |
326 # include "copy_x86.hpp" |
353 # include "copy_x86.hpp" |
327 #endif |
354 #endif |
328 #ifdef TARGET_ARCH_sparc |
355 #ifdef TARGET_ARCH_sparc |