src/share/vm/utilities/copy.hpp

changeset 6876
710a3c8b516e
parent 2708
1d1603768966
parent 1
2d8a650513c2
child 9572
624a0741915c
     1.1 --- a/src/share/vm/utilities/copy.hpp	Mon Sep 08 12:35:01 2014 -0700
     1.2 +++ b/src/share/vm/utilities/copy.hpp	Tue Aug 08 15:57:29 2017 +0800
     1.3 @@ -22,6 +22,12 @@
     1.4   *
     1.5   */
     1.6  
     1.7 +/*
     1.8 + * This file has been modified by Loongson Technology in 2015. These
     1.9 + * modifications are Copyright (c) 2015 Loongson Technology, and are made
    1.10 + * available on the same license terms set forth above.
    1.11 + */
    1.12 +
    1.13  #ifndef SHARE_VM_UTILITIES_COPY_HPP
    1.14  #define SHARE_VM_UTILITIES_COPY_HPP
    1.15  
    1.16 @@ -321,6 +327,27 @@
    1.17  #endif
    1.18    }
    1.19  
    1.20 +
    1.21 + // SAPJVM AS 2011-09-20. Template for atomic copy.
    1.22 +  template <class T> static void copy_conjoint_atomic(T* from, T* to, size_t count)
    1.23 +  {
    1.24 +    if (from > to) {
    1.25 +      while (count-- > 0) {
    1.26 +        // Copy forwards
    1.27 +        *to++ = *from++;
    1.28 +      }
    1.29 +    } else {
    1.30 +      from += count - 1;
    1.31 +      to   += count - 1;
    1.32 +      while (count-- > 0) {
    1.33 +        // Copy backwards
    1.34 +        *to-- = *from--;
    1.35 +      }
    1.36 +    }
    1.37 +  }
    1.38 +
    1.39 +
    1.40 +
    1.41    // Platform dependent implementations of the above methods.
    1.42  #ifdef TARGET_ARCH_x86
    1.43  # include "copy_x86.hpp"
    1.44 @@ -337,6 +364,10 @@
    1.45  #ifdef TARGET_ARCH_ppc
    1.46  # include "copy_ppc.hpp"
    1.47  #endif
    1.48 +#ifdef TARGET_ARCH_mips
    1.49 +# include "copy_mips.hpp"
    1.50 +#endif
    1.51 +
    1.52  
    1.53  };
    1.54  

mercurial