src/share/vm/oops/methodData.cpp

Print this page
rev 5190 : 8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
Summary: Implement profiling for c2 jit compilation. Also enable new cppInterpreter features.


 227 // lock.  We require the caller to take the lock before making the ProfileData
 228 // structure.  Currently the only caller is InterpreterRuntime::update_mdp_for_ret
 229 address RetData::fixup_ret(int return_bci, MethodData* h_mdo) {
 230   // First find the mdp which corresponds to the return bci.
 231   address mdp = h_mdo->bci_to_dp(return_bci);
 232 
 233   // Now check to see if any of the cache slots are open.
 234   for (uint row = 0; row < row_limit(); row++) {
 235     if (bci(row) == no_bci) {
 236       set_bci_displacement(row, mdp - dp());
 237       set_bci_count(row, DataLayout::counter_increment);
 238       // Barrier to ensure displacement is written before the bci; allows
 239       // the interpreter to read displacement without fear of race condition.
 240       release_set_bci(row, return_bci);
 241       break;
 242     }
 243   }
 244   return mdp;
 245 }
 246 





 247 
 248 #ifndef PRODUCT
 249 void RetData::print_data_on(outputStream* st) {
 250   print_shared(st, "RetData");
 251   uint row;
 252   int entries = 0;
 253   for (row = 0; row < row_limit(); row++) {
 254     if (bci(row) != no_bci)  entries++;
 255   }
 256   st->print_cr("count(%u) entries(%u)", count(), entries);
 257   for (row = 0; row < row_limit(); row++) {
 258     if (bci(row) != no_bci) {
 259       tab(st);
 260       st->print_cr("bci(%d: count(%u) displacement(%d))",
 261                    bci(row), bci_count(row), bci_displacement(row));
 262     }
 263   }
 264 }
 265 #endif // !PRODUCT
 266 




 227 // lock.  We require the caller to take the lock before making the ProfileData
 228 // structure.  Currently the only caller is InterpreterRuntime::update_mdp_for_ret
 229 address RetData::fixup_ret(int return_bci, MethodData* h_mdo) {
 230   // First find the mdp which corresponds to the return bci.
 231   address mdp = h_mdo->bci_to_dp(return_bci);
 232 
 233   // Now check to see if any of the cache slots are open.
 234   for (uint row = 0; row < row_limit(); row++) {
 235     if (bci(row) == no_bci) {
 236       set_bci_displacement(row, mdp - dp());
 237       set_bci_count(row, DataLayout::counter_increment);
 238       // Barrier to ensure displacement is written before the bci; allows
 239       // the interpreter to read displacement without fear of race condition.
 240       release_set_bci(row, return_bci);
 241       break;
 242     }
 243   }
 244   return mdp;
 245 }
 246 
 247 #ifdef CC_INTERP
 248 DataLayout* RetData::advance(MethodData *md, int bci) {
 249   return (DataLayout*) md->bci_to_dp(bci);
 250 }
 251 #endif // CC_INTERP
 252 
 253 #ifndef PRODUCT
 254 void RetData::print_data_on(outputStream* st) {
 255   print_shared(st, "RetData");
 256   uint row;
 257   int entries = 0;
 258   for (row = 0; row < row_limit(); row++) {
 259     if (bci(row) != no_bci)  entries++;
 260   }
 261   st->print_cr("count(%u) entries(%u)", count(), entries);
 262   for (row = 0; row < row_limit(); row++) {
 263     if (bci(row) != no_bci) {
 264       tab(st);
 265       st->print_cr("bci(%d: count(%u) displacement(%d))",
 266                    bci(row), bci_count(row), bci_displacement(row));
 267     }
 268   }
 269 }
 270 #endif // !PRODUCT
 271