aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/code/vtableStubs.cpp
diff options
context:
space:
mode:
authorsspitsyn <none@none>2014-02-06 20:13:38 -0800
committersspitsyn <none@none>2014-02-06 20:13:38 -0800
commit6aa9ce5e464198055acad9f35c52816ee8cd1353 (patch)
treefe31aa99d59c831195ccd885ebb2ea18ae3e5d0b /src/share/vm/code/vtableStubs.cpp
parent4017ab33f914121e74bd86e05f1a1275bdca44ce (diff)
downloadjdk8u_hotspot-6aa9ce5e464198055acad9f35c52816ee8cd1353.tar.gz
8025841: JVMTI: "vtable stub" dynamic code notification is misplaced
Summary: Generate correct "vtable stub" dynamic code notifications Reviewed-by: sspitsyn, kvn, coleenp Contributed-by: oleg.mazurov@oracle.com
Diffstat (limited to 'src/share/vm/code/vtableStubs.cpp')
-rw-r--r--src/share/vm/code/vtableStubs.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/share/vm/code/vtableStubs.cpp b/src/share/vm/code/vtableStubs.cpp
index 5af91a3a6..b3bfc258f 100644
--- a/src/share/vm/code/vtableStubs.cpp
+++ b/src/share/vm/code/vtableStubs.cpp
@@ -55,6 +55,9 @@ void* VtableStub::operator new(size_t size, int code_size) throw() {
const int chunk_factor = 32;
if (_chunk == NULL || _chunk + real_size > _chunk_end) {
const int bytes = chunk_factor * real_size + pd_code_alignment();
+
+ // There is a dependency on the name of the blob in src/share/vm/prims/jvmtiCodeBlobEvents.cpp
+ // If changing the name, update the other file accordingly.
BufferBlob* blob = BufferBlob::create("vtable chunks", bytes);
if (blob == NULL) {
return NULL;
@@ -62,12 +65,6 @@ void* VtableStub::operator new(size_t size, int code_size) throw() {
_chunk = blob->content_begin();
_chunk_end = _chunk + bytes;
Forte::register_stub("vtable stub", _chunk, _chunk_end);
- // Notify JVMTI about this stub. The event will be recorded by the enclosing
- // JvmtiDynamicCodeEventCollector and posted when this thread has released
- // all locks.
- if (JvmtiExport::should_post_dynamic_code_generated()) {
- JvmtiExport::post_dynamic_code_generated_while_holding_locks("vtable stub", _chunk, _chunk_end);
- }
align_chunk();
}
assert(_chunk + real_size <= _chunk_end, "bad allocation");
@@ -130,6 +127,13 @@ address VtableStubs::find_stub(bool is_vtable_stub, int vtable_index) {
is_vtable_stub? "vtbl": "itbl", vtable_index, VtableStub::receiver_location());
Disassembler::decode(s->code_begin(), s->code_end());
}
+ // Notify JVMTI about this stub. The event will be recorded by the enclosing
+ // JvmtiDynamicCodeEventCollector and posted when this thread has released
+ // all locks.
+ if (JvmtiExport::should_post_dynamic_code_generated()) {
+ JvmtiExport::post_dynamic_code_generated_while_holding_locks(is_vtable_stub? "vtable stub": "itable stub",
+ s->code_begin(), s->code_end());
+ }
}
return s->entry_point();
}
@@ -195,6 +199,14 @@ void vtableStubs_init() {
VtableStubs::initialize();
}
+void VtableStubs::vtable_stub_do(void f(VtableStub*)) {
+ for (int i = 0; i < N; i++) {
+ for (VtableStub* s = _table[i]; s != NULL; s = s->next()) {
+ f(s);
+ }
+ }
+}
+
//-----------------------------------------------------------------------------------------------------
// Non-product code