author | prr |
Thu, 30 Jun 2016 11:56:27 -0700 | |
changeset 41570 | 5b4a677ed287 |
parent 29456 | cc1c5203e60d |
child 46414 | 5d1d862dc8d8 |
permissions | -rw-r--r-- |
1 | 1 |
// |
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
27691
diff
changeset
|
2 |
// Copyright (c) 2003, 2015, 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. |
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
27691
diff
changeset
|
22 |
// |
1 | 23 |
// |
24 |
||
25 |
||
26 |
// Support for u8 os::setup_fpu() |
|
27 |
.inline _solaris_raw_setup_fpu,1 |
|
28 |
movl 0(%esp), %eax |
|
29 |
fldcw (%eax) |
|
30 |
.end |
|
31 |
||
32 |
// The argument size of each inline directive is ignored by the compiler |
|
33 |
// and is set to 0 for compatibility reason. |
|
34 |
||
35 |
// Get the raw thread ID from %gs:0 |
|
36 |
.inline _raw_thread_id,0 |
|
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
27691
diff
changeset
|
37 |
movl %gs:0, %eax |
1 | 38 |
.end |
39 |
||
11961
0abd4cd26e5a
7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents:
11417
diff
changeset
|
40 |
// Get current sp |
0abd4cd26e5a
7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents:
11417
diff
changeset
|
41 |
.inline _get_current_sp,0 |
0abd4cd26e5a
7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents:
11417
diff
changeset
|
42 |
.volatile |
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
27691
diff
changeset
|
43 |
movl %esp, %eax |
11961
0abd4cd26e5a
7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents:
11417
diff
changeset
|
44 |
.end |
0abd4cd26e5a
7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents:
11417
diff
changeset
|
45 |
|
1659
b9a3819ac7c6
6773838: There is no calling stack for Compiler thread in hs_err file on x86
coleenp
parents:
1
diff
changeset
|
46 |
// Get current fp |
b9a3819ac7c6
6773838: There is no calling stack for Compiler thread in hs_err file on x86
coleenp
parents:
1
diff
changeset
|
47 |
.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
|
48 |
.volatile |
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
27691
diff
changeset
|
49 |
movl %ebp, %eax |
1 | 50 |
.end |
51 |
||
11417
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
7891
diff
changeset
|
52 |
// Support for os::rdtsc() |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
7891
diff
changeset
|
53 |
.inline _raw_rdtsc,0 |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
7891
diff
changeset
|
54 |
rdtsc |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
7891
diff
changeset
|
55 |
.end |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
7891
diff
changeset
|
56 |
|
1 | 57 |
// Support for jint Atomic::add(jint inc, volatile jint* dest) |
58 |
// An additional bool (os::is_MP()) is passed as the last argument. |
|
59 |
.inline _Atomic_add,3 |
|
60 |
movl 0(%esp), %eax // inc |
|
61 |
movl 4(%esp), %edx // dest |
|
62 |
movl %eax, %ecx |
|
63 |
cmpl $0, 8(%esp) // MP test |
|
5542
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
64 |
jne 1f |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
65 |
xaddl %eax, (%edx) |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
66 |
jmp 2f |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
67 |
1: lock |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
68 |
xaddl %eax, (%edx) |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
69 |
2: addl %ecx, %eax |
1 | 70 |
.end |
71 |
||
72 |
// Support for jint Atomic::xchg(jint exchange_value, volatile jint* dest). |
|
73 |
.inline _Atomic_xchg,2 |
|
74 |
movl 0(%esp), %eax // exchange_value |
|
75 |
movl 4(%esp), %ecx // dest |
|
76 |
xchgl (%ecx), %eax |
|
77 |
.end |
|
78 |
||
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
27691
diff
changeset
|
79 |
// Support for jbyte Atomic::cmpxchg(jbyte exchange_value, |
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
27691
diff
changeset
|
80 |
// volatile jbyte *dest, |
27691
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
81 |
// jbyte compare_value) |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
82 |
// An additional bool (os::is_MP()) is passed as the last argument. |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
83 |
.inline _Atomic_cmpxchg_byte,4 |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
84 |
movb 8(%esp), %al // compare_value |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
85 |
movb 0(%esp), %cl // exchange_value |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
86 |
movl 4(%esp), %edx // dest |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
87 |
cmp $0, 12(%esp) // MP test |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
88 |
jne 1f |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
89 |
cmpxchgb %cl, (%edx) |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
90 |
jmp 2f |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
91 |
1: lock |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
92 |
cmpxchgb %cl, (%edx) |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
93 |
2: |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
94 |
.end |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
13963
diff
changeset
|
95 |
|
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
27691
diff
changeset
|
96 |
// Support for jint Atomic::cmpxchg(jint exchange_value, |
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
27691
diff
changeset
|
97 |
// volatile jint *dest, |
1 | 98 |
// jint compare_value) |
99 |
// An additional bool (os::is_MP()) is passed as the last argument. |
|
100 |
.inline _Atomic_cmpxchg,4 |
|
101 |
movl 8(%esp), %eax // compare_value |
|
102 |
movl 0(%esp), %ecx // exchange_value |
|
103 |
movl 4(%esp), %edx // dest |
|
104 |
cmp $0, 12(%esp) // MP test |
|
5542
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
105 |
jne 1f |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
106 |
cmpxchgl %ecx, (%edx) |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
107 |
jmp 2f |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
108 |
1: lock |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
109 |
cmpxchgl %ecx, (%edx) |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
110 |
2: |
1 | 111 |
.end |
112 |
||
113 |
// Support for jlong Atomic::cmpxchg(jlong exchange_value, |
|
114 |
// volatile jlong* dest, |
|
115 |
// jlong compare_value) |
|
116 |
// An additional bool (os::is_MP()) is passed as the last argument. |
|
117 |
.inline _Atomic_cmpxchg_long,6 |
|
118 |
pushl %ebx |
|
119 |
pushl %edi |
|
120 |
movl 20(%esp), %eax // compare_value (low) |
|
121 |
movl 24(%esp), %edx // compare_value (high) |
|
122 |
movl 16(%esp), %edi // dest |
|
123 |
movl 8(%esp), %ebx // exchange_value (low) |
|
124 |
movl 12(%esp), %ecx // exchange_high (high) |
|
125 |
cmp $0, 28(%esp) // MP test |
|
5542
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
126 |
jne 1f |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
127 |
cmpxchg8b (%edi) |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
128 |
jmp 2f |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
129 |
1: lock |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
130 |
cmpxchg8b (%edi) |
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
3594
diff
changeset
|
131 |
2: popl %edi |
1 | 132 |
popl %ebx |
133 |
.end |
|
134 |
||
7885
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
5547
diff
changeset
|
135 |
// Support for jlong Atomic::load and Atomic::store. |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
5547
diff
changeset
|
136 |
// void _Atomic_move_long(volatile jlong* src, volatile jlong* dst) |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
5547
diff
changeset
|
137 |
.inline _Atomic_move_long,2 |
3594
0ce9158bc84c
6863420: os::javaTimeNanos() go backward on Solaris x86
kvn
parents:
2105
diff
changeset
|
138 |
movl 0(%esp), %eax // src |
0ce9158bc84c
6863420: os::javaTimeNanos() go backward on Solaris x86
kvn
parents:
2105
diff
changeset
|
139 |
fildll (%eax) |
0ce9158bc84c
6863420: os::javaTimeNanos() go backward on Solaris x86
kvn
parents:
2105
diff
changeset
|
140 |
movl 4(%esp), %eax // dest |
0ce9158bc84c
6863420: os::javaTimeNanos() go backward on Solaris x86
kvn
parents:
2105
diff
changeset
|
141 |
fistpll (%eax) |
0ce9158bc84c
6863420: os::javaTimeNanos() go backward on Solaris x86
kvn
parents:
2105
diff
changeset
|
142 |
.end |
0ce9158bc84c
6863420: os::javaTimeNanos() go backward on Solaris x86
kvn
parents:
2105
diff
changeset
|
143 |
|
1 | 144 |
// Support for u2 Bytes::swap_u2(u2 x) |
145 |
.inline _raw_swap_u2,1 |
|
146 |
movl 0(%esp), %eax |
|
147 |
xchgb %al, %ah |
|
148 |
.end |
|
149 |
||
150 |
// Support for u4 Bytes::swap_u4(u4 x) |
|
151 |
.inline _raw_swap_u4,1 |
|
152 |
movl 0(%esp), %eax |
|
153 |
bswap %eax |
|
154 |
.end |
|
155 |
||
156 |
// Support for u8 Bytes::swap_u8_base(u4 x, u4 y) |
|
157 |
.inline _raw_swap_u8,2 |
|
158 |
movl 4(%esp), %eax // y |
|
159 |
movl 0(%esp), %edx // x |
|
160 |
bswap %eax |
|
161 |
bswap %edx |
|
162 |
.end |