544 }
545
546 //=============================================================================
547 const Type *MachProjNode::bottom_type() const {
548 if( _ideal_reg == fat_proj ) return Type::BOTTOM;
549 // Try the normal mechanism first
550 const Type *t = in(0)->bottom_type();
551 if( t->base() == Type::Tuple ) {
552 const TypeTuple *tt = t->is_tuple();
553 if (_con < tt->cnt())
554 return tt->field_at(_con);
555 }
556 // Else use generic type from ideal register set
557 assert((uint)_ideal_reg < (uint)_last_machine_leaf && Type::mreg2type[_ideal_reg], "in bounds");
558 return Type::mreg2type[_ideal_reg];
559 }
560
561 const TypePtr *MachProjNode::adr_type() const {
562 if (bottom_type() == Type::MEMORY) {
563 // in(0) might be a narrow MemBar; otherwise we will report TypePtr::BOTTOM
564 const TypePtr* adr_type = in(0)->adr_type();
565 #ifdef ASSERT
566 if (!is_error_reported() && !Node::in_dump())
567 assert(adr_type != NULL, "source must have adr_type");
568 #endif
569 return adr_type;
570 }
571 assert(bottom_type()->base() != Type::Memory, "no other memories?");
572 return NULL;
573 }
574
575 #ifndef PRODUCT
576 void MachProjNode::dump_spec(outputStream *st) const {
577 ProjNode::dump_spec(st);
578 switch (_ideal_reg) {
579 case unmatched_proj: st->print("/unmatched"); break;
580 case fat_proj: st->print("/fat"); if (WizardMode) _rout.dump(); break;
581 }
582 }
583 #endif
584
|
544 }
545
546 //=============================================================================
547 const Type *MachProjNode::bottom_type() const {
548 if( _ideal_reg == fat_proj ) return Type::BOTTOM;
549 // Try the normal mechanism first
550 const Type *t = in(0)->bottom_type();
551 if( t->base() == Type::Tuple ) {
552 const TypeTuple *tt = t->is_tuple();
553 if (_con < tt->cnt())
554 return tt->field_at(_con);
555 }
556 // Else use generic type from ideal register set
557 assert((uint)_ideal_reg < (uint)_last_machine_leaf && Type::mreg2type[_ideal_reg], "in bounds");
558 return Type::mreg2type[_ideal_reg];
559 }
560
561 const TypePtr *MachProjNode::adr_type() const {
562 if (bottom_type() == Type::MEMORY) {
563 // in(0) might be a narrow MemBar; otherwise we will report TypePtr::BOTTOM
564 Node* ctrl = in(0);
565 if (ctrl == NULL) return NULL; // node is dead
566 const TypePtr* adr_type = ctrl->adr_type();
567 #ifdef ASSERT
568 if (!is_error_reported() && !Node::in_dump())
569 assert(adr_type != NULL, "source must have adr_type");
570 #endif
571 return adr_type;
572 }
573 assert(bottom_type()->base() != Type::Memory, "no other memories?");
574 return NULL;
575 }
576
577 #ifndef PRODUCT
578 void MachProjNode::dump_spec(outputStream *st) const {
579 ProjNode::dump_spec(st);
580 switch (_ideal_reg) {
581 case unmatched_proj: st->print("/unmatched"); break;
582 case fat_proj: st->print("/fat"); if (WizardMode) _rout.dump(); break;
583 }
584 }
585 #endif
586
|