comparison src/share/vm/opto/matcher.cpp @ 6804:e626685e9f6c

7193318: C2: remove number of inputs requirement from Node's new operator Summary: Deleted placement new operator of Node - node(size_t, Compile *, int). Reviewed-by: kvn, twisti Contributed-by: bharadwaj.yadavalli@oracle.com
author kvn
date Thu, 27 Sep 2012 09:38:42 -0700
parents 7eca5de9e0b6
children 8e47bac5643a
comparison
equal deleted inserted replaced
6803:06f52c4d0e18 6804:e626685e9f6c
725 ret_rms [ ret_edge_cnt].Insert(OptoReg::Name(i+1)); 725 ret_rms [ ret_edge_cnt].Insert(OptoReg::Name(i+1));
726 reth_rms [ reth_edge_cnt].Insert(OptoReg::Name(i+1)); 726 reth_rms [ reth_edge_cnt].Insert(OptoReg::Name(i+1));
727 tail_call_rms[tail_call_edge_cnt].Insert(OptoReg::Name(i+1)); 727 tail_call_rms[tail_call_edge_cnt].Insert(OptoReg::Name(i+1));
728 tail_jump_rms[tail_jump_edge_cnt].Insert(OptoReg::Name(i+1)); 728 tail_jump_rms[tail_jump_edge_cnt].Insert(OptoReg::Name(i+1));
729 halt_rms [ halt_edge_cnt].Insert(OptoReg::Name(i+1)); 729 halt_rms [ halt_edge_cnt].Insert(OptoReg::Name(i+1));
730 mproj = new (C, 1) MachProjNode( start, proj_cnt, ret_rms[ret_edge_cnt], Op_RegD ); 730 mproj = new (C) MachProjNode( start, proj_cnt, ret_rms[ret_edge_cnt], Op_RegD );
731 proj_cnt += 2; // Skip 2 for doubles 731 proj_cnt += 2; // Skip 2 for doubles
732 } 732 }
733 else if( (i&1) == 1 && // Else check for high half of double 733 else if( (i&1) == 1 && // Else check for high half of double
734 _register_save_type[i-1] == Op_RegF && 734 _register_save_type[i-1] == Op_RegF &&
735 _register_save_type[i ] == Op_RegF && 735 _register_save_type[i ] == Op_RegF &&
751 ret_rms [ ret_edge_cnt].Insert(OptoReg::Name(i+1)); 751 ret_rms [ ret_edge_cnt].Insert(OptoReg::Name(i+1));
752 reth_rms [ reth_edge_cnt].Insert(OptoReg::Name(i+1)); 752 reth_rms [ reth_edge_cnt].Insert(OptoReg::Name(i+1));
753 tail_call_rms[tail_call_edge_cnt].Insert(OptoReg::Name(i+1)); 753 tail_call_rms[tail_call_edge_cnt].Insert(OptoReg::Name(i+1));
754 tail_jump_rms[tail_jump_edge_cnt].Insert(OptoReg::Name(i+1)); 754 tail_jump_rms[tail_jump_edge_cnt].Insert(OptoReg::Name(i+1));
755 halt_rms [ halt_edge_cnt].Insert(OptoReg::Name(i+1)); 755 halt_rms [ halt_edge_cnt].Insert(OptoReg::Name(i+1));
756 mproj = new (C, 1) MachProjNode( start, proj_cnt, ret_rms[ret_edge_cnt], Op_RegL ); 756 mproj = new (C) MachProjNode( start, proj_cnt, ret_rms[ret_edge_cnt], Op_RegL );
757 proj_cnt += 2; // Skip 2 for longs 757 proj_cnt += 2; // Skip 2 for longs
758 } 758 }
759 else if( (i&1) == 1 && // Else check for high half of long 759 else if( (i&1) == 1 && // Else check for high half of long
760 _register_save_type[i-1] == Op_RegI && 760 _register_save_type[i-1] == Op_RegI &&
761 _register_save_type[i ] == Op_RegI && 761 _register_save_type[i ] == Op_RegI &&
766 tail_jump_rms[tail_jump_edge_cnt] = RegMask::Empty; 766 tail_jump_rms[tail_jump_edge_cnt] = RegMask::Empty;
767 halt_rms [ halt_edge_cnt] = RegMask::Empty; 767 halt_rms [ halt_edge_cnt] = RegMask::Empty;
768 mproj = C->top(); 768 mproj = C->top();
769 } else { 769 } else {
770 // Make a projection for it off the Start 770 // Make a projection for it off the Start
771 mproj = new (C, 1) MachProjNode( start, proj_cnt++, ret_rms[ret_edge_cnt], _register_save_type[i] ); 771 mproj = new (C) MachProjNode( start, proj_cnt++, ret_rms[ret_edge_cnt], _register_save_type[i] );
772 } 772 }
773 773
774 ret_edge_cnt ++; 774 ret_edge_cnt ++;
775 reth_edge_cnt ++; 775 reth_edge_cnt ++;
776 tail_call_edge_cnt ++; 776 tail_call_edge_cnt ++;
819 // Share frame pointer while making spill ops 819 // Share frame pointer while making spill ops
820 set_shared(fp); 820 set_shared(fp);
821 821
822 // Compute generic short-offset Loads 822 // Compute generic short-offset Loads
823 #ifdef _LP64 823 #ifdef _LP64
824 MachNode *spillCP = match_tree(new (C, 3) LoadNNode(NULL,mem,fp,atp,TypeInstPtr::BOTTOM)); 824 MachNode *spillCP = match_tree(new (C) LoadNNode(NULL,mem,fp,atp,TypeInstPtr::BOTTOM));
825 #endif 825 #endif
826 MachNode *spillI = match_tree(new (C, 3) LoadINode(NULL,mem,fp,atp)); 826 MachNode *spillI = match_tree(new (C) LoadINode(NULL,mem,fp,atp));
827 MachNode *spillL = match_tree(new (C, 3) LoadLNode(NULL,mem,fp,atp)); 827 MachNode *spillL = match_tree(new (C) LoadLNode(NULL,mem,fp,atp));
828 MachNode *spillF = match_tree(new (C, 3) LoadFNode(NULL,mem,fp,atp)); 828 MachNode *spillF = match_tree(new (C) LoadFNode(NULL,mem,fp,atp));
829 MachNode *spillD = match_tree(new (C, 3) LoadDNode(NULL,mem,fp,atp)); 829 MachNode *spillD = match_tree(new (C) LoadDNode(NULL,mem,fp,atp));
830 MachNode *spillP = match_tree(new (C, 3) LoadPNode(NULL,mem,fp,atp,TypeInstPtr::BOTTOM)); 830 MachNode *spillP = match_tree(new (C) LoadPNode(NULL,mem,fp,atp,TypeInstPtr::BOTTOM));
831 assert(spillI != NULL && spillL != NULL && spillF != NULL && 831 assert(spillI != NULL && spillL != NULL && spillF != NULL &&
832 spillD != NULL && spillP != NULL, ""); 832 spillD != NULL && spillP != NULL, "");
833 833
834 // Get the ADLC notion of the right regmask, for each basic type. 834 // Get the ADLC notion of the right regmask, for each basic type.
835 #ifdef _LP64 835 #ifdef _LP64
842 idealreg2regmask[Op_RegP] = &spillP->out_RegMask(); 842 idealreg2regmask[Op_RegP] = &spillP->out_RegMask();
843 843
844 // Vector regmasks. 844 // Vector regmasks.
845 if (Matcher::vector_size_supported(T_BYTE,4)) { 845 if (Matcher::vector_size_supported(T_BYTE,4)) {
846 TypeVect::VECTS = TypeVect::make(T_BYTE, 4); 846 TypeVect::VECTS = TypeVect::make(T_BYTE, 4);
847 MachNode *spillVectS = match_tree(new (C, 3) LoadVectorNode(NULL,mem,fp,atp,TypeVect::VECTS)); 847 MachNode *spillVectS = match_tree(new (C) LoadVectorNode(NULL,mem,fp,atp,TypeVect::VECTS));
848 idealreg2regmask[Op_VecS] = &spillVectS->out_RegMask(); 848 idealreg2regmask[Op_VecS] = &spillVectS->out_RegMask();
849 } 849 }
850 if (Matcher::vector_size_supported(T_FLOAT,2)) { 850 if (Matcher::vector_size_supported(T_FLOAT,2)) {
851 MachNode *spillVectD = match_tree(new (C, 3) LoadVectorNode(NULL,mem,fp,atp,TypeVect::VECTD)); 851 MachNode *spillVectD = match_tree(new (C) LoadVectorNode(NULL,mem,fp,atp,TypeVect::VECTD));
852 idealreg2regmask[Op_VecD] = &spillVectD->out_RegMask(); 852 idealreg2regmask[Op_VecD] = &spillVectD->out_RegMask();
853 } 853 }
854 if (Matcher::vector_size_supported(T_FLOAT,4)) { 854 if (Matcher::vector_size_supported(T_FLOAT,4)) {
855 MachNode *spillVectX = match_tree(new (C, 3) LoadVectorNode(NULL,mem,fp,atp,TypeVect::VECTX)); 855 MachNode *spillVectX = match_tree(new (C) LoadVectorNode(NULL,mem,fp,atp,TypeVect::VECTX));
856 idealreg2regmask[Op_VecX] = &spillVectX->out_RegMask(); 856 idealreg2regmask[Op_VecX] = &spillVectX->out_RegMask();
857 } 857 }
858 if (Matcher::vector_size_supported(T_FLOAT,8)) { 858 if (Matcher::vector_size_supported(T_FLOAT,8)) {
859 MachNode *spillVectY = match_tree(new (C, 3) LoadVectorNode(NULL,mem,fp,atp,TypeVect::VECTY)); 859 MachNode *spillVectY = match_tree(new (C) LoadVectorNode(NULL,mem,fp,atp,TypeVect::VECTY));
860 idealreg2regmask[Op_VecY] = &spillVectY->out_RegMask(); 860 idealreg2regmask[Op_VecY] = &spillVectY->out_RegMask();
861 } 861 }
862 } 862 }
863 863
864 #ifdef ASSERT 864 #ifdef ASSERT
1301 // any legacy C-killed slots. Use Fat-Projections to do the killing. 1301 // any legacy C-killed slots. Use Fat-Projections to do the killing.
1302 // Since the max-per-method covers the max-per-call-site and debug info 1302 // Since the max-per-method covers the max-per-call-site and debug info
1303 // is excluded on the max-per-method basis, debug info cannot land in 1303 // is excluded on the max-per-method basis, debug info cannot land in
1304 // this killed area. 1304 // this killed area.
1305 uint r_cnt = mcall->tf()->range()->cnt(); 1305 uint r_cnt = mcall->tf()->range()->cnt();
1306 MachProjNode *proj = new (C, 1) MachProjNode( mcall, r_cnt+10000, RegMask::Empty, MachProjNode::fat_proj ); 1306 MachProjNode *proj = new (C) MachProjNode( mcall, r_cnt+10000, RegMask::Empty, MachProjNode::fat_proj );
1307 if (!RegMask::can_represent_arg(OptoReg::Name(out_arg_limit_per_call-1))) { 1307 if (!RegMask::can_represent_arg(OptoReg::Name(out_arg_limit_per_call-1))) {
1308 C->record_method_not_compilable_all_tiers("unsupported outgoing calling sequence"); 1308 C->record_method_not_compilable_all_tiers("unsupported outgoing calling sequence");
1309 } else { 1309 } else {
1310 for (int i = begin_out_arg_area; i < out_arg_limit_per_call; i++) 1310 for (int i = begin_out_arg_area; i < out_arg_limit_per_call; i++)
1311 proj->_rout.Insert(OptoReg::Name(i)); 1311 proj->_rout.Insert(OptoReg::Name(i));
2133 case Op_CompareAndSwapL: 2133 case Op_CompareAndSwapL:
2134 case Op_CompareAndSwapP: 2134 case Op_CompareAndSwapP:
2135 case Op_CompareAndSwapN: { // Convert trinary to binary-tree 2135 case Op_CompareAndSwapN: { // Convert trinary to binary-tree
2136 Node *newval = n->in(MemNode::ValueIn ); 2136 Node *newval = n->in(MemNode::ValueIn );
2137 Node *oldval = n->in(LoadStoreConditionalNode::ExpectedIn); 2137 Node *oldval = n->in(LoadStoreConditionalNode::ExpectedIn);
2138 Node *pair = new (C, 3) BinaryNode( oldval, newval ); 2138 Node *pair = new (C) BinaryNode( oldval, newval );
2139 n->set_req(MemNode::ValueIn,pair); 2139 n->set_req(MemNode::ValueIn,pair);
2140 n->del_req(LoadStoreConditionalNode::ExpectedIn); 2140 n->del_req(LoadStoreConditionalNode::ExpectedIn);
2141 break; 2141 break;
2142 } 2142 }
2143 case Op_CMoveD: // Convert trinary to binary-tree 2143 case Op_CMoveD: // Convert trinary to binary-tree
2148 case Op_CMoveP: { 2148 case Op_CMoveP: {
2149 // Restructure into a binary tree for Matching. It's possible that 2149 // Restructure into a binary tree for Matching. It's possible that
2150 // we could move this code up next to the graph reshaping for IfNodes 2150 // we could move this code up next to the graph reshaping for IfNodes
2151 // or vice-versa, but I do not want to debug this for Ladybird. 2151 // or vice-versa, but I do not want to debug this for Ladybird.
2152 // 10/2/2000 CNC. 2152 // 10/2/2000 CNC.
2153 Node *pair1 = new (C, 3) BinaryNode(n->in(1),n->in(1)->in(1)); 2153 Node *pair1 = new (C) BinaryNode(n->in(1),n->in(1)->in(1));
2154 n->set_req(1,pair1); 2154 n->set_req(1,pair1);
2155 Node *pair2 = new (C, 3) BinaryNode(n->in(2),n->in(3)); 2155 Node *pair2 = new (C) BinaryNode(n->in(2),n->in(3));
2156 n->set_req(2,pair2); 2156 n->set_req(2,pair2);
2157 n->del_req(3); 2157 n->del_req(3);
2158 break; 2158 break;
2159 } 2159 }
2160 case Op_LoopLimit: { 2160 case Op_LoopLimit: {
2161 Node *pair1 = new (C, 3) BinaryNode(n->in(1),n->in(2)); 2161 Node *pair1 = new (C) BinaryNode(n->in(1),n->in(2));
2162 n->set_req(1,pair1); 2162 n->set_req(1,pair1);
2163 n->set_req(2,n->in(3)); 2163 n->set_req(2,n->in(3));
2164 n->del_req(3); 2164 n->del_req(3);
2165 break; 2165 break;
2166 } 2166 }
2167 case Op_StrEquals: { 2167 case Op_StrEquals: {
2168 Node *pair1 = new (C, 3) BinaryNode(n->in(2),n->in(3)); 2168 Node *pair1 = new (C) BinaryNode(n->in(2),n->in(3));
2169 n->set_req(2,pair1); 2169 n->set_req(2,pair1);
2170 n->set_req(3,n->in(4)); 2170 n->set_req(3,n->in(4));
2171 n->del_req(4); 2171 n->del_req(4);
2172 break; 2172 break;
2173 } 2173 }
2174 case Op_StrComp: 2174 case Op_StrComp:
2175 case Op_StrIndexOf: { 2175 case Op_StrIndexOf: {
2176 Node *pair1 = new (C, 3) BinaryNode(n->in(2),n->in(3)); 2176 Node *pair1 = new (C) BinaryNode(n->in(2),n->in(3));
2177 n->set_req(2,pair1); 2177 n->set_req(2,pair1);
2178 Node *pair2 = new (C, 3) BinaryNode(n->in(4),n->in(5)); 2178 Node *pair2 = new (C) BinaryNode(n->in(4),n->in(5));
2179 n->set_req(3,pair2); 2179 n->set_req(3,pair2);
2180 n->del_req(5); 2180 n->del_req(5);
2181 n->del_req(4); 2181 n->del_req(4);
2182 break; 2182 break;
2183 } 2183 }