comparison src/share/vm/opto/cfgnode.cpp @ 163:885ed790ecf0

6695810: null oop passed to encode_heap_oop_not_null Summary: fix several problems in C2 related to Escape Analysis and Compressed Oops. Reviewed-by: never, jrose
author kvn
date Wed, 21 May 2008 10:45:07 -0700
parents e0bd2e08e3d0
children 65fe2bd88839
comparison
equal deleted inserted replaced
162:8aa010f60e0f 163:885ed790ecf0
705 } 705 }
706 706
707 //------------------------split_out_instance----------------------------------- 707 //------------------------split_out_instance-----------------------------------
708 // Split out an instance type from a bottom phi. 708 // Split out an instance type from a bottom phi.
709 PhiNode* PhiNode::split_out_instance(const TypePtr* at, PhaseIterGVN *igvn) const { 709 PhiNode* PhiNode::split_out_instance(const TypePtr* at, PhaseIterGVN *igvn) const {
710 assert(type() == Type::MEMORY && (adr_type() == TypePtr::BOTTOM || 710 const TypeOopPtr *t_oop = at->isa_oopptr();
711 adr_type() == TypeRawPtr::BOTTOM) , "bottom or raw memory required"); 711 assert(t_oop != NULL && t_oop->is_instance(), "expecting instance oopptr");
712 const TypePtr *t = adr_type();
713 assert(type() == Type::MEMORY &&
714 (t == TypePtr::BOTTOM || t == TypeRawPtr::BOTTOM ||
715 t->isa_oopptr() && !t->is_oopptr()->is_instance() &&
716 t->is_oopptr()->cast_to_instance(t_oop->instance_id()) == t_oop),
717 "bottom or raw memory required");
712 718
713 // Check if an appropriate node already exists. 719 // Check if an appropriate node already exists.
714 Node *region = in(0); 720 Node *region = in(0);
715 for (DUIterator_Fast kmax, k = region->fast_outs(kmax); k < kmax; k++) { 721 for (DUIterator_Fast kmax, k = region->fast_outs(kmax); k < kmax; k++) {
716 Node* use = region->fast_out(k); 722 Node* use = region->fast_out(k);
1340 uint i; 1346 uint i;
1341 for( i = 1; i < phi->req()-1; i++ ) { 1347 for( i = 1; i < phi->req()-1; i++ ) {
1342 Node *n = phi->in(i); 1348 Node *n = phi->in(i);
1343 if( !n ) return NULL; 1349 if( !n ) return NULL;
1344 if( phase->type(n) == Type::TOP ) return NULL; 1350 if( phase->type(n) == Type::TOP ) return NULL;
1345 if( n->Opcode() == Op_ConP ) 1351 if( n->Opcode() == Op_ConP || n->Opcode() == Op_ConN )
1346 break; 1352 break;
1347 } 1353 }
1348 if( i >= phi->req() ) // Only split for constants 1354 if( i >= phi->req() ) // Only split for constants
1349 return NULL; 1355 return NULL;
1350 1356