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_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP
26 #define OS_CPU_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP
27
28 static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
29 #ifdef AMD64
30 (void)memmove(to, from, count * HeapWordSize);
31 #else
32 // Includes a zero-count check.
33 intx temp;
34 __asm__ volatile(" testl %6,%6 ;"
35 " jz 7f ;"
36 " cmpl %4,%5 ;"
37 " leal -4(%4,%6,4),%3;"
38 " jbe 1f ;"
39 " cmpl %7,%5 ;"
40 " jbe 4f ;"
41 "1: cmpl $32,%6 ;"
42 " ja 3f ;"
43 " subl %4,%1 ;"
44 "2: movl (%4),%3 ;"
45 " movl %7,(%5,%4,1) ;"
46 " addl $4,%0 ;"
289 #endif // AMD64
290 }
291
292 static void pd_arrayof_conjoint_jlongs(HeapWord* from, HeapWord* to, size_t count) {
293 #ifdef AMD64
294 _Copy_arrayof_conjoint_jlongs(from, to, count);
295 #else
296 pd_conjoint_jlongs_atomic((jlong*)from, (jlong*)to, count);
297 #endif // AMD64
298 }
299
300 static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) {
301 #ifdef AMD64
302 assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size");
303 _Copy_arrayof_conjoint_jlongs(from, to, count);
304 #else
305 pd_conjoint_oops_atomic((oop*)from, (oop*)to, count);
306 #endif // AMD64
307 }
308
309 #endif // OS_CPU_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP
|
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_BSD_X86_VM_COPY_BSD_X86_INLINE_HPP
26 #define OS_CPU_BSD_X86_VM_COPY_BSD_X86_INLINE_HPP
27
28 static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
29 #ifdef AMD64
30 (void)memmove(to, from, count * HeapWordSize);
31 #else
32 // Includes a zero-count check.
33 intx temp;
34 __asm__ volatile(" testl %6,%6 ;"
35 " jz 7f ;"
36 " cmpl %4,%5 ;"
37 " leal -4(%4,%6,4),%3;"
38 " jbe 1f ;"
39 " cmpl %7,%5 ;"
40 " jbe 4f ;"
41 "1: cmpl $32,%6 ;"
42 " ja 3f ;"
43 " subl %4,%1 ;"
44 "2: movl (%4),%3 ;"
45 " movl %7,(%5,%4,1) ;"
46 " addl $4,%0 ;"
289 #endif // AMD64
290 }
291
292 static void pd_arrayof_conjoint_jlongs(HeapWord* from, HeapWord* to, size_t count) {
293 #ifdef AMD64
294 _Copy_arrayof_conjoint_jlongs(from, to, count);
295 #else
296 pd_conjoint_jlongs_atomic((jlong*)from, (jlong*)to, count);
297 #endif // AMD64
298 }
299
300 static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) {
301 #ifdef AMD64
302 assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size");
303 _Copy_arrayof_conjoint_jlongs(from, to, count);
304 #else
305 pd_conjoint_oops_atomic((oop*)from, (oop*)to, count);
306 #endif // AMD64
307 }
308
309 #endif // OS_CPU_BSD_X86_VM_COPY_BSD_X86_INLINE_HPP
|