< prev index next >

src/share/vm/compiler/oopMap.cpp

Print this page




 256   for( i = 0; i < len; i++) {
 257     if( at(i)->offset() >= pc_offset )
 258       break;
 259   }
 260 
 261   assert( i < len, "oopmap not found" );
 262 
 263   OopMap* m = at(i);
 264   assert( m->offset() == pc_offset, "oopmap not found" );
 265   return m;
 266 }
 267 
 268 class DoNothingClosure: public OopClosure {
 269  public:
 270   void do_oop(oop* p)       {}
 271   void do_oop(narrowOop* p) {}
 272 };
 273 static DoNothingClosure do_nothing;
 274 
 275 static void add_derived_oop(oop* base, oop* derived) {
 276 #ifndef TIERED
 277   COMPILER1_PRESENT(ShouldNotReachHere();)
 278 #if INCLUDE_JVMCI
 279   if (UseJVMCICompiler) {
 280     ShouldNotReachHere();
 281   }
 282 #endif
 283 #endif // TIERED
 284 #if defined(COMPILER2) || INCLUDE_JVMCI
 285   DerivedPointerTable::add(derived, base);
 286 #endif // COMPILER2 || INCLUDE_JVMCI
 287 }
 288 
 289 
 290 #ifndef PRODUCT
 291 static void trace_codeblob_maps(const frame *fr, const RegisterMap *reg_map) {
 292   // Print oopmap and regmap
 293   tty->print_cr("------ ");
 294   CodeBlob* cb = fr->cb();
 295   const ImmutableOopMapSet* maps = cb->oop_maps();
 296   const ImmutableOopMap* map = cb->oop_map_for_return_address(fr->pc());
 297   map->print();
 298   if( cb->is_nmethod() ) {
 299     nmethod* nm = (nmethod*)cb;
 300     // native wrappers have no scope data, it is implied
 301     if (nm->is_native_method()) {
 302       tty->print("bci: 0 (native)");
 303     } else {


 456     VMReg reg = omv.content_reg();
 457     oop* loc = fr->oopmapreg_to_location(omv.reg(), reg_map);
 458     reg_map->set_location(reg, (address) loc);
 459     DEBUG_ONLY(nof_callee++;)
 460   }
 461 
 462   // Check that runtime stubs save all callee-saved registers
 463 #ifdef COMPILER2
 464   assert(cb->is_compiled_by_c1() || cb->is_compiled_by_jvmci() || !cb->is_runtime_stub() ||
 465          (nof_callee >= SAVED_ON_ENTRY_REG_COUNT || nof_callee >= C_SAVED_ON_ENTRY_REG_COUNT),
 466          "must save all");
 467 #endif // COMPILER2
 468 }
 469 
 470 //=============================================================================
 471 // Non-Product code
 472 
 473 #ifndef PRODUCT
 474 
 475 bool ImmutableOopMap::has_derived_pointer() const {
 476 #ifndef TIERED
 477   COMPILER1_PRESENT(return false);
 478 #if INCLUDE_JVMCI
 479   if (UseJVMCICompiler) {
 480     return false;
 481   }
 482 #endif
 483 #endif // !TIERED
 484 #if defined(COMPILER2) || INCLUDE_JVMCI
 485   OopMapStream oms(this,OopMapValue::derived_oop_value);
 486   return oms.is_done();
 487 #else
 488   return false;
 489 #endif // COMPILER2 || INCLUDE_JVMCI
 490 }
 491 
 492 #endif //PRODUCT
 493 
 494 // Printing code is present in product build for -XX:+PrintAssembly.
 495 
 496 static
 497 void print_register_type(OopMapValue::oop_types x, VMReg optional,
 498                          outputStream* st) {
 499   switch( x ) {
 500   case OopMapValue::oop_value:
 501     st->print("Oop");
 502     break;




 256   for( i = 0; i < len; i++) {
 257     if( at(i)->offset() >= pc_offset )
 258       break;
 259   }
 260 
 261   assert( i < len, "oopmap not found" );
 262 
 263   OopMap* m = at(i);
 264   assert( m->offset() == pc_offset, "oopmap not found" );
 265   return m;
 266 }
 267 
 268 class DoNothingClosure: public OopClosure {
 269  public:
 270   void do_oop(oop* p)       {}
 271   void do_oop(narrowOop* p) {}
 272 };
 273 static DoNothingClosure do_nothing;
 274 
 275 static void add_derived_oop(oop* base, oop* derived) {
 276 #if !defined(TIERED) && !defined(INCLUDE_JVMCI)
 277   COMPILER1_PRESENT(ShouldNotReachHere();)
 278 #endif // !defined(TIERED) && !defined(INCLUDE_JVMCI)





 279 #if defined(COMPILER2) || INCLUDE_JVMCI
 280   DerivedPointerTable::add(derived, base);
 281 #endif // COMPILER2 || INCLUDE_JVMCI
 282 }
 283 
 284 
 285 #ifndef PRODUCT
 286 static void trace_codeblob_maps(const frame *fr, const RegisterMap *reg_map) {
 287   // Print oopmap and regmap
 288   tty->print_cr("------ ");
 289   CodeBlob* cb = fr->cb();
 290   const ImmutableOopMapSet* maps = cb->oop_maps();
 291   const ImmutableOopMap* map = cb->oop_map_for_return_address(fr->pc());
 292   map->print();
 293   if( cb->is_nmethod() ) {
 294     nmethod* nm = (nmethod*)cb;
 295     // native wrappers have no scope data, it is implied
 296     if (nm->is_native_method()) {
 297       tty->print("bci: 0 (native)");
 298     } else {


 451     VMReg reg = omv.content_reg();
 452     oop* loc = fr->oopmapreg_to_location(omv.reg(), reg_map);
 453     reg_map->set_location(reg, (address) loc);
 454     DEBUG_ONLY(nof_callee++;)
 455   }
 456 
 457   // Check that runtime stubs save all callee-saved registers
 458 #ifdef COMPILER2
 459   assert(cb->is_compiled_by_c1() || cb->is_compiled_by_jvmci() || !cb->is_runtime_stub() ||
 460          (nof_callee >= SAVED_ON_ENTRY_REG_COUNT || nof_callee >= C_SAVED_ON_ENTRY_REG_COUNT),
 461          "must save all");
 462 #endif // COMPILER2
 463 }
 464 
 465 //=============================================================================
 466 // Non-Product code
 467 
 468 #ifndef PRODUCT
 469 
 470 bool ImmutableOopMap::has_derived_pointer() const {
 471 #if !defined(TIERED) && !defined(INCLUDE_JVMCI)
 472   COMPILER1_PRESENT(return false);





 473 #endif // !TIERED
 474 #if defined(COMPILER2) || INCLUDE_JVMCI
 475   OopMapStream oms(this,OopMapValue::derived_oop_value);
 476   return oms.is_done();
 477 #else
 478   return false;
 479 #endif // COMPILER2 || INCLUDE_JVMCI
 480 }
 481 
 482 #endif //PRODUCT
 483 
 484 // Printing code is present in product build for -XX:+PrintAssembly.
 485 
 486 static
 487 void print_register_type(OopMapValue::oop_types x, VMReg optional,
 488                          outputStream* st) {
 489   switch( x ) {
 490   case OopMapValue::oop_value:
 491     st->print("Oop");
 492     break;


< prev index next >