Mercurial > hg > truffle
comparison src/share/vm/compiler/oopMap.cpp @ 858:5314d85ffd54
6826736: CMS: core dump with -XX:+UseCompressedOops
Summary: Fix deoptimization code and OopMapSet::all_do() to check for oop = narrow_oop_base.
Reviewed-by: jcoomes, phh, ysr, never
author | kvn |
---|---|
date | Wed, 22 Jul 2009 15:48:51 -0700 |
parents | 4a4c365f777d |
children | 89e0543e1737 |
comparison
equal
deleted
inserted
replaced
857:17173cb6e48d | 858:5314d85ffd54 |
---|---|
377 omv = oms.current(); | 377 omv = oms.current(); |
378 oop* loc = fr->oopmapreg_to_location(omv.reg(),reg_map); | 378 oop* loc = fr->oopmapreg_to_location(omv.reg(),reg_map); |
379 if ( loc != NULL ) { | 379 if ( loc != NULL ) { |
380 oop *base_loc = fr->oopmapreg_to_location(omv.content_reg(), reg_map); | 380 oop *base_loc = fr->oopmapreg_to_location(omv.content_reg(), reg_map); |
381 oop *derived_loc = loc; | 381 oop *derived_loc = loc; |
382 derived_oop_fn(base_loc, derived_loc); | 382 oop val = *base_loc; |
383 if (val == (oop)NULL || Universe::is_narrow_oop_base(val)) { | |
384 // Ignore NULL oops and decoded NULL narrow oops which | |
385 // equal to Universe::narrow_oop_base when a narrow oop | |
386 // implicit null check is used in compiled code. | |
387 // The narrow_oop_base could be NULL or be the address | |
388 // of the page below heap depending on compressed oops mode. | |
389 } else | |
390 derived_oop_fn(base_loc, derived_loc); | |
383 } | 391 } |
384 oms.next(); | 392 oms.next(); |
385 } while (!oms.is_done()); | 393 } while (!oms.is_done()); |
386 } | 394 } |
387 } | 395 } |
392 for (OopMapStream oms(map,mask); !oms.is_done(); oms.next()) { | 400 for (OopMapStream oms(map,mask); !oms.is_done(); oms.next()) { |
393 omv = oms.current(); | 401 omv = oms.current(); |
394 oop* loc = fr->oopmapreg_to_location(omv.reg(),reg_map); | 402 oop* loc = fr->oopmapreg_to_location(omv.reg(),reg_map); |
395 if ( loc != NULL ) { | 403 if ( loc != NULL ) { |
396 if ( omv.type() == OopMapValue::oop_value ) { | 404 if ( omv.type() == OopMapValue::oop_value ) { |
405 oop val = *loc; | |
406 if (val == (oop)NULL || Universe::is_narrow_oop_base(val)) { | |
407 // Ignore NULL oops and decoded NULL narrow oops which | |
408 // equal to Universe::narrow_oop_base when a narrow oop | |
409 // implicit null check is used in compiled code. | |
410 // The narrow_oop_base could be NULL or be the address | |
411 // of the page below heap depending on compressed oops mode. | |
412 continue; | |
413 } | |
397 #ifdef ASSERT | 414 #ifdef ASSERT |
398 if ((((uintptr_t)loc & (sizeof(*loc)-1)) != 0) || | 415 if ((((uintptr_t)loc & (sizeof(*loc)-1)) != 0) || |
399 !Universe::heap()->is_in_or_null(*loc)) { | 416 !Universe::heap()->is_in_or_null(*loc)) { |
400 tty->print_cr("# Found non oop pointer. Dumping state at failure"); | 417 tty->print_cr("# Found non oop pointer. Dumping state at failure"); |
401 // try to dump out some helpful debugging information | 418 // try to dump out some helpful debugging information |
408 assert(Universe::heap()->is_in_or_null(*loc), "found non oop pointer"); | 425 assert(Universe::heap()->is_in_or_null(*loc), "found non oop pointer"); |
409 } | 426 } |
410 #endif // ASSERT | 427 #endif // ASSERT |
411 oop_fn->do_oop(loc); | 428 oop_fn->do_oop(loc); |
412 } else if ( omv.type() == OopMapValue::value_value ) { | 429 } else if ( omv.type() == OopMapValue::value_value ) { |
430 assert((*loc) == (oop)NULL || !Universe::is_narrow_oop_base(*loc), | |
431 "found invalid value pointer"); | |
413 value_fn->do_oop(loc); | 432 value_fn->do_oop(loc); |
414 } else if ( omv.type() == OopMapValue::narrowoop_value ) { | 433 } else if ( omv.type() == OopMapValue::narrowoop_value ) { |
415 narrowOop *nl = (narrowOop*)loc; | 434 narrowOop *nl = (narrowOop*)loc; |
416 #ifndef VM_LITTLE_ENDIAN | 435 #ifndef VM_LITTLE_ENDIAN |
417 if (!omv.reg()->is_stack()) { | 436 if (!omv.reg()->is_stack()) { |