< prev index next >

src/share/vm/opto/matcher.cpp

Print this page




 919       break;
 920     }
 921   }
 922   if (nidx == Compile::AliasIdxTop && midx == Compile::AliasIdxBot) {
 923     switch (n->Opcode()) {
 924     case Op_Return:
 925     case Op_Rethrow:
 926     case Op_Halt:
 927     case Op_TailCall:
 928     case Op_TailJump:
 929       nidx = Compile::AliasIdxBot;
 930       nat = TypePtr::BOTTOM;
 931       break;
 932     }
 933   }
 934   if (nidx == Compile::AliasIdxBot && midx == Compile::AliasIdxTop) {
 935     switch (n->Opcode()) {
 936     case Op_StrComp:
 937     case Op_StrEquals:
 938     case Op_StrIndexOf:

 939     case Op_AryEq:

 940     case Op_MemBarVolatile:
 941     case Op_MemBarCPUOrder: // %%% these ideals should have narrower adr_type?


 942     case Op_EncodeISOArray:
 943       nidx = Compile::AliasIdxTop;
 944       nat = NULL;
 945       break;
 946     }
 947   }
 948   if (nidx != midx) {
 949     if (PrintOpto || (PrintMiscellaneous && (WizardMode || Verbose))) {
 950       tty->print_cr("==== Matcher alias shift %d => %d", nidx, midx);
 951       n->dump();
 952       m->dump();
 953     }
 954     assert(C->subsume_loads() && C->must_alias(nat, midx),
 955            "must not lose alias info when matching");
 956   }
 957 }
 958 #endif
 959 
 960 
 961 //------------------------------MStack-----------------------------------------


2139       case Op_BoxLock:         // Cant match until we get stack-regs in ADLC
2140       case Op_IfFalse:
2141       case Op_IfTrue:
2142       case Op_MachProj:
2143       case Op_MergeMem:
2144       case Op_Catch:
2145       case Op_CatchProj:
2146       case Op_CProj:
2147       case Op_JumpProj:
2148       case Op_JProj:
2149       case Op_NeverBranch:
2150         set_dontcare(n);
2151         break;
2152       case Op_Jump:
2153         mstack.push(n->in(1), Pre_Visit);     // Switch Value (could be shared)
2154         mstack.push(n->in(0), Pre_Visit);     // Visit Control input
2155         continue;                             // while (mstack.is_nonempty())
2156       case Op_StrComp:
2157       case Op_StrEquals:
2158       case Op_StrIndexOf:

2159       case Op_AryEq:



2160       case Op_EncodeISOArray:
2161         set_shared(n); // Force result into register (it will be anyways)
2162         break;
2163       case Op_ConP: {  // Convert pointers above the centerline to NUL
2164         TypeNode *tn = n->as_Type(); // Constants derive from type nodes
2165         const TypePtr* tp = tn->type()->is_ptr();
2166         if (tp->_ptr == TypePtr::AnyNull) {
2167           tn->set_type(TypePtr::NULL_PTR);
2168         }
2169         break;
2170       }
2171       case Op_ConN: {  // Convert narrow pointers above the centerline to NUL
2172         TypeNode *tn = n->as_Type(); // Constants derive from type nodes
2173         const TypePtr* tp = tn->type()->make_ptr();
2174         if (tp && tp->_ptr == TypePtr::AnyNull) {
2175           tn->set_type(TypeNarrowOop::NULL_PTR);
2176         }
2177         break;
2178       }
2179       case Op_Binary:         // These are introduced in the Post_Visit state.


2318       case Op_CMoveN:
2319       case Op_CMoveP: {
2320         // Restructure into a binary tree for Matching.  It's possible that
2321         // we could move this code up next to the graph reshaping for IfNodes
2322         // or vice-versa, but I do not want to debug this for Ladybird.
2323         // 10/2/2000 CNC.
2324         Node *pair1 = new BinaryNode(n->in(1),n->in(1)->in(1));
2325         n->set_req(1,pair1);
2326         Node *pair2 = new BinaryNode(n->in(2),n->in(3));
2327         n->set_req(2,pair2);
2328         n->del_req(3);
2329         break;
2330       }
2331       case Op_LoopLimit: {
2332         Node *pair1 = new BinaryNode(n->in(1),n->in(2));
2333         n->set_req(1,pair1);
2334         n->set_req(2,n->in(3));
2335         n->del_req(3);
2336         break;
2337       }
2338       case Op_StrEquals: {

2339         Node *pair1 = new BinaryNode(n->in(2),n->in(3));
2340         n->set_req(2,pair1);
2341         n->set_req(3,n->in(4));
2342         n->del_req(4);
2343         break;
2344       }
2345       case Op_StrComp:
2346       case Op_StrIndexOf: {
2347         Node *pair1 = new BinaryNode(n->in(2),n->in(3));
2348         n->set_req(2,pair1);
2349         Node *pair2 = new BinaryNode(n->in(4),n->in(5));
2350         n->set_req(3,pair2);
2351         n->del_req(5);
2352         n->del_req(4);
2353         break;
2354       }


2355       case Op_EncodeISOArray: {
2356         // Restructure into a binary tree for Matching.
2357         Node* pair = new BinaryNode(n->in(3), n->in(4));
2358         n->set_req(3, pair);
2359         n->del_req(4);
2360         break;
2361       }
2362       default:
2363         break;
2364       }
2365     }
2366     else {
2367       ShouldNotReachHere();
2368     }
2369   } // end of while (mstack.is_nonempty())
2370 }
2371 
2372 #ifdef ASSERT
2373 // machine-independent root to machine-dependent root
2374 void Matcher::dump_old2new_map() {




 919       break;
 920     }
 921   }
 922   if (nidx == Compile::AliasIdxTop && midx == Compile::AliasIdxBot) {
 923     switch (n->Opcode()) {
 924     case Op_Return:
 925     case Op_Rethrow:
 926     case Op_Halt:
 927     case Op_TailCall:
 928     case Op_TailJump:
 929       nidx = Compile::AliasIdxBot;
 930       nat = TypePtr::BOTTOM;
 931       break;
 932     }
 933   }
 934   if (nidx == Compile::AliasIdxBot && midx == Compile::AliasIdxTop) {
 935     switch (n->Opcode()) {
 936     case Op_StrComp:
 937     case Op_StrEquals:
 938     case Op_StrIndexOf:
 939     case Op_StrIndexOfChar:
 940     case Op_AryEq:
 941     case Op_HasNegatives:
 942     case Op_MemBarVolatile:
 943     case Op_MemBarCPUOrder: // %%% these ideals should have narrower adr_type?
 944     case Op_StrInflatedCopy:
 945     case Op_StrCompressedCopy:
 946     case Op_EncodeISOArray:
 947       nidx = Compile::AliasIdxTop;
 948       nat = NULL;
 949       break;
 950     }
 951   }
 952   if (nidx != midx) {
 953     if (PrintOpto || (PrintMiscellaneous && (WizardMode || Verbose))) {
 954       tty->print_cr("==== Matcher alias shift %d => %d", nidx, midx);
 955       n->dump();
 956       m->dump();
 957     }
 958     assert(C->subsume_loads() && C->must_alias(nat, midx),
 959            "must not lose alias info when matching");
 960   }
 961 }
 962 #endif
 963 
 964 
 965 //------------------------------MStack-----------------------------------------


2143       case Op_BoxLock:         // Cant match until we get stack-regs in ADLC
2144       case Op_IfFalse:
2145       case Op_IfTrue:
2146       case Op_MachProj:
2147       case Op_MergeMem:
2148       case Op_Catch:
2149       case Op_CatchProj:
2150       case Op_CProj:
2151       case Op_JumpProj:
2152       case Op_JProj:
2153       case Op_NeverBranch:
2154         set_dontcare(n);
2155         break;
2156       case Op_Jump:
2157         mstack.push(n->in(1), Pre_Visit);     // Switch Value (could be shared)
2158         mstack.push(n->in(0), Pre_Visit);     // Visit Control input
2159         continue;                             // while (mstack.is_nonempty())
2160       case Op_StrComp:
2161       case Op_StrEquals:
2162       case Op_StrIndexOf:
2163       case Op_StrIndexOfChar:
2164       case Op_AryEq:
2165       case Op_HasNegatives:
2166       case Op_StrInflatedCopy:
2167       case Op_StrCompressedCopy:
2168       case Op_EncodeISOArray:
2169         set_shared(n); // Force result into register (it will be anyways)
2170         break;
2171       case Op_ConP: {  // Convert pointers above the centerline to NUL
2172         TypeNode *tn = n->as_Type(); // Constants derive from type nodes
2173         const TypePtr* tp = tn->type()->is_ptr();
2174         if (tp->_ptr == TypePtr::AnyNull) {
2175           tn->set_type(TypePtr::NULL_PTR);
2176         }
2177         break;
2178       }
2179       case Op_ConN: {  // Convert narrow pointers above the centerline to NUL
2180         TypeNode *tn = n->as_Type(); // Constants derive from type nodes
2181         const TypePtr* tp = tn->type()->make_ptr();
2182         if (tp && tp->_ptr == TypePtr::AnyNull) {
2183           tn->set_type(TypeNarrowOop::NULL_PTR);
2184         }
2185         break;
2186       }
2187       case Op_Binary:         // These are introduced in the Post_Visit state.


2326       case Op_CMoveN:
2327       case Op_CMoveP: {
2328         // Restructure into a binary tree for Matching.  It's possible that
2329         // we could move this code up next to the graph reshaping for IfNodes
2330         // or vice-versa, but I do not want to debug this for Ladybird.
2331         // 10/2/2000 CNC.
2332         Node *pair1 = new BinaryNode(n->in(1),n->in(1)->in(1));
2333         n->set_req(1,pair1);
2334         Node *pair2 = new BinaryNode(n->in(2),n->in(3));
2335         n->set_req(2,pair2);
2336         n->del_req(3);
2337         break;
2338       }
2339       case Op_LoopLimit: {
2340         Node *pair1 = new BinaryNode(n->in(1),n->in(2));
2341         n->set_req(1,pair1);
2342         n->set_req(2,n->in(3));
2343         n->del_req(3);
2344         break;
2345       }
2346       case Op_StrEquals:
2347       case Op_StrIndexOfChar: {
2348         Node *pair1 = new BinaryNode(n->in(2),n->in(3));
2349         n->set_req(2,pair1);
2350         n->set_req(3,n->in(4));
2351         n->del_req(4);
2352         break;
2353       }
2354       case Op_StrComp:
2355       case Op_StrIndexOf: {
2356         Node *pair1 = new BinaryNode(n->in(2),n->in(3));
2357         n->set_req(2,pair1);
2358         Node *pair2 = new BinaryNode(n->in(4),n->in(5));
2359         n->set_req(3,pair2);
2360         n->del_req(5);
2361         n->del_req(4);
2362         break;
2363       }
2364       case Op_StrCompressedCopy:
2365       case Op_StrInflatedCopy:
2366       case Op_EncodeISOArray: {
2367         // Restructure into a binary tree for Matching.
2368         Node* pair = new BinaryNode(n->in(3), n->in(4));
2369         n->set_req(3, pair);
2370         n->del_req(4);
2371         break;
2372       }
2373       default:
2374         break;
2375       }
2376     }
2377     else {
2378       ShouldNotReachHere();
2379     }
2380   } // end of while (mstack.is_nonempty())
2381 }
2382 
2383 #ifdef ASSERT
2384 // machine-independent root to machine-dependent root
2385 void Matcher::dump_old2new_map() {


< prev index next >