author | erikj |
Fri, 05 Oct 2018 09:59:30 -0700 | |
branch | ihse-runtestprebuilt-branch |
changeset 56931 | aff106ae3507 |
parent 48951 | 950c35ea6237 |
child 53244 | 9807daeb47c4 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
48951 | 2 |
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef OS_CPU_SOLARIS_X86_VM_COPY_SOLARIS_X86_INLINE_HPP |
26 |
#define OS_CPU_SOLARIS_X86_VM_COPY_SOLARIS_X86_INLINE_HPP |
|
27 |
||
48951 | 28 |
static void pd_conjoint_words(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 29 |
(void)memmove(to, from, count * HeapWordSize); |
30 |
} |
|
31 |
||
48951 | 32 |
static void pd_disjoint_words(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 33 |
#ifndef AMD64 |
34 |
(void)memcpy(to, from, count * HeapWordSize); |
|
35 |
#else |
|
36 |
switch (count) { |
|
37 |
case 8: to[7] = from[7]; |
|
38 |
case 7: to[6] = from[6]; |
|
39 |
case 6: to[5] = from[5]; |
|
40 |
case 5: to[4] = from[4]; |
|
41 |
case 4: to[3] = from[3]; |
|
42 |
case 3: to[2] = from[2]; |
|
43 |
case 2: to[1] = from[1]; |
|
44 |
case 1: to[0] = from[0]; |
|
45 |
case 0: break; |
|
46 |
default: |
|
47 |
(void)memcpy(to, from, count * HeapWordSize); |
|
48 |
break; |
|
49 |
} |
|
50 |
#endif // AMD64 |
|
51 |
} |
|
52 |
||
48951 | 53 |
static void pd_disjoint_words_atomic(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 54 |
switch (count) { |
55 |
case 8: to[7] = from[7]; |
|
56 |
case 7: to[6] = from[6]; |
|
57 |
case 6: to[5] = from[5]; |
|
58 |
case 5: to[4] = from[4]; |
|
59 |
case 4: to[3] = from[3]; |
|
60 |
case 3: to[2] = from[2]; |
|
61 |
case 2: to[1] = from[1]; |
|
62 |
case 1: to[0] = from[0]; |
|
63 |
case 0: break; |
|
64 |
default: while (count-- > 0) { |
|
65 |
*to++ = *from++; |
|
66 |
} |
|
67 |
break; |
|
68 |
} |
|
69 |
} |
|
70 |
||
48951 | 71 |
static void pd_aligned_conjoint_words(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 72 |
(void)memmove(to, from, count * HeapWordSize); |
73 |
} |
|
74 |
||
48951 | 75 |
static void pd_aligned_disjoint_words(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 76 |
pd_disjoint_words(from, to, count); |
77 |
} |
|
78 |
||
48951 | 79 |
static void pd_conjoint_bytes(const void* from, void* to, size_t count) { |
1 | 80 |
#ifdef AMD64 |
81 |
(void)memmove(to, from, count); |
|
82 |
#else |
|
83 |
_Copy_conjoint_bytes(from, to, count); |
|
84 |
#endif // AMD64 |
|
85 |
} |
|
86 |
||
48951 | 87 |
static void pd_conjoint_bytes_atomic(const void* from, void* to, size_t count) { |
1 | 88 |
pd_conjoint_bytes(from, to, count); |
89 |
} |
|
90 |
||
48951 | 91 |
static void pd_conjoint_jshorts_atomic(const jshort* from, jshort* to, size_t count) { |
1 | 92 |
_Copy_conjoint_jshorts_atomic(from, to, count); |
93 |
} |
|
94 |
||
48951 | 95 |
static void pd_conjoint_jints_atomic(const jint* from, jint* to, size_t count) { |
1 | 96 |
_Copy_conjoint_jints_atomic(from, to, count); |
97 |
} |
|
98 |
||
48951 | 99 |
static void pd_conjoint_jlongs_atomic(const jlong* from, jlong* to, size_t count) { |
1 | 100 |
// Guarantee use of fild/fistp or xmm regs via some asm code, because compilers won't. |
101 |
_Copy_conjoint_jlongs_atomic(from, to, count); |
|
102 |
} |
|
103 |
||
48951 | 104 |
static void pd_conjoint_oops_atomic(const oop* from, oop* to, size_t count) { |
1 | 105 |
#ifdef AMD64 |
106 |
assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size"); |
|
48951 | 107 |
_Copy_conjoint_jlongs_atomic((const jlong*)from, (jlong*)to, count); |
1 | 108 |
#else |
48951 | 109 |
_Copy_conjoint_jints_atomic((const jint*)from, (jint*)to, count); |
1 | 110 |
#endif // AMD64 |
111 |
} |
|
112 |
||
48951 | 113 |
static void pd_arrayof_conjoint_bytes(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 114 |
_Copy_arrayof_conjoint_bytes(from, to, count); |
115 |
} |
|
116 |
||
48951 | 117 |
static void pd_arrayof_conjoint_jshorts(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 118 |
_Copy_arrayof_conjoint_jshorts(from, to, count); |
119 |
} |
|
120 |
||
48951 | 121 |
static void pd_arrayof_conjoint_jints(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 122 |
_Copy_arrayof_conjoint_jints(from, to, count); |
123 |
} |
|
124 |
||
48951 | 125 |
static void pd_arrayof_conjoint_jlongs(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 126 |
#ifdef AMD64 |
127 |
_Copy_arrayof_conjoint_jlongs(from, to, count); |
|
128 |
#else |
|
48951 | 129 |
pd_conjoint_jlongs_atomic((const jlong*)from, (jlong*)to, count); |
1 | 130 |
#endif // AMD64 |
131 |
} |
|
132 |
||
48951 | 133 |
static void pd_arrayof_conjoint_oops(const HeapWord* from, HeapWord* to, size_t count) { |
1 | 134 |
#ifdef AMD64 |
135 |
assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size"); |
|
136 |
_Copy_arrayof_conjoint_jlongs(from, to, count); |
|
137 |
#else |
|
138 |
assert(BytesPerInt == BytesPerOop, "jints and oops must be the same size"); |
|
139 |
_Copy_arrayof_conjoint_jints(from, to, count); |
|
140 |
#endif // AMD64 |
|
141 |
} |
|
7397 | 142 |
|
143 |
#endif // OS_CPU_SOLARIS_X86_VM_COPY_SOLARIS_X86_INLINE_HPP |