Mercurial > hg > graal-compiler
comparison src/share/vm/code/vtableStubs.cpp @ 14909:4ca6dc0799b6
Backout jdk9 merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 01 Apr 2014 13:57:07 +0200 |
parents | 9341a9963d36 |
children | 52b4284cb496 |
comparison
equal
deleted
inserted
replaced
14908:8db6e76cb658 | 14909:4ca6dc0799b6 |
---|---|
53 const int real_size = round_to(code_size + sizeof(VtableStub), wordSize); | 53 const int real_size = round_to(code_size + sizeof(VtableStub), wordSize); |
54 // malloc them in chunks to minimize header overhead | 54 // malloc them in chunks to minimize header overhead |
55 const int chunk_factor = 32; | 55 const int chunk_factor = 32; |
56 if (_chunk == NULL || _chunk + real_size > _chunk_end) { | 56 if (_chunk == NULL || _chunk + real_size > _chunk_end) { |
57 const int bytes = chunk_factor * real_size + pd_code_alignment(); | 57 const int bytes = chunk_factor * real_size + pd_code_alignment(); |
58 | |
59 // There is a dependency on the name of the blob in src/share/vm/prims/jvmtiCodeBlobEvents.cpp | |
60 // If changing the name, update the other file accordingly. | |
61 BufferBlob* blob = BufferBlob::create("vtable chunks", bytes); | 58 BufferBlob* blob = BufferBlob::create("vtable chunks", bytes); |
62 if (blob == NULL) { | 59 if (blob == NULL) { |
63 return NULL; | 60 return NULL; |
64 } | 61 } |
65 _chunk = blob->content_begin(); | 62 _chunk = blob->content_begin(); |
66 _chunk_end = _chunk + bytes; | 63 _chunk_end = _chunk + bytes; |
67 Forte::register_stub("vtable stub", _chunk, _chunk_end); | 64 Forte::register_stub("vtable stub", _chunk, _chunk_end); |
65 // Notify JVMTI about this stub. The event will be recorded by the enclosing | |
66 // JvmtiDynamicCodeEventCollector and posted when this thread has released | |
67 // all locks. | |
68 if (JvmtiExport::should_post_dynamic_code_generated()) { | |
69 JvmtiExport::post_dynamic_code_generated_while_holding_locks("vtable stub", _chunk, _chunk_end); | |
70 } | |
68 align_chunk(); | 71 align_chunk(); |
69 } | 72 } |
70 assert(_chunk + real_size <= _chunk_end, "bad allocation"); | 73 assert(_chunk + real_size <= _chunk_end, "bad allocation"); |
71 void* res = _chunk; | 74 void* res = _chunk; |
72 _chunk += real_size; | 75 _chunk += real_size; |
125 if (PrintAdapterHandlers) { | 128 if (PrintAdapterHandlers) { |
126 tty->print_cr("Decoding VtableStub %s[%d]@%d", | 129 tty->print_cr("Decoding VtableStub %s[%d]@%d", |
127 is_vtable_stub? "vtbl": "itbl", vtable_index, VtableStub::receiver_location()); | 130 is_vtable_stub? "vtbl": "itbl", vtable_index, VtableStub::receiver_location()); |
128 Disassembler::decode(s->code_begin(), s->code_end()); | 131 Disassembler::decode(s->code_begin(), s->code_end()); |
129 } | 132 } |
130 // Notify JVMTI about this stub. The event will be recorded by the enclosing | |
131 // JvmtiDynamicCodeEventCollector and posted when this thread has released | |
132 // all locks. | |
133 if (JvmtiExport::should_post_dynamic_code_generated()) { | |
134 JvmtiExport::post_dynamic_code_generated_while_holding_locks(is_vtable_stub? "vtable stub": "itable stub", | |
135 s->code_begin(), s->code_end()); | |
136 } | |
137 } | 133 } |
138 return s->entry_point(); | 134 return s->entry_point(); |
139 } | 135 } |
140 | 136 |
141 | 137 |
195 return NULL; | 191 return NULL; |
196 } | 192 } |
197 | 193 |
198 void vtableStubs_init() { | 194 void vtableStubs_init() { |
199 VtableStubs::initialize(); | 195 VtableStubs::initialize(); |
200 } | |
201 | |
202 void VtableStubs::vtable_stub_do(void f(VtableStub*)) { | |
203 for (int i = 0; i < N; i++) { | |
204 for (VtableStub* s = _table[i]; s != NULL; s = s->next()) { | |
205 f(s); | |
206 } | |
207 } | |
208 } | 196 } |
209 | 197 |
210 | 198 |
211 //----------------------------------------------------------------------------------------------------- | 199 //----------------------------------------------------------------------------------------------------- |
212 // Non-product code | 200 // Non-product code |