29182
|
1 |
/*
|
|
2 |
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
|
3 |
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
|
4 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
5 |
*
|
|
6 |
* This code is free software; you can redistribute it and/or modify it
|
|
7 |
* under the terms of the GNU General Public License version 2 only, as
|
|
8 |
* published by the Free Software Foundation.
|
|
9 |
*
|
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
14 |
* accompanied this code).
|
|
15 |
*
|
|
16 |
* You should have received a copy of the GNU General Public License version
|
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
19 |
*
|
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
21 |
* or visit www.oracle.com if you need additional information or have any
|
|
22 |
* questions.
|
|
23 |
*
|
|
24 |
*/
|
|
25 |
|
|
26 |
#ifndef OS_CPU_LINUX_AARCH64_VM_COPY_LINUX_AARCH64_INLINE_HPP
|
|
27 |
#define OS_CPU_LINUX_AARCH64_VM_COPY_LINUX_AARCH64_INLINE_HPP
|
|
28 |
|
|
29 |
static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
|
|
30 |
(void)memmove(to, from, count * HeapWordSize);
|
|
31 |
}
|
|
32 |
|
|
33 |
static void pd_disjoint_words(HeapWord* from, HeapWord* to, size_t count) {
|
|
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 |
}
|
|
48 |
}
|
|
49 |
|
|
50 |
static void pd_disjoint_words_atomic(HeapWord* from, HeapWord* to, size_t count) {
|
|
51 |
switch (count) {
|
|
52 |
case 8: to[7] = from[7];
|
|
53 |
case 7: to[6] = from[6];
|
|
54 |
case 6: to[5] = from[5];
|
|
55 |
case 5: to[4] = from[4];
|
|
56 |
case 4: to[3] = from[3];
|
|
57 |
case 3: to[2] = from[2];
|
|
58 |
case 2: to[1] = from[1];
|
|
59 |
case 1: to[0] = from[0];
|
|
60 |
case 0: break;
|
|
61 |
default:
|
|
62 |
while (count-- > 0) {
|
|
63 |
*to++ = *from++;
|
|
64 |
}
|
|
65 |
break;
|
|
66 |
}
|
|
67 |
}
|
|
68 |
|
|
69 |
static void pd_aligned_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
|
|
70 |
pd_conjoint_words(from, to, count);
|
|
71 |
}
|
|
72 |
|
|
73 |
static void pd_aligned_disjoint_words(HeapWord* from, HeapWord* to, size_t count) {
|
|
74 |
pd_disjoint_words(from, to, count);
|
|
75 |
}
|
|
76 |
|
|
77 |
static void pd_conjoint_bytes(void* from, void* to, size_t count) {
|
|
78 |
(void)memmove(to, from, count);
|
|
79 |
}
|
|
80 |
|
|
81 |
static void pd_conjoint_bytes_atomic(void* from, void* to, size_t count) {
|
|
82 |
pd_conjoint_bytes(from, to, count);
|
|
83 |
}
|
|
84 |
|
|
85 |
static void pd_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) {
|
|
86 |
_Copy_conjoint_jshorts_atomic(from, to, count);
|
|
87 |
}
|
|
88 |
|
|
89 |
static void pd_conjoint_jints_atomic(jint* from, jint* to, size_t count) {
|
|
90 |
_Copy_conjoint_jints_atomic(from, to, count);
|
|
91 |
}
|
|
92 |
|
|
93 |
static void pd_conjoint_jlongs_atomic(jlong* from, jlong* to, size_t count) {
|
|
94 |
_Copy_conjoint_jlongs_atomic(from, to, count);
|
|
95 |
}
|
|
96 |
|
|
97 |
static void pd_conjoint_oops_atomic(oop* from, oop* to, size_t count) {
|
|
98 |
assert(!UseCompressedOops, "foo!");
|
|
99 |
assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size");
|
|
100 |
_Copy_conjoint_jlongs_atomic((jlong*)from, (jlong*)to, count);
|
|
101 |
}
|
|
102 |
|
|
103 |
static void pd_arrayof_conjoint_bytes(HeapWord* from, HeapWord* to, size_t count) {
|
|
104 |
_Copy_arrayof_conjoint_bytes(from, to, count);
|
|
105 |
}
|
|
106 |
|
|
107 |
static void pd_arrayof_conjoint_jshorts(HeapWord* from, HeapWord* to, size_t count) {
|
|
108 |
_Copy_arrayof_conjoint_jshorts(from, to, count);
|
|
109 |
}
|
|
110 |
|
|
111 |
static void pd_arrayof_conjoint_jints(HeapWord* from, HeapWord* to, size_t count) {
|
|
112 |
_Copy_arrayof_conjoint_jints(from, to, count);
|
|
113 |
}
|
|
114 |
|
|
115 |
static void pd_arrayof_conjoint_jlongs(HeapWord* from, HeapWord* to, size_t count) {
|
|
116 |
_Copy_arrayof_conjoint_jlongs(from, to, count);
|
|
117 |
}
|
|
118 |
|
|
119 |
static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) {
|
|
120 |
assert(!UseCompressedOops, "foo!");
|
|
121 |
assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size");
|
|
122 |
_Copy_arrayof_conjoint_jlongs(from, to, count);
|
|
123 |
}
|
|
124 |
|
|
125 |
#endif // OS_CPU_LINUX_AARCH64_VM_COPY_LINUX_AARCH64_INLINE_HPP
|