src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp

Print this page


   1 /*
   2  * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
   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  *
  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
  21  * questions.
  22  *
  23  */
  24 



  25 static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
  26   (void)memmove(to, from, count * HeapWordSize);
  27 }
  28 
  29 static void pd_disjoint_words(HeapWord* from, HeapWord* to, size_t count) {
  30 #ifdef AMD64
  31   switch (count) {
  32   case 8:  to[7] = from[7];
  33   case 7:  to[6] = from[6];
  34   case 6:  to[5] = from[5];
  35   case 5:  to[4] = from[4];
  36   case 4:  to[3] = from[3];
  37   case 3:  to[2] = from[2];
  38   case 2:  to[1] = from[1];
  39   case 1:  to[0] = from[0];
  40   case 0:  break;
  41   default:
  42     (void)memcpy(to, from, count * HeapWordSize);
  43     break;
  44   }


 147 #else
 148   pd_conjoint_bytes(from, to, count);
 149 #endif // AMD64
 150 }
 151 
 152 static void pd_arrayof_conjoint_jshorts(HeapWord* from, HeapWord* to, size_t count) {
 153   pd_conjoint_jshorts_atomic((jshort*)from, (jshort*)to, count);
 154 }
 155 
 156 static void pd_arrayof_conjoint_jints(HeapWord* from, HeapWord* to, size_t count) {
 157   pd_conjoint_jints_atomic((jint*)from, (jint*)to, count);
 158 }
 159 
 160 static void pd_arrayof_conjoint_jlongs(HeapWord* from, HeapWord* to, size_t count) {
 161   pd_conjoint_jlongs_atomic((jlong*)from, (jlong*)to, count);
 162 }
 163 
 164 static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) {
 165   pd_conjoint_oops_atomic((oop*)from, (oop*)to, count);
 166 }


   1 /*
   2  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
   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  *
  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
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP
  26 #define OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP
  27 
  28 static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
  29   (void)memmove(to, from, count * HeapWordSize);
  30 }
  31 
  32 static void pd_disjoint_words(HeapWord* from, HeapWord* to, size_t count) {
  33 #ifdef AMD64
  34   switch (count) {
  35   case 8:  to[7] = from[7];
  36   case 7:  to[6] = from[6];
  37   case 6:  to[5] = from[5];
  38   case 5:  to[4] = from[4];
  39   case 4:  to[3] = from[3];
  40   case 3:  to[2] = from[2];
  41   case 2:  to[1] = from[1];
  42   case 1:  to[0] = from[0];
  43   case 0:  break;
  44   default:
  45     (void)memcpy(to, from, count * HeapWordSize);
  46     break;
  47   }


 150 #else
 151   pd_conjoint_bytes(from, to, count);
 152 #endif // AMD64
 153 }
 154 
 155 static void pd_arrayof_conjoint_jshorts(HeapWord* from, HeapWord* to, size_t count) {
 156   pd_conjoint_jshorts_atomic((jshort*)from, (jshort*)to, count);
 157 }
 158 
 159 static void pd_arrayof_conjoint_jints(HeapWord* from, HeapWord* to, size_t count) {
 160   pd_conjoint_jints_atomic((jint*)from, (jint*)to, count);
 161 }
 162 
 163 static void pd_arrayof_conjoint_jlongs(HeapWord* from, HeapWord* to, size_t count) {
 164   pd_conjoint_jlongs_atomic((jlong*)from, (jlong*)to, count);
 165 }
 166 
 167 static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) {
 168   pd_conjoint_oops_atomic((oop*)from, (oop*)to, count);
 169 }
 170 
 171 #endif // OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP