2481 } 2482 if (done_offset > start_offset) { 2483 mem = clear_memory(ctl, mem, dest, 2484 start_offset, phase->MakeConX(done_offset), phase); 2485 } 2486 if (done_offset < end_offset) { // emit the final 32-bit store 2487 Node* adr = new (C, 4) AddPNode(dest, dest, phase->MakeConX(done_offset)); 2488 adr = phase->transform(adr); 2489 const TypePtr* atp = TypeRawPtr::BOTTOM; 2490 mem = StoreNode::make(*phase, ctl, mem, adr, atp, phase->zerocon(T_INT), T_INT); 2491 mem = phase->transform(mem); 2492 done_offset += BytesPerInt; 2493 } 2494 assert(done_offset == end_offset, ""); 2495 return mem; 2496 } 2497 2498 //============================================================================= 2499 // Do we match on this edge? No memory edges 2500 uint StrCompNode::match_edge(uint idx) const { 2501 return idx == 5 || idx == 6; 2502 } 2503 2504 //------------------------------Ideal------------------------------------------ 2505 // Return a node which is more "ideal" than the current node. Strip out 2506 // control copies 2507 Node *StrCompNode::Ideal(PhaseGVN *phase, bool can_reshape){ 2508 return remove_dead_region(phase, can_reshape) ? this : NULL; 2509 } 2510 2511 // Do we match on this edge? No memory edges 2512 uint StrEqualsNode::match_edge(uint idx) const { 2513 return idx == 5 || idx == 6; 2514 } 2515 2516 //------------------------------Ideal------------------------------------------ 2517 // Return a node which is more "ideal" than the current node. Strip out 2518 // control copies 2519 Node *StrEqualsNode::Ideal(PhaseGVN *phase, bool can_reshape){ 2520 return remove_dead_region(phase, can_reshape) ? this : NULL; 2521 } 2522 2523 //============================================================================= 2524 // Do we match on this edge? No memory edges 2525 uint StrIndexOfNode::match_edge(uint idx) const { 2526 return idx == 5 || idx == 6; 2527 } 2528 2529 //------------------------------Ideal------------------------------------------ 2530 // Return a node which is more "ideal" than the current node. Strip out 2531 // control copies 2532 Node *StrIndexOfNode::Ideal(PhaseGVN *phase, bool can_reshape){ 2533 return remove_dead_region(phase, can_reshape) ? this : NULL; 2534 } 2535 2536 //------------------------------Ideal------------------------------------------ 2537 // Return a node which is more "ideal" than the current node. Strip out 2538 // control copies 2539 Node *AryEqNode::Ideal(PhaseGVN *phase, bool can_reshape){ 2540 return remove_dead_region(phase, can_reshape) ? this : NULL; 2541 } 2542 2543 //============================================================================= 2544 MemBarNode::MemBarNode(Compile* C, int alias_idx, Node* precedent) 2545 : MultiNode(TypeFunc::Parms + (precedent == NULL? 0: 1)), 2546 _adr_type(C->get_adr_type(alias_idx)) | 2481 } 2482 if (done_offset > start_offset) { 2483 mem = clear_memory(ctl, mem, dest, 2484 start_offset, phase->MakeConX(done_offset), phase); 2485 } 2486 if (done_offset < end_offset) { // emit the final 32-bit store 2487 Node* adr = new (C, 4) AddPNode(dest, dest, phase->MakeConX(done_offset)); 2488 adr = phase->transform(adr); 2489 const TypePtr* atp = TypeRawPtr::BOTTOM; 2490 mem = StoreNode::make(*phase, ctl, mem, adr, atp, phase->zerocon(T_INT), T_INT); 2491 mem = phase->transform(mem); 2492 done_offset += BytesPerInt; 2493 } 2494 assert(done_offset == end_offset, ""); 2495 return mem; 2496 } 2497 2498 //============================================================================= 2499 // Do we match on this edge? No memory edges 2500 uint StrCompNode::match_edge(uint idx) const { 2501 return idx == 2 || idx == 3; // StrComp (Binary str1 str2) (Binary cnt1 cnt2) 2502 } 2503 2504 //------------------------------Ideal------------------------------------------ 2505 // Return a node which is more "ideal" than the current node. Strip out 2506 // control copies 2507 Node *StrCompNode::Ideal(PhaseGVN *phase, bool can_reshape){ 2508 return remove_dead_region(phase, can_reshape) ? this : NULL; 2509 } 2510 2511 // Do we match on this edge? No memory edges 2512 uint StrEqualsNode::match_edge(uint idx) const { 2513 return idx == 2 || idx == 3; // StrEquals (Binary str1 str2) cnt 2514 } 2515 2516 //------------------------------Ideal------------------------------------------ 2517 // Return a node which is more "ideal" than the current node. Strip out 2518 // control copies 2519 Node *StrEqualsNode::Ideal(PhaseGVN *phase, bool can_reshape){ 2520 return remove_dead_region(phase, can_reshape) ? this : NULL; 2521 } 2522 2523 //============================================================================= 2524 // Do we match on this edge? No memory edges 2525 uint StrIndexOfNode::match_edge(uint idx) const { 2526 return idx == 2 || idx == 3; // StrIndexOf (Binary str1 str2) (Binary cnt1 cnt2) 2527 } 2528 2529 //------------------------------Ideal------------------------------------------ 2530 // Return a node which is more "ideal" than the current node. Strip out 2531 // control copies 2532 Node *StrIndexOfNode::Ideal(PhaseGVN *phase, bool can_reshape){ 2533 return remove_dead_region(phase, can_reshape) ? this : NULL; 2534 } 2535 2536 //------------------------------Ideal------------------------------------------ 2537 // Return a node which is more "ideal" than the current node. Strip out 2538 // control copies 2539 Node *AryEqNode::Ideal(PhaseGVN *phase, bool can_reshape){ 2540 return remove_dead_region(phase, can_reshape) ? this : NULL; 2541 } 2542 2543 //============================================================================= 2544 MemBarNode::MemBarNode(Compile* C, int alias_idx, Node* precedent) 2545 : MultiNode(TypeFunc::Parms + (precedent == NULL? 0: 1)), 2546 _adr_type(C->get_adr_type(alias_idx)) |