src/share/vm/runtime/fprofiler.cpp

changeset 544
9f4457a14b58
parent 542
93b6525e3b82
child 631
d1605aabd0a1
     1.1 --- a/src/share/vm/runtime/fprofiler.cpp	Wed Apr 09 10:38:30 2008 -0400
     1.2 +++ b/src/share/vm/runtime/fprofiler.cpp	Wed Apr 09 15:10:22 2008 -0700
     1.3 @@ -924,29 +924,23 @@
     1.4    FlatProfiler::record_thread_ticks();
     1.5  }
     1.6  
     1.7 -void ThreadProfiler::record_interpreted_tick(frame fr, TickPosition where, int* ticks) {
     1.8 +void ThreadProfiler::record_interpreted_tick(JavaThread* thread, frame fr, TickPosition where, int* ticks) {
     1.9    FlatProfiler::all_int_ticks++;
    1.10    if (!FlatProfiler::full_profile()) {
    1.11      return;
    1.12    }
    1.13  
    1.14 -  if (!fr.is_interpreted_frame_valid()) {
    1.15 +  if (!fr.is_interpreted_frame_valid(thread)) {
    1.16      // tick came at a bad time
    1.17      interpreter_ticks += 1;
    1.18      FlatProfiler::interpreter_ticks += 1;
    1.19      return;
    1.20    }
    1.21  
    1.22 -  methodOop method = NULL;
    1.23 -  if (fr.fp() != NULL) {
    1.24 -    method = *fr.interpreter_frame_method_addr();
    1.25 -  }
    1.26 -  if (!Universe::heap()->is_valid_method(method)) {
    1.27 -    // tick came at a bad time, stack frame not initialized correctly
    1.28 -    interpreter_ticks += 1;
    1.29 -    FlatProfiler::interpreter_ticks += 1;
    1.30 -    return;
    1.31 -  }
    1.32 +  // The frame has been fully validated so we can trust the method and bci
    1.33 +
    1.34 +  methodOop method = *fr.interpreter_frame_method_addr();
    1.35 +
    1.36    interpreted_update(method, where);
    1.37  
    1.38    // update byte code table
    1.39 @@ -997,7 +991,7 @@
    1.40    // The tick happend in real code -> non VM code
    1.41    if (fr.is_interpreted_frame()) {
    1.42      interval_data_ref()->inc_interpreted();
    1.43 -    record_interpreted_tick(fr, tp_code, FlatProfiler::bytecode_ticks);
    1.44 +    record_interpreted_tick(thread, fr, tp_code, FlatProfiler::bytecode_ticks);
    1.45      return;
    1.46    }
    1.47  
    1.48 @@ -1028,7 +1022,7 @@
    1.49    // The tick happend in VM code
    1.50    interval_data_ref()->inc_native();
    1.51    if (fr.is_interpreted_frame()) {
    1.52 -    record_interpreted_tick(fr, tp_native, FlatProfiler::bytecode_ticks_stub);
    1.53 +    record_interpreted_tick(thread, fr, tp_native, FlatProfiler::bytecode_ticks_stub);
    1.54      return;
    1.55    }
    1.56    if (CodeCache::contains(fr.pc())) {

mercurial