comparison src/share/vm/opto/macro.cpp @ 124:b130b98db9cf

6689060: Escape Analysis does not work with Compressed Oops Summary: 64-bits VM crashes with -XX:+AggresiveOpts (Escape Analysis + Compressed Oops) Reviewed-by: never, sgoldman
author kvn
date Wed, 23 Apr 2008 11:20:36 -0700
parents ba764ed4b6f2
children 885ed790ecf0 37f87013dfd8
comparison
equal deleted inserted replaced
123:9e5a7340635e 124:b130b98db9cf
582 offset = array_base + j * element_size; 582 offset = array_base + j * element_size;
583 } 583 }
584 584
585 const Type *field_type; 585 const Type *field_type;
586 // The next code is taken from Parse::do_get_xxx(). 586 // The next code is taken from Parse::do_get_xxx().
587 if (basic_elem_type == T_OBJECT) { 587 if (basic_elem_type == T_OBJECT || basic_elem_type == T_ARRAY) {
588 if (!elem_type->is_loaded()) { 588 if (!elem_type->is_loaded()) {
589 field_type = TypeInstPtr::BOTTOM; 589 field_type = TypeInstPtr::BOTTOM;
590 } else if (field != NULL && field->is_constant()) { 590 } else if (field != NULL && field->is_constant()) {
591 // This can happen if the constant oop is non-perm. 591 // This can happen if the constant oop is non-perm.
592 ciObject* con = field->constant_value().as_object(); 592 ciObject* con = field->constant_value().as_object();
594 // and may yield a vacuous result if the field is of interface type. 594 // and may yield a vacuous result if the field is of interface type.
595 field_type = TypeOopPtr::make_from_constant(con)->isa_oopptr(); 595 field_type = TypeOopPtr::make_from_constant(con)->isa_oopptr();
596 assert(field_type != NULL, "field singleton type must be consistent"); 596 assert(field_type != NULL, "field singleton type must be consistent");
597 } else { 597 } else {
598 field_type = TypeOopPtr::make_from_klass(elem_type->as_klass()); 598 field_type = TypeOopPtr::make_from_klass(elem_type->as_klass());
599 }
600 if (UseCompressedOops) {
601 field_type = field_type->is_oopptr()->make_narrowoop();
602 basic_elem_type = T_NARROWOOP;
599 } 603 }
600 } else { 604 } else {
601 field_type = Type::get_const_basic_type(basic_elem_type); 605 field_type = Type::get_const_basic_type(basic_elem_type);
602 } 606 }
603 607
657 res->dump(); 661 res->dump();
658 } 662 }
659 #endif 663 #endif
660 return false; 664 return false;
661 } 665 }
666 if (UseCompressedOops && field_type->isa_narrowoop()) {
667 // Enable "DecodeN(EncodeP(Allocate)) --> Allocate" transformation
668 // to be able scalar replace the allocation.
669 _igvn.set_delay_transform(false);
670 field_val = DecodeNNode::decode(&_igvn, field_val);
671 _igvn.set_delay_transform(true);
672 }
662 sfpt->add_req(field_val); 673 sfpt->add_req(field_val);
663 } 674 }
664 JVMState *jvms = sfpt->jvms(); 675 JVMState *jvms = sfpt->jvms();
665 jvms->set_endoff(sfpt->req()); 676 jvms->set_endoff(sfpt->req());
666 // Now make a pass over the debug information replacing any references 677 // Now make a pass over the debug information replacing any references