Mercurial > hg > graal-compiler
annotate src/cpu/x86/vm/compiledIC_x86.cpp @ 19749:095ddb9421d0
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Tue, 10 Mar 2015 11:33:30 +0100 |
parents | 72a3e3995879 |
children | 7848fc12602b |
rev | line source |
---|---|
10168
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
1 /* |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
10168
diff
changeset
|
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
10168
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
4 * |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
8 * |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
13 * accompanied this code). |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
14 * |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
18 * |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
21 * questions. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
22 * |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
23 */ |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
24 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
25 #include "precompiled.hpp" |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
26 #include "asm/macroAssembler.inline.hpp" |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
27 #include "code/compiledIC.hpp" |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
28 #include "code/icBuffer.hpp" |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
29 #include "code/nmethod.hpp" |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
30 #include "memory/resourceArea.hpp" |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
31 #include "runtime/mutexLocker.hpp" |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
32 #include "runtime/safepoint.hpp" |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
33 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
34 // Release the CompiledICHolder* associated with this call site is there is one. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
35 void CompiledIC::cleanup_call_site(virtual_call_Relocation* call_site) { |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
36 // This call site might have become stale so inspect it carefully. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
37 NativeCall* call = nativeCall_at(call_site->addr()); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
38 if (is_icholder_entry(call->destination())) { |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
39 NativeMovConstReg* value = nativeMovConstReg_at(call_site->cached_value()); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
40 InlineCacheBuffer::queue_for_release((CompiledICHolder*)value->data()); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
41 } |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
42 } |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
43 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
44 bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) { |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
45 // This call site might have become stale so inspect it carefully. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
46 NativeCall* call = nativeCall_at(call_site->addr()); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
47 return is_icholder_entry(call->destination()); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
48 } |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
49 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
50 //----------------------------------------------------------------------------- |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
51 // High-level access to an inline cache. Guaranteed to be MT-safe. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
52 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
53 CompiledIC::CompiledIC(nmethod* nm, NativeCall* call) |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
54 : _ic_call(call) |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
55 { |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
56 address ic_call = call->instruction_address(); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
57 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
58 assert(ic_call != NULL, "ic_call address must be set"); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
59 assert(nm != NULL, "must pass nmethod"); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
60 assert(nm->contains(ic_call), "must be in nmethod"); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
61 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
62 // Search for the ic_call at the given address. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
63 RelocIterator iter(nm, ic_call, ic_call+1); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
64 bool ret = iter.next(); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
65 assert(ret == true, "relocInfo must exist at this address"); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
66 assert(iter.addr() == ic_call, "must find ic_call"); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
67 if (iter.type() == relocInfo::virtual_call_type) { |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
68 virtual_call_Relocation* r = iter.virtual_call_reloc(); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
69 _is_optimized = false; |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
70 _value = nativeMovConstReg_at(r->cached_value()); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
71 } else { |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
72 assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call"); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
73 _is_optimized = true; |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
74 _value = NULL; |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
75 } |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
76 } |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
77 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
78 // ---------------------------------------------------------------------------- |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
79 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
80 #define __ _masm. |
15046
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12356
diff
changeset
|
81 void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark) { |
10168
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
82 // Stub is fixed up when the corresponding call is converted from |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
83 // calling compiled code to calling interpreted code. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
84 // movq rbx, 0 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
85 // jmp -5 # to self |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
86 |
15046
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12356
diff
changeset
|
87 if (mark == NULL) { |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12356
diff
changeset
|
88 mark = cbuf.insts_mark(); // Get mark within main instrs section. |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12356
diff
changeset
|
89 } |
10168
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
90 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
91 // Note that the code buffer's insts_mark is always relative to insts. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
92 // That's why we must use the macroassembler to generate a stub. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
93 MacroAssembler _masm(&cbuf); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
94 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
95 address base = |
15046
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12356
diff
changeset
|
96 __ start_a_stub(to_interp_stub_size()); |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12356
diff
changeset
|
97 guarantee(base != NULL, "out of space"); |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12356
diff
changeset
|
98 |
10168
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
99 // Static stub relocation stores the instruction address of the call. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
100 __ relocate(static_stub_Relocation::spec(mark), Assembler::imm_operand); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
101 // Static stub relocation also tags the Method* in the code-stream. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
102 __ mov_metadata(rbx, (Metadata*) NULL); // Method is zapped till fixup time. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
103 // This is recognized as unresolved by relocs/nativeinst/ic code. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
104 __ jump(RuntimeAddress(__ pc())); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
105 |
15046
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12356
diff
changeset
|
106 assert(__ pc() - base <= to_interp_stub_size(), "wrong stub size"); |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12356
diff
changeset
|
107 |
10168
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
108 // Update current stubs pointer and restore insts_end. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
109 __ end_a_stub(); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
110 } |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
111 #undef __ |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
112 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
113 int CompiledStaticCall::to_interp_stub_size() { |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
114 return NOT_LP64(10) // movl; jmp |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
115 LP64_ONLY(15); // movq (1+1+8); jmp (1+4) |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
116 } |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
117 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
118 // Relocation entries for call stub, compiled java to interpreter. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
119 int CompiledStaticCall::reloc_to_interp_stub() { |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
120 return 4; // 3 in emit_to_interp_stub + 1 in emit_call |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
121 } |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
122 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
123 void CompiledStaticCall::set_to_interpreted(methodHandle callee, address entry) { |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
124 address stub = find_stub(); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
125 guarantee(stub != NULL, "stub not found"); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
126 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
127 if (TraceICs) { |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
128 ResourceMark rm; |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
129 tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s", |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
10168
diff
changeset
|
130 p2i(instruction_address()), |
10168
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
131 callee->name_and_sig_as_C_string()); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
132 } |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
133 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
134 // Creation also verifies the object. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
135 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
136 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
137 |
19734
72a3e3995879
Fix possible race in assertion
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18041
diff
changeset
|
138 #ifdef ASSERT |
72a3e3995879
Fix possible race in assertion
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18041
diff
changeset
|
139 // read the value once |
72a3e3995879
Fix possible race in assertion
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18041
diff
changeset
|
140 intptr_t data = method_holder->data(); |
72a3e3995879
Fix possible race in assertion
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18041
diff
changeset
|
141 address destination = jump->jump_destination(); |
72a3e3995879
Fix possible race in assertion
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18041
diff
changeset
|
142 assert(data == 0 || data == (intptr_t)callee(), |
10168
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
143 "a) MT-unsafe modification of inline cache"); |
19734
72a3e3995879
Fix possible race in assertion
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18041
diff
changeset
|
144 assert(destination == (address)-1 || destination == entry, |
10168
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
145 "b) MT-unsafe modification of inline cache"); |
19734
72a3e3995879
Fix possible race in assertion
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18041
diff
changeset
|
146 #endif |
10168
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
147 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
148 // Update stub. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
149 method_holder->set_data((intptr_t)callee()); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
150 jump->set_jump_destination(entry); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
151 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
152 // Update jump to call. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
153 set_destination_mt_safe(stub); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
154 } |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
155 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
156 void CompiledStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
157 assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call"); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
158 // Reset stub. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
159 address stub = static_stub->addr(); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
160 assert(stub != NULL, "stub not found"); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
161 // Creation also verifies the object. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
162 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
163 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
164 method_holder->set_data(0); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
165 jump->set_jump_destination((address)-1); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
166 } |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
167 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
168 //----------------------------------------------------------------------------- |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
169 // Non-product mode code |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
170 #ifndef PRODUCT |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
171 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
172 void CompiledStaticCall::verify() { |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
173 // Verify call. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
174 NativeCall::verify(); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
175 if (os::is_MP()) { |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
176 verify_alignment(); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
177 } |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
178 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
179 // Verify stub. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
180 address stub = find_stub(); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
181 assert(stub != NULL, "no stub found for static call"); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
182 // Creation also verifies the object. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
183 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
184 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
185 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
186 // Verify state. |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
187 assert(is_clean() || is_call_to_compiled() || is_call_to_interpreted(), "sanity check"); |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
188 } |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
189 |
a6e09d6dd8e5
8003853: specify offset of IC load in java_to_interp stub
dlong
parents:
diff
changeset
|
190 #endif // !PRODUCT |