606 } |
606 } |
607 offset = Type::OffsetBot; |
607 offset = Type::OffsetBot; |
608 return NULL; |
608 return NULL; |
609 } |
609 } |
610 |
610 |
|
611 //------------------------------unpack_offsets---------------------------------- |
|
612 // Collect the AddP offset values into the elements array, giving up |
|
613 // if there are more than length. |
|
614 int AddPNode::unpack_offsets(Node* elements[], int length) { |
|
615 int count = 0; |
|
616 Node* addr = this; |
|
617 Node* base = addr->in(AddPNode::Base); |
|
618 while (addr->is_AddP()) { |
|
619 if (addr->in(AddPNode::Base) != base) { |
|
620 // give up |
|
621 return -1; |
|
622 } |
|
623 elements[count++] = addr->in(AddPNode::Offset); |
|
624 if (count == length) { |
|
625 // give up |
|
626 return -1; |
|
627 } |
|
628 addr = addr->in(AddPNode::Address); |
|
629 } |
|
630 return count; |
|
631 } |
|
632 |
611 //------------------------------match_edge------------------------------------- |
633 //------------------------------match_edge------------------------------------- |
612 // Do we Match on this edge index or not? Do not match base pointer edge |
634 // Do we Match on this edge index or not? Do not match base pointer edge |
613 uint AddPNode::match_edge(uint idx) const { |
635 uint AddPNode::match_edge(uint idx) const { |
614 return idx > Base; |
636 return idx > Base; |
615 } |
637 } |