annotate src/share/vm/code/vtableStubs.cpp @ 14649:f6301b007a16

6498581: ThreadInterruptTest3 produces wrong output on Windows Summary: There is race condition between os::interrupt and os::is_interrupted on Windows. In JVM_Sleep(Thread.sleep), check if thread gets interrupted, it may see interrupted but not really interrupted so cause spurious waking up (early return from sleep). Fix by checking if interrupt event really gets set thus prevent false return. For intrinsic of _isInterrupted, on Windows, go fastpath only on bit not set. Reviewed-by: acorn, kvn Contributed-by: david.holmes@oracle.com, yumin.qi@oracle.com
author minqi
date Wed, 26 Feb 2014 15:20:41 -0800
parents 9341a9963d36
children 4ca6dc0799b6 78bbf4d43a14
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
12146
9758d9f36299 8021954: VM SIGSEGV during classloading on MacOS; hs_err_pid file produced
coleenp
parents: 10161
diff changeset
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1490
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1490
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: 1490
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
26 #include "code/vtableStubs.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
27 #include "compiler/disassembler.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
28 #include "memory/allocation.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
29 #include "memory/resourceArea.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
30 #include "oops/instanceKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
31 #include "oops/klassVtable.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
32 #include "oops/oop.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
33 #include "prims/forte.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
34 #include "prims/jvmtiExport.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
35 #include "runtime/handles.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
36 #include "runtime/mutexLocker.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
37 #include "runtime/sharedRuntime.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
38 #ifdef COMPILER2
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
39 #include "opto/matcher.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
40 #endif
0
a61af66fc99e Initial load
duke
parents:
diff changeset
41
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // -----------------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
43 // Implementation of VtableStub
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 address VtableStub::_chunk = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
46 address VtableStub::_chunk_end = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
47 VMReg VtableStub::_receiver_location = VMRegImpl::Bad();
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49
12146
9758d9f36299 8021954: VM SIGSEGV during classloading on MacOS; hs_err_pid file produced
coleenp
parents: 10161
diff changeset
50 void* VtableStub::operator new(size_t size, int code_size) throw() {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
51 assert(size == sizeof(VtableStub), "mismatched size");
a61af66fc99e Initial load
duke
parents:
diff changeset
52 // compute real VtableStub size (rounded to nearest word)
a61af66fc99e Initial load
duke
parents:
diff changeset
53 const int real_size = round_to(code_size + sizeof(VtableStub), wordSize);
a61af66fc99e Initial load
duke
parents:
diff changeset
54 // malloc them in chunks to minimize header overhead
a61af66fc99e Initial load
duke
parents:
diff changeset
55 const int chunk_factor = 32;
a61af66fc99e Initial load
duke
parents:
diff changeset
56 if (_chunk == NULL || _chunk + real_size > _chunk_end) {
a61af66fc99e Initial load
duke
parents:
diff changeset
57 const int bytes = chunk_factor * real_size + pd_code_alignment();
14330
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
58
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
59 // There is a dependency on the name of the blob in src/share/vm/prims/jvmtiCodeBlobEvents.cpp
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
60 // If changing the name, update the other file accordingly.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
61 BufferBlob* blob = BufferBlob::create("vtable chunks", bytes);
1490
f03d0a26bf83 6888954: argument formatting for assert() and friends
jcoomes
parents: 844
diff changeset
62 if (blob == NULL) {
12294
891687731b59 7009641: Don't fail VM when CodeCache is full
anoll
parents: 12264
diff changeset
63 return NULL;
1490
f03d0a26bf83 6888954: argument formatting for assert() and friends
jcoomes
parents: 844
diff changeset
64 }
1748
3e8fbc61cee8 6978355: renaming for 6961697
twisti
parents: 1681
diff changeset
65 _chunk = blob->content_begin();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
66 _chunk_end = _chunk + bytes;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 Forte::register_stub("vtable stub", _chunk, _chunk_end);
a61af66fc99e Initial load
duke
parents:
diff changeset
68 align_chunk();
a61af66fc99e Initial load
duke
parents:
diff changeset
69 }
a61af66fc99e Initial load
duke
parents:
diff changeset
70 assert(_chunk + real_size <= _chunk_end, "bad allocation");
a61af66fc99e Initial load
duke
parents:
diff changeset
71 void* res = _chunk;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 _chunk += real_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 align_chunk();
a61af66fc99e Initial load
duke
parents:
diff changeset
74 return res;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77
1681
126ea7725993 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 1644
diff changeset
78 void VtableStub::print_on(outputStream* st) const {
126ea7725993 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 1644
diff changeset
79 st->print("vtable stub (index = %d, receiver_location = %d, code = [" INTPTR_FORMAT ", " INTPTR_FORMAT "[)",
0
a61af66fc99e Initial load
duke
parents:
diff changeset
80 index(), receiver_location(), code_begin(), code_end());
a61af66fc99e Initial load
duke
parents:
diff changeset
81 }
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 // -----------------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
85 // Implementation of VtableStubs
a61af66fc99e Initial load
duke
parents:
diff changeset
86 //
a61af66fc99e Initial load
duke
parents:
diff changeset
87 // For each hash value there's a linked list of vtable stubs (with that
a61af66fc99e Initial load
duke
parents:
diff changeset
88 // hash value). Each list is anchored in a little hash _table, indexed
a61af66fc99e Initial load
duke
parents:
diff changeset
89 // by that hash value.
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 VtableStub* VtableStubs::_table[VtableStubs::N];
a61af66fc99e Initial load
duke
parents:
diff changeset
92 int VtableStubs::_number_of_vtable_stubs = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94
a61af66fc99e Initial load
duke
parents:
diff changeset
95 void VtableStubs::initialize() {
a61af66fc99e Initial load
duke
parents:
diff changeset
96 VtableStub::_receiver_location = SharedRuntime::name_for_receiver();
a61af66fc99e Initial load
duke
parents:
diff changeset
97 {
a61af66fc99e Initial load
duke
parents:
diff changeset
98 MutexLocker ml(VtableStubs_lock);
a61af66fc99e Initial load
duke
parents:
diff changeset
99 assert(_number_of_vtable_stubs == 0, "potential performance bug: VtableStubs initialized more than once");
a61af66fc99e Initial load
duke
parents:
diff changeset
100 assert(is_power_of_2(N), "N must be a power of 2");
a61af66fc99e Initial load
duke
parents:
diff changeset
101 for (int i = 0; i < N; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
102 _table[i] = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
103 }
a61af66fc99e Initial load
duke
parents:
diff changeset
104 }
a61af66fc99e Initial load
duke
parents:
diff changeset
105 }
a61af66fc99e Initial load
duke
parents:
diff changeset
106
a61af66fc99e Initial load
duke
parents:
diff changeset
107
12264
b2e698d2276c 8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents: 12146
diff changeset
108 address VtableStubs::find_stub(bool is_vtable_stub, int vtable_index) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
109 assert(vtable_index >= 0, "must be positive");
a61af66fc99e Initial load
duke
parents:
diff changeset
110
a61af66fc99e Initial load
duke
parents:
diff changeset
111 VtableStub* s = ShareVtableStubs ? lookup(is_vtable_stub, vtable_index) : NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
112 if (s == NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
113 if (is_vtable_stub) {
a61af66fc99e Initial load
duke
parents:
diff changeset
114 s = create_vtable_stub(vtable_index);
a61af66fc99e Initial load
duke
parents:
diff changeset
115 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
116 s = create_itable_stub(vtable_index);
a61af66fc99e Initial load
duke
parents:
diff changeset
117 }
12294
891687731b59 7009641: Don't fail VM when CodeCache is full
anoll
parents: 12264
diff changeset
118
891687731b59 7009641: Don't fail VM when CodeCache is full
anoll
parents: 12264
diff changeset
119 // Creation of vtable or itable can fail if there is not enough free space in the code cache.
891687731b59 7009641: Don't fail VM when CodeCache is full
anoll
parents: 12264
diff changeset
120 if (s == NULL) {
891687731b59 7009641: Don't fail VM when CodeCache is full
anoll
parents: 12264
diff changeset
121 return NULL;
891687731b59 7009641: Don't fail VM when CodeCache is full
anoll
parents: 12264
diff changeset
122 }
891687731b59 7009641: Don't fail VM when CodeCache is full
anoll
parents: 12264
diff changeset
123
0
a61af66fc99e Initial load
duke
parents:
diff changeset
124 enter(is_vtable_stub, vtable_index, s);
a61af66fc99e Initial load
duke
parents:
diff changeset
125 if (PrintAdapterHandlers) {
a61af66fc99e Initial load
duke
parents:
diff changeset
126 tty->print_cr("Decoding VtableStub %s[%d]@%d",
a61af66fc99e Initial load
duke
parents:
diff changeset
127 is_vtable_stub? "vtbl": "itbl", vtable_index, VtableStub::receiver_location());
a61af66fc99e Initial load
duke
parents:
diff changeset
128 Disassembler::decode(s->code_begin(), s->code_end());
a61af66fc99e Initial load
duke
parents:
diff changeset
129 }
14330
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
130 // Notify JVMTI about this stub. The event will be recorded by the enclosing
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
131 // JvmtiDynamicCodeEventCollector and posted when this thread has released
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
132 // all locks.
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
133 if (JvmtiExport::should_post_dynamic_code_generated()) {
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
134 JvmtiExport::post_dynamic_code_generated_while_holding_locks(is_vtable_stub? "vtable stub": "itable stub",
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
135 s->code_begin(), s->code_end());
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
136 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
137 }
a61af66fc99e Initial load
duke
parents:
diff changeset
138 return s->entry_point();
a61af66fc99e Initial load
duke
parents:
diff changeset
139 }
a61af66fc99e Initial load
duke
parents:
diff changeset
140
a61af66fc99e Initial load
duke
parents:
diff changeset
141
a61af66fc99e Initial load
duke
parents:
diff changeset
142 inline uint VtableStubs::hash(bool is_vtable_stub, int vtable_index){
a61af66fc99e Initial load
duke
parents:
diff changeset
143 // Assumption: receiver_location < 4 in most cases.
a61af66fc99e Initial load
duke
parents:
diff changeset
144 int hash = ((vtable_index << 2) ^ VtableStub::receiver_location()->value()) + vtable_index;
a61af66fc99e Initial load
duke
parents:
diff changeset
145 return (is_vtable_stub ? ~hash : hash) & mask;
a61af66fc99e Initial load
duke
parents:
diff changeset
146 }
a61af66fc99e Initial load
duke
parents:
diff changeset
147
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 VtableStub* VtableStubs::lookup(bool is_vtable_stub, int vtable_index) {
a61af66fc99e Initial load
duke
parents:
diff changeset
150 MutexLocker ml(VtableStubs_lock);
a61af66fc99e Initial load
duke
parents:
diff changeset
151 unsigned hash = VtableStubs::hash(is_vtable_stub, vtable_index);
a61af66fc99e Initial load
duke
parents:
diff changeset
152 VtableStub* s = _table[hash];
a61af66fc99e Initial load
duke
parents:
diff changeset
153 while( s && !s->matches(is_vtable_stub, vtable_index)) s = s->next();
a61af66fc99e Initial load
duke
parents:
diff changeset
154 return s;
a61af66fc99e Initial load
duke
parents:
diff changeset
155 }
a61af66fc99e Initial load
duke
parents:
diff changeset
156
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 void VtableStubs::enter(bool is_vtable_stub, int vtable_index, VtableStub* s) {
a61af66fc99e Initial load
duke
parents:
diff changeset
159 MutexLocker ml(VtableStubs_lock);
a61af66fc99e Initial load
duke
parents:
diff changeset
160 assert(s->matches(is_vtable_stub, vtable_index), "bad vtable stub");
a61af66fc99e Initial load
duke
parents:
diff changeset
161 unsigned int h = VtableStubs::hash(is_vtable_stub, vtable_index);
a61af66fc99e Initial load
duke
parents:
diff changeset
162 // enter s at the beginning of the corresponding list
a61af66fc99e Initial load
duke
parents:
diff changeset
163 s->set_next(_table[h]);
a61af66fc99e Initial load
duke
parents:
diff changeset
164 _table[h] = s;
a61af66fc99e Initial load
duke
parents:
diff changeset
165 _number_of_vtable_stubs++;
a61af66fc99e Initial load
duke
parents:
diff changeset
166 }
a61af66fc99e Initial load
duke
parents:
diff changeset
167
a61af66fc99e Initial load
duke
parents:
diff changeset
168
a61af66fc99e Initial load
duke
parents:
diff changeset
169 bool VtableStubs::is_entry_point(address pc) {
a61af66fc99e Initial load
duke
parents:
diff changeset
170 MutexLocker ml(VtableStubs_lock);
a61af66fc99e Initial load
duke
parents:
diff changeset
171 VtableStub* stub = (VtableStub*)(pc - VtableStub::entry_offset());
a61af66fc99e Initial load
duke
parents:
diff changeset
172 uint hash = VtableStubs::hash(stub->is_vtable_stub(), stub->index());
a61af66fc99e Initial load
duke
parents:
diff changeset
173 VtableStub* s;
a61af66fc99e Initial load
duke
parents:
diff changeset
174 for (s = _table[hash]; s != NULL && s != stub; s = s->next()) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
175 return s == stub;
a61af66fc99e Initial load
duke
parents:
diff changeset
176 }
a61af66fc99e Initial load
duke
parents:
diff changeset
177
a61af66fc99e Initial load
duke
parents:
diff changeset
178
a61af66fc99e Initial load
duke
parents:
diff changeset
179 bool VtableStubs::contains(address pc) {
a61af66fc99e Initial load
duke
parents:
diff changeset
180 // simple solution for now - we may want to use
a61af66fc99e Initial load
duke
parents:
diff changeset
181 // a faster way if this function is called often
a61af66fc99e Initial load
duke
parents:
diff changeset
182 return stub_containing(pc) != NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
183 }
a61af66fc99e Initial load
duke
parents:
diff changeset
184
a61af66fc99e Initial load
duke
parents:
diff changeset
185
a61af66fc99e Initial load
duke
parents:
diff changeset
186 VtableStub* VtableStubs::stub_containing(address pc) {
a61af66fc99e Initial load
duke
parents:
diff changeset
187 // Note: No locking needed since any change to the data structure
a61af66fc99e Initial load
duke
parents:
diff changeset
188 // happens with an atomic store into it (we don't care about
a61af66fc99e Initial load
duke
parents:
diff changeset
189 // consistency with the _number_of_vtable_stubs counter).
a61af66fc99e Initial load
duke
parents:
diff changeset
190 for (int i = 0; i < N; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
191 for (VtableStub* s = _table[i]; s != NULL; s = s->next()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
192 if (s->contains(pc)) return s;
a61af66fc99e Initial load
duke
parents:
diff changeset
193 }
a61af66fc99e Initial load
duke
parents:
diff changeset
194 }
a61af66fc99e Initial load
duke
parents:
diff changeset
195 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
196 }
a61af66fc99e Initial load
duke
parents:
diff changeset
197
a61af66fc99e Initial load
duke
parents:
diff changeset
198 void vtableStubs_init() {
a61af66fc99e Initial load
duke
parents:
diff changeset
199 VtableStubs::initialize();
a61af66fc99e Initial load
duke
parents:
diff changeset
200 }
a61af66fc99e Initial load
duke
parents:
diff changeset
201
14330
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
202 void VtableStubs::vtable_stub_do(void f(VtableStub*)) {
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
203 for (int i = 0; i < N; i++) {
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
204 for (VtableStub* s = _table[i]; s != NULL; s = s->next()) {
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
205 f(s);
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
206 }
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
207 }
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
208 }
9341a9963d36 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
sspitsyn
parents: 12294
diff changeset
209
0
a61af66fc99e Initial load
duke
parents:
diff changeset
210
a61af66fc99e Initial load
duke
parents:
diff changeset
211 //-----------------------------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
212 // Non-product code
a61af66fc99e Initial load
duke
parents:
diff changeset
213 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
214
a61af66fc99e Initial load
duke
parents:
diff changeset
215 extern "C" void bad_compiled_vtable_index(JavaThread* thread, oop receiver, int index) {
a61af66fc99e Initial load
duke
parents:
diff changeset
216 ResourceMark rm;
a61af66fc99e Initial load
duke
parents:
diff changeset
217 HandleMark hm;
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
218 Klass* klass = receiver->klass();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
219 InstanceKlass* ik = InstanceKlass::cast(klass);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
220 klassVtable* vt = ik->vtable();
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
221 ik->print();
1490
f03d0a26bf83 6888954: argument formatting for assert() and friends
jcoomes
parents: 844
diff changeset
222 fatal(err_msg("bad compiled vtable dispatch: receiver " INTPTR_FORMAT ", "
f03d0a26bf83 6888954: argument formatting for assert() and friends
jcoomes
parents: 844
diff changeset
223 "index %d (vtable length %d)",
f03d0a26bf83 6888954: argument formatting for assert() and friends
jcoomes
parents: 844
diff changeset
224 (address)receiver, index, vt->length()));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
225 }
a61af66fc99e Initial load
duke
parents:
diff changeset
226
a61af66fc99e Initial load
duke
parents:
diff changeset
227 #endif // Product