author | ysr |
Tue, 16 Aug 2011 08:02:29 -0700 | |
changeset 10244 | dae1b1e51fca |
parent 7662 | 5f31baaff55b |
child 11417 | 4ecc3253bec4 |
permissions | -rw-r--r-- |
1 | 1 |
// |
7662
5f31baaff55b
7010068: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - first pass
trims
parents:
5547
diff
changeset
|
2 |
// Copyright (c) 2004, 2010, 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:
5542
diff
changeset
|
19 |
// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5542
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:
5542
diff
changeset
|
21 |
// questions. |
1 | 22 |
// |
23 |
// |
|
24 |
||
25 |
// The argument size of each inline directive is ignored by the compiler |
|
26 |
// and is set to the number of arguments as documentation. |
|
27 |
||
28 |
// Get the raw thread ID from %gs:0 |
|
29 |
.inline _raw_thread_id,0 |
|
30 |
movq %fs:0, %rax |
|
31 |
.end |
|
32 |
||
1659
b9a3819ac7c6
6773838: There is no calling stack for Compiler thread in hs_err file on x86
coleenp
parents:
1
diff
changeset
|
33 |
// Get the frame pointer from current frame. |
b9a3819ac7c6
6773838: There is no calling stack for Compiler thread in hs_err file on x86
coleenp
parents:
1
diff
changeset
|
34 |
.inline _get_current_fp,0 |
b9a3819ac7c6
6773838: There is no calling stack for Compiler thread in hs_err file on x86
coleenp
parents:
1
diff
changeset
|
35 |
.volatile |
1 | 36 |
movq %rbp, %rax |
37 |
.end |
|
38 |
||
39 |
// Support for jint Atomic::add(jint add_value, volatile jint* dest) |
|
5542
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
2105
diff
changeset
|
40 |
.inline _Atomic_add,2 |
1 | 41 |
movl %edi, %eax // save add_value for return |
42 |
lock |
|
5542
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
2105
diff
changeset
|
43 |
xaddl %edi, (%rsi) |
1 | 44 |
addl %edi, %eax |
45 |
.end |
|
46 |
||
47 |
// Support for jlong Atomic::add(jlong add_value, volatile jlong* dest) |
|
5542
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
2105
diff
changeset
|
48 |
.inline _Atomic_add_long,2 |
1 | 49 |
movq %rdi, %rax // save add_value for return |
50 |
lock |
|
5542
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
2105
diff
changeset
|
51 |
xaddq %rdi, (%rsi) |
1 | 52 |
addq %rdi, %rax |
53 |
.end |
|
54 |
||
55 |
// Support for jint Atomic::xchg(jint exchange_value, volatile jint* dest). |
|
56 |
.inline _Atomic_xchg,2 |
|
57 |
xchgl (%rsi), %edi |
|
58 |
movl %edi, %eax |
|
59 |
.end |
|
60 |
||
61 |
// Support for jlong Atomic::xchg(jlong exchange_value, volatile jlong* dest). |
|
62 |
.inline _Atomic_xchg_long,2 |
|
63 |
xchgq (%rsi), %rdi |
|
64 |
movq %rdi, %rax |
|
65 |
.end |
|
66 |
||
67 |
// Support for jint Atomic::cmpxchg(jint exchange_value, |
|
68 |
// volatile jint *dest, |
|
69 |
// jint compare_value) |
|
5542
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
2105
diff
changeset
|
70 |
.inline _Atomic_cmpxchg,3 |
1 | 71 |
movl %edx, %eax // compare_value |
72 |
lock |
|
5542
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
2105
diff
changeset
|
73 |
cmpxchgl %edi, (%rsi) |
1 | 74 |
.end |
75 |
||
76 |
// Support for jlong Atomic::cmpxchg(jlong exchange_value, |
|
77 |
// volatile jlong* dest, |
|
78 |
// jlong compare_value) |
|
5542
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
2105
diff
changeset
|
79 |
.inline _Atomic_cmpxchg_long,3 |
1 | 80 |
movq %rdx, %rax // compare_value |
81 |
lock |
|
5542
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
2105
diff
changeset
|
82 |
cmpxchgq %rdi, (%rsi) |
1 | 83 |
.end |
84 |
||
85 |
// Support for OrderAccess::acquire() |
|
86 |
.inline _OrderAccess_acquire,0 |
|
87 |
movl 0(%rsp), %eax |
|
88 |
.end |
|
89 |
||
90 |
// Support for OrderAccess::fence() |
|
91 |
.inline _OrderAccess_fence,0 |
|
92 |
lock |
|
93 |
addl $0, (%rsp) |
|
94 |
.end |
|
95 |
||
96 |
// Support for u2 Bytes::swap_u2(u2 x) |
|
97 |
.inline _raw_swap_u2,1 |
|
98 |
movw %di, %ax |
|
99 |
rorw $8, %ax |
|
100 |
.end |
|
101 |
||
102 |
// Support for u4 Bytes::swap_u4(u4 x) |
|
103 |
.inline _raw_swap_u4,1 |
|
104 |
movl %edi, %eax |
|
105 |
bswapl %eax |
|
106 |
.end |
|
107 |
||
108 |
// Support for u8 Bytes::swap_u8(u8 x) |
|
109 |
.inline _raw_swap_u8,1 |
|
110 |
movq %rdi, %rax |
|
111 |
bswapq %rax |
|
112 |
.end |
|
113 |
||
114 |
// Support for void Prefetch::read |
|
115 |
.inline _Prefetch_read,2 |
|
116 |
prefetcht0 (%rdi, %rsi, 1) |
|
117 |
.end |
|
118 |
||
119 |
// Support for void Prefetch::write |
|
120 |
// We use prefetcht0 because em64t doesn't support prefetchw. |
|
121 |
// prefetchw is a 3dnow instruction. |
|
122 |
.inline _Prefetch_write,2 |
|
123 |
prefetcht0 (%rdi, %rsi, 1) |
|
124 |
.end |