3775 } else {
3776 mstack.push(conv, Pre_Visit);
3777 }
3778 address_visited.test_set(m->_idx); // Flag as address_visited
3779 mstack.push(m->in(AddPNode::Address), Pre_Visit);
3780 mstack.push(m->in(AddPNode::Base), Pre_Visit);
3781 return true;
3782 } else if (off->Opcode() == Op_ConvI2L &&
3783 // Are there other uses besides address expressions?
3784 !is_visited(off)) {
3785 address_visited.test_set(m->_idx); // Flag as address_visited
3786 address_visited.set(off->_idx); // Flag as address_visited
3787 mstack.push(off->in(1), Pre_Visit);
3788 mstack.push(m->in(AddPNode::Address), Pre_Visit);
3789 mstack.push(m->in(AddPNode::Base), Pre_Visit);
3790 return true;
3791 }
3792 return false;
3793 }
3794
3795 // Transform:
3796 // (AddP base (AddP base address (LShiftL index con)) offset)
3797 // into:
3798 // (AddP base (AddP base offset) (LShiftL index con))
3799 // to take full advantage of ARM's addressing modes
3800 void Compile::reshape_address(AddPNode* addp) {
3801 Node *addr = addp->in(AddPNode::Address);
3802 if (addr->is_AddP() && addr->in(AddPNode::Base) == addp->in(AddPNode::Base)) {
3803 const AddPNode *addp2 = addr->as_AddP();
3804 if ((addp2->in(AddPNode::Offset)->Opcode() == Op_LShiftL &&
3805 addp2->in(AddPNode::Offset)->in(2)->is_Con() &&
3806 size_fits_all_mem_uses(addp, addp2->in(AddPNode::Offset)->in(2)->get_int())) ||
3807 addp2->in(AddPNode::Offset)->Opcode() == Op_ConvI2L) {
3808
3809 // Any use that can't embed the address computation?
3810 for (DUIterator_Fast imax, i = addp->fast_outs(imax); i < imax; i++) {
3811 Node* u = addp->fast_out(i);
3812 if (!u->is_Mem()) {
3813 return;
3814 }
3815 if (u->is_LoadVector() || u->is_StoreVector() || u->Opcode() == Op_StoreCM) {
3816 return;
3817 }
3818 if (addp2->in(AddPNode::Offset)->Opcode() != Op_ConvI2L) {
3819 int scale = 1 << addp2->in(AddPNode::Offset)->in(2)->get_int();
3820 if (VM_Version::expensive_load(u->as_Mem()->memory_size(), scale)) {
3821 return;
3822 }
3823 }
3824 }
3825
3826 Node* off = addp->in(AddPNode::Offset);
3827 Node* addr2 = addp2->in(AddPNode::Address);
3828 Node* base = addp->in(AddPNode::Base);
3829
3830 Node* new_addr = NULL;
3831 // Check whether the graph already has the new AddP we need
3832 // before we create one (no GVN available here).
3833 for (DUIterator_Fast imax, i = addr2->fast_outs(imax); i < imax; i++) {
3834 Node* u = addr2->fast_out(i);
3835 if (u->is_AddP() &&
3836 u->in(AddPNode::Base) == base &&
3837 u->in(AddPNode::Address) == addr2 &&
3838 u->in(AddPNode::Offset) == off) {
3839 new_addr = u;
3840 break;
3841 }
3842 }
3843
3844 if (new_addr == NULL) {
3845 new_addr = new AddPNode(base, addr2, off);
3846 }
3847 Node* new_off = addp2->in(AddPNode::Offset);
3848 addp->set_req(AddPNode::Address, new_addr);
3849 if (addr->outcnt() == 0) {
3850 addr->disconnect_inputs(NULL, this);
3851 }
3852 addp->set_req(AddPNode::Offset, new_off);
3853 if (off->outcnt() == 0) {
3854 off->disconnect_inputs(NULL, this);
3855 }
3856 }
3857 }
3858 }
3859
3860 // helper for encoding java_to_runtime calls on sim
3861 //
3862 // this is needed to compute the extra arguments required when
3863 // planting a call to the simulator blrt instruction. the TypeFunc
3864 // can be queried to identify the counts for integral, and floating
3865 // arguments and the return type
3866
3867 static void getCallInfo(const TypeFunc *tf, int &gpcnt, int &fpcnt, int &rtype)
3868 {
3869 int gps = 0;
3870 int fps = 0;
3871 const TypeTuple *domain = tf->domain();
3872 int max = domain->cnt();
3873 for (int i = TypeFunc::Parms; i < max; i++) {
3874 const Type *t = domain->field_at(i);
3875 switch(t->basic_type()) {
3876 case T_FLOAT:
3877 case T_DOUBLE:
|
3775 } else {
3776 mstack.push(conv, Pre_Visit);
3777 }
3778 address_visited.test_set(m->_idx); // Flag as address_visited
3779 mstack.push(m->in(AddPNode::Address), Pre_Visit);
3780 mstack.push(m->in(AddPNode::Base), Pre_Visit);
3781 return true;
3782 } else if (off->Opcode() == Op_ConvI2L &&
3783 // Are there other uses besides address expressions?
3784 !is_visited(off)) {
3785 address_visited.test_set(m->_idx); // Flag as address_visited
3786 address_visited.set(off->_idx); // Flag as address_visited
3787 mstack.push(off->in(1), Pre_Visit);
3788 mstack.push(m->in(AddPNode::Address), Pre_Visit);
3789 mstack.push(m->in(AddPNode::Base), Pre_Visit);
3790 return true;
3791 }
3792 return false;
3793 }
3794
3795 void Compile::reshape_address(AddPNode* addp) {
3796 }
3797
3798 // helper for encoding java_to_runtime calls on sim
3799 //
3800 // this is needed to compute the extra arguments required when
3801 // planting a call to the simulator blrt instruction. the TypeFunc
3802 // can be queried to identify the counts for integral, and floating
3803 // arguments and the return type
3804
3805 static void getCallInfo(const TypeFunc *tf, int &gpcnt, int &fpcnt, int &rtype)
3806 {
3807 int gps = 0;
3808 int fps = 0;
3809 const TypeTuple *domain = tf->domain();
3810 int max = domain->cnt();
3811 for (int i = TypeFunc::Parms; i < max; i++) {
3812 const Type *t = domain->field_at(i);
3813 switch(t->basic_type()) {
3814 case T_FLOAT:
3815 case T_DOUBLE:
|