src/share/vm/code/vtableStubs.cpp

changeset 6310
22b3b2f888bc
parent 5762
891687731b59
child 6680
78bbf4d43a14
     1.1 --- a/src/share/vm/code/vtableStubs.cpp	Thu Jan 16 10:51:16 2014 -0800
     1.2 +++ b/src/share/vm/code/vtableStubs.cpp	Thu Feb 06 20:13:38 2014 -0800
     1.3 @@ -55,6 +55,9 @@
     1.4    const int chunk_factor = 32;
     1.5    if (_chunk == NULL || _chunk + real_size > _chunk_end) {
     1.6      const int bytes = chunk_factor * real_size + pd_code_alignment();
     1.7 +
     1.8 +   // There is a dependency on the name of the blob in src/share/vm/prims/jvmtiCodeBlobEvents.cpp
     1.9 +   // If changing the name, update the other file accordingly.
    1.10      BufferBlob* blob = BufferBlob::create("vtable chunks", bytes);
    1.11      if (blob == NULL) {
    1.12        return NULL;
    1.13 @@ -62,12 +65,6 @@
    1.14      _chunk = blob->content_begin();
    1.15      _chunk_end = _chunk + bytes;
    1.16      Forte::register_stub("vtable stub", _chunk, _chunk_end);
    1.17 -    // Notify JVMTI about this stub. The event will be recorded by the enclosing
    1.18 -    // JvmtiDynamicCodeEventCollector and posted when this thread has released
    1.19 -    // all locks.
    1.20 -    if (JvmtiExport::should_post_dynamic_code_generated()) {
    1.21 -      JvmtiExport::post_dynamic_code_generated_while_holding_locks("vtable stub", _chunk, _chunk_end);
    1.22 -    }
    1.23      align_chunk();
    1.24    }
    1.25    assert(_chunk + real_size <= _chunk_end, "bad allocation");
    1.26 @@ -130,6 +127,13 @@
    1.27                      is_vtable_stub? "vtbl": "itbl", vtable_index, VtableStub::receiver_location());
    1.28        Disassembler::decode(s->code_begin(), s->code_end());
    1.29      }
    1.30 +    // Notify JVMTI about this stub. The event will be recorded by the enclosing
    1.31 +    // JvmtiDynamicCodeEventCollector and posted when this thread has released
    1.32 +    // all locks.
    1.33 +    if (JvmtiExport::should_post_dynamic_code_generated()) {
    1.34 +      JvmtiExport::post_dynamic_code_generated_while_holding_locks(is_vtable_stub? "vtable stub": "itable stub",
    1.35 +                                                                   s->code_begin(), s->code_end());
    1.36 +    }
    1.37    }
    1.38    return s->entry_point();
    1.39  }
    1.40 @@ -195,6 +199,14 @@
    1.41    VtableStubs::initialize();
    1.42  }
    1.43  
    1.44 +void VtableStubs::vtable_stub_do(void f(VtableStub*)) {
    1.45 +    for (int i = 0; i < N; i++) {
    1.46 +        for (VtableStub* s = _table[i]; s != NULL; s = s->next()) {
    1.47 +            f(s);
    1.48 +        }
    1.49 +    }
    1.50 +}
    1.51 +
    1.52  
    1.53  //-----------------------------------------------------------------------------------------------------
    1.54  // Non-product code

mercurial