Mercurial > hg > graal-compiler
annotate src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp @ 10320:ec922e5c545a
8012312: hsdis fails to compile with binutils-2.23.2
Summary: added <config.h> to header file to make hsdis compile with binutils 2.23.*
Reviewed-by: kvn, twisti
author | anoll |
---|---|
date | Wed, 22 May 2013 10:28:20 +0200 |
parents | d02120b7a34f |
children |
rev | line source |
---|---|
0 | 1 /* |
1972 | 2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
304
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
304
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
304
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #include "precompiled.hpp" |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
1972
diff
changeset
|
26 #include "asm/macroAssembler.hpp" |
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
1972
diff
changeset
|
27 #include "asm/macroAssembler.inline.hpp" |
1972 | 28 #include "runtime/os.hpp" |
29 #include "runtime/threadLocalStorage.hpp" | |
0 | 30 |
31 | |
32 void MacroAssembler::int3() { | |
304 | 33 push(rax); |
34 push(rdx); | |
35 push(rcx); | |
0 | 36 call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint))); |
304 | 37 pop(rcx); |
38 pop(rdx); | |
39 pop(rax); | |
0 | 40 } |
41 | |
304 | 42 #define __ _masm-> |
43 #ifndef _LP64 | |
44 static void slow_call_thr_specific(MacroAssembler* _masm, Register thread) { | |
0 | 45 |
46 // slow call to of thr_getspecific | |
47 // int thr_getspecific(thread_key_t key, void **value); | |
48 // Consider using pthread_getspecific instead. | |
49 | |
304 | 50 __ push(0); // allocate space for return value |
51 if (thread != rax) __ push(rax); // save rax, if caller still wants it | |
52 __ push(rcx); // save caller save | |
53 __ push(rdx); // save caller save | |
0 | 54 if (thread != rax) { |
304 | 55 __ lea(thread, Address(rsp, 3 * sizeof(int))); // address of return value |
0 | 56 } else { |
304 | 57 __ lea(thread, Address(rsp, 2 * sizeof(int))); // address of return value |
58 } | |
59 __ push(thread); // and pass the address | |
60 __ push(ThreadLocalStorage::thread_index()); // the key | |
61 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, thr_getspecific))); | |
62 __ increment(rsp, 2 * wordSize); | |
63 __ pop(rdx); | |
64 __ pop(rcx); | |
65 if (thread != rax) __ pop(rax); | |
66 __ pop(thread); | |
67 | |
68 } | |
69 #else | |
70 static void slow_call_thr_specific(MacroAssembler* _masm, Register thread) { | |
71 // slow call to of thr_getspecific | |
72 // int thr_getspecific(thread_key_t key, void **value); | |
73 // Consider using pthread_getspecific instead. | |
74 | |
75 if (thread != rax) { | |
76 __ push(rax); | |
0 | 77 } |
304 | 78 __ push(0); // space for return value |
79 __ push(rdi); | |
80 __ push(rsi); | |
81 __ lea(rsi, Address(rsp, 16)); // pass return value address | |
82 __ push(rdx); | |
83 __ push(rcx); | |
84 __ push(r8); | |
85 __ push(r9); | |
86 __ push(r10); | |
87 // XXX | |
88 __ mov(r10, rsp); | |
89 __ andptr(rsp, -16); | |
90 __ push(r10); | |
91 __ push(r11); | |
92 | |
93 __ movl(rdi, ThreadLocalStorage::thread_index()); | |
94 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, thr_getspecific))); | |
95 | |
96 __ pop(r11); | |
97 __ pop(rsp); | |
98 __ pop(r10); | |
99 __ pop(r9); | |
100 __ pop(r8); | |
101 __ pop(rcx); | |
102 __ pop(rdx); | |
103 __ pop(rsi); | |
104 __ pop(rdi); | |
105 __ pop(thread); // load return value | |
106 if (thread != rax) { | |
107 __ pop(rax); | |
108 } | |
0 | 109 } |
304 | 110 #endif //LP64 |
111 | |
112 void MacroAssembler::get_thread(Register thread) { | |
113 | |
114 int segment = NOT_LP64(Assembler::GS_segment) LP64_ONLY(Assembler::FS_segment); | |
115 // Try to emit a Solaris-specific fast TSD/TLS accessor. | |
116 ThreadLocalStorage::pd_tlsAccessMode tlsMode = ThreadLocalStorage::pd_getTlsAccessMode (); | |
117 if (tlsMode == ThreadLocalStorage::pd_tlsAccessIndirect) { // T1 | |
118 // Use thread as a temporary: mov r, gs:[0]; mov r, [r+tlsOffset] | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7199
diff
changeset
|
119 emit_int8 (segment); |
304 | 120 // ExternalAddress doesn't work because it can't take NULL |
121 AddressLiteral null(0, relocInfo::none); | |
122 movptr (thread, null); | |
123 movptr(thread, Address(thread, ThreadLocalStorage::pd_getTlsOffset())) ; | |
124 return ; | |
125 } else | |
126 if (tlsMode == ThreadLocalStorage::pd_tlsAccessDirect) { // T2 | |
127 // mov r, gs:[tlsOffset] | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7199
diff
changeset
|
128 emit_int8 (segment); |
304 | 129 AddressLiteral tls_off((address)ThreadLocalStorage::pd_getTlsOffset(), relocInfo::none); |
130 movptr (thread, tls_off); | |
131 return ; | |
132 } | |
133 | |
134 slow_call_thr_specific(this, thread); | |
135 | |
136 } |