src/share/vm/utilities/copy.hpp

changeset 6876
710a3c8b516e
parent 2708
1d1603768966
parent 1
2d8a650513c2
child 9572
624a0741915c
equal deleted inserted replaced
6875:28b50d07f6f8 6876:710a3c8b516e
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
335 # include "copy_arm.hpp" 362 # include "copy_arm.hpp"
336 #endif 363 #endif
337 #ifdef TARGET_ARCH_ppc 364 #ifdef TARGET_ARCH_ppc
338 # include "copy_ppc.hpp" 365 # include "copy_ppc.hpp"
339 #endif 366 #endif
367 #ifdef TARGET_ARCH_mips
368 # include "copy_mips.hpp"
369 #endif
370
340 371
341 }; 372 };
342 373
343 #endif // SHARE_VM_UTILITIES_COPY_HPP 374 #endif // SHARE_VM_UTILITIES_COPY_HPP

mercurial