< prev index next >

src/hotspot/share/compiler/oopMap.cpp

Print this page




 344         omv = oms.current();
 345         oop* loc = fr->oopmapreg_to_location(omv.reg(),reg_map);
 346         guarantee(loc != NULL, "missing saved register");
 347         oop *derived_loc = loc;
 348         oop *base_loc    = fr->oopmapreg_to_location(omv.content_reg(), reg_map);
 349         // Ignore NULL oops and decoded NULL narrow oops which
 350         // equal to Universe::narrow_oop_base when a narrow oop
 351         // implicit null check is used in compiled code.
 352         // The narrow_oop_base could be NULL or be the address
 353         // of the page below heap depending on compressed oops mode.
 354         if (base_loc != NULL && *base_loc != (oop)NULL && !Universe::is_narrow_oop_base(*base_loc)) {
 355           derived_oop_fn(base_loc, derived_loc);
 356         }
 357         oms.next();
 358       }  while (!oms.is_done());
 359     }
 360   }
 361 
 362   // We want coop and oop oop_types
 363   int mask = OopMapValue::oop_value | OopMapValue::narrowoop_value;
 364   BufferedValuesDealiaser* dealiaser = NULL;
 365   {
 366     for (OopMapStream oms(map,mask); !oms.is_done(); oms.next()) {
 367       omv = oms.current();
 368       oop* loc = fr->oopmapreg_to_location(omv.reg(),reg_map);
 369       // It should be an error if no location can be found for a
 370       // register mentioned as contained an oop of some kind.  Maybe
 371       // this was allowed previously because value_value items might
 372       // be missing?
 373       guarantee(loc != NULL, "missing saved register");
 374       if ( omv.type() == OopMapValue::oop_value ) {
 375         oop val = *loc;
 376         if (val == (oop)NULL || Universe::is_narrow_oop_base(val)) {
 377           // Ignore NULL oops and decoded NULL narrow oops which
 378           // equal to Universe::narrow_oop_base when a narrow oop
 379           // implicit null check is used in compiled code.
 380           // The narrow_oop_base could be NULL or be the address
 381           // of the page below heap depending on compressed oops mode.
 382           continue;
 383         }
 384 #ifdef ASSERT
 385         // We can not verify the oop here if we are using ZGC, the oop
 386         // will be bad in case we had a safepoint between a load and a
 387         // load barrier.
 388         if (!UseZGC &&
 389             ((((uintptr_t)loc & (sizeof(*loc)-1)) != 0) ||
 390              (!Universe::heap()->is_in_or_null(*loc) && !VTBuffer::is_in_vt_buffer(*loc)))) {
 391           tty->print_cr("# Found non oop pointer.  Dumping state at failure");
 392           // try to dump out some helpful debugging information
 393           trace_codeblob_maps(fr, reg_map);
 394           omv.print();
 395           tty->print_cr("register r");
 396           omv.reg()->print();
 397           tty->print_cr("loc = %p *loc = %p\n", loc, (address)*loc);
 398           // do the real assert.
 399           assert(Universe::heap()->is_in_or_null(*loc) || VTBuffer::is_in_vt_buffer(*loc),
 400                  "found non oop pointer");
 401         }
 402 #endif // ASSERT
 403         if (!VTBuffer::is_in_vt_buffer(*loc)) {
 404           oop_fn->do_oop(loc);
 405         } else {
 406           assert((*loc)->is_value(), "Sanity check");
 407           if (dealiaser == NULL) {
 408             dealiaser = Thread::current()->buffered_values_dealiaser();
 409           }
 410           dealiaser->oops_do(oop_fn, *loc);
 411         }
 412       } else if ( omv.type() == OopMapValue::narrowoop_value ) {
 413         narrowOop *nl = (narrowOop*)loc;
 414 #ifndef VM_LITTLE_ENDIAN
 415         VMReg vmReg = omv.reg();
 416         // Don't do this on SPARC float registers as they can be individually addressed
 417         if (!vmReg->is_stack() SPARC_ONLY(&& !vmReg->is_FloatRegister())) {
 418           // compressed oops in registers only take up 4 bytes of an
 419           // 8 byte register but they are in the wrong part of the
 420           // word so adjust loc to point at the right place.
 421           nl = (narrowOop*)((address)nl + 4);
 422         }
 423 #endif
 424         oop_fn->do_oop(nl);
 425       }
 426     }
 427   }
 428 }
 429 
 430 
 431 // Update callee-saved register info for the following frame




 344         omv = oms.current();
 345         oop* loc = fr->oopmapreg_to_location(omv.reg(),reg_map);
 346         guarantee(loc != NULL, "missing saved register");
 347         oop *derived_loc = loc;
 348         oop *base_loc    = fr->oopmapreg_to_location(omv.content_reg(), reg_map);
 349         // Ignore NULL oops and decoded NULL narrow oops which
 350         // equal to Universe::narrow_oop_base when a narrow oop
 351         // implicit null check is used in compiled code.
 352         // The narrow_oop_base could be NULL or be the address
 353         // of the page below heap depending on compressed oops mode.
 354         if (base_loc != NULL && *base_loc != (oop)NULL && !Universe::is_narrow_oop_base(*base_loc)) {
 355           derived_oop_fn(base_loc, derived_loc);
 356         }
 357         oms.next();
 358       }  while (!oms.is_done());
 359     }
 360   }
 361 
 362   // We want coop and oop oop_types
 363   int mask = OopMapValue::oop_value | OopMapValue::narrowoop_value;

 364   {
 365     for (OopMapStream oms(map,mask); !oms.is_done(); oms.next()) {
 366       omv = oms.current();
 367       oop* loc = fr->oopmapreg_to_location(omv.reg(),reg_map);
 368       // It should be an error if no location can be found for a
 369       // register mentioned as contained an oop of some kind.  Maybe
 370       // this was allowed previously because value_value items might
 371       // be missing?
 372       guarantee(loc != NULL, "missing saved register");
 373       if ( omv.type() == OopMapValue::oop_value ) {
 374         oop val = *loc;
 375         if (val == (oop)NULL || Universe::is_narrow_oop_base(val)) {
 376           // Ignore NULL oops and decoded NULL narrow oops which
 377           // equal to Universe::narrow_oop_base when a narrow oop
 378           // implicit null check is used in compiled code.
 379           // The narrow_oop_base could be NULL or be the address
 380           // of the page below heap depending on compressed oops mode.
 381           continue;
 382         }
 383 #ifdef ASSERT
 384         // We can not verify the oop here if we are using ZGC, the oop
 385         // will be bad in case we had a safepoint between a load and a
 386         // load barrier.
 387         if (!UseZGC &&
 388             ((((uintptr_t)loc & (sizeof(*loc)-1)) != 0) ||
 389                 (!Universe::heap()->is_in_or_null(*loc)))) {
 390           tty->print_cr("# Found non oop pointer.  Dumping state at failure");
 391           // try to dump out some helpful debugging information
 392           trace_codeblob_maps(fr, reg_map);
 393           omv.print();
 394           tty->print_cr("register r");
 395           omv.reg()->print();
 396           tty->print_cr("loc = %p *loc = %p\n", loc, (address)*loc);
 397           // do the real assert.
 398           assert(Universe::heap()->is_in_or_null(*loc), "found non oop pointer");

 399         }
 400 #endif // ASSERT

 401         oop_fn->do_oop(loc);







 402       } else if ( omv.type() == OopMapValue::narrowoop_value ) {
 403         narrowOop *nl = (narrowOop*)loc;
 404 #ifndef VM_LITTLE_ENDIAN
 405         VMReg vmReg = omv.reg();
 406         // Don't do this on SPARC float registers as they can be individually addressed
 407         if (!vmReg->is_stack() SPARC_ONLY(&& !vmReg->is_FloatRegister())) {
 408           // compressed oops in registers only take up 4 bytes of an
 409           // 8 byte register but they are in the wrong part of the
 410           // word so adjust loc to point at the right place.
 411           nl = (narrowOop*)((address)nl + 4);
 412         }
 413 #endif
 414         oop_fn->do_oop(nl);
 415       }
 416     }
 417   }
 418 }
 419 
 420 
 421 // Update callee-saved register info for the following frame


< prev index next >