< prev index next >

src/hotspot/share/oops/methodData.cpp

Print this page




 524 // lock.  We require the caller to take the lock before making the ProfileData
 525 // structure.  Currently the only caller is InterpreterRuntime::update_mdp_for_ret
 526 address RetData::fixup_ret(int return_bci, MethodData* h_mdo) {
 527   // First find the mdp which corresponds to the return bci.
 528   address mdp = h_mdo->bci_to_dp(return_bci);
 529 
 530   // Now check to see if any of the cache slots are open.
 531   for (uint row = 0; row < row_limit(); row++) {
 532     if (bci(row) == no_bci) {
 533       set_bci_displacement(row, mdp - dp());
 534       set_bci_count(row, DataLayout::counter_increment);
 535       // Barrier to ensure displacement is written before the bci; allows
 536       // the interpreter to read displacement without fear of race condition.
 537       release_set_bci(row, return_bci);
 538       break;
 539     }
 540   }
 541   return mdp;
 542 }
 543 
 544 #ifdef CC_INTERP
 545 DataLayout* RetData::advance(MethodData *md, int bci) {
 546   return (DataLayout*) md->bci_to_dp(bci);
 547 }
 548 #endif // CC_INTERP
 549 
 550 void RetData::print_data_on(outputStream* st, const char* extra) const {
 551   print_shared(st, "RetData", extra);
 552   uint row;
 553   int entries = 0;
 554   for (row = 0; row < row_limit(); row++) {
 555     if (bci(row) != no_bci)  entries++;
 556   }
 557   st->print_cr("count(%u) entries(%u)", count(), entries);
 558   for (row = 0; row < row_limit(); row++) {
 559     if (bci(row) != no_bci) {
 560       tab(st);
 561       st->print_cr("bci(%d: count(%u) displacement(%d))",
 562                    bci(row), bci_count(row), bci_displacement(row));
 563     }
 564   }
 565 }
 566 
 567 // ==================================================================
 568 // BranchData
 569 //




 524 // lock.  We require the caller to take the lock before making the ProfileData
 525 // structure.  Currently the only caller is InterpreterRuntime::update_mdp_for_ret
 526 address RetData::fixup_ret(int return_bci, MethodData* h_mdo) {
 527   // First find the mdp which corresponds to the return bci.
 528   address mdp = h_mdo->bci_to_dp(return_bci);
 529 
 530   // Now check to see if any of the cache slots are open.
 531   for (uint row = 0; row < row_limit(); row++) {
 532     if (bci(row) == no_bci) {
 533       set_bci_displacement(row, mdp - dp());
 534       set_bci_count(row, DataLayout::counter_increment);
 535       // Barrier to ensure displacement is written before the bci; allows
 536       // the interpreter to read displacement without fear of race condition.
 537       release_set_bci(row, return_bci);
 538       break;
 539     }
 540   }
 541   return mdp;
 542 }
 543 






 544 void RetData::print_data_on(outputStream* st, const char* extra) const {
 545   print_shared(st, "RetData", extra);
 546   uint row;
 547   int entries = 0;
 548   for (row = 0; row < row_limit(); row++) {
 549     if (bci(row) != no_bci)  entries++;
 550   }
 551   st->print_cr("count(%u) entries(%u)", count(), entries);
 552   for (row = 0; row < row_limit(); row++) {
 553     if (bci(row) != no_bci) {
 554       tab(st);
 555       st->print_cr("bci(%d: count(%u) displacement(%d))",
 556                    bci(row), bci_count(row), bci_displacement(row));
 557     }
 558   }
 559 }
 560 
 561 // ==================================================================
 562 // BranchData
 563 //


< prev index next >