comparison src/share/vm/opto/ifg.cpp @ 20689:3f4a5fdca318

8066649: 8u backport for 8065618 is incorrect Summary: The new code in 8u backport should guard the execution of the following code instead of return. Reviewed-by: iveresov
author kvn
date Wed, 03 Dec 2014 17:41:47 -0800
parents dc763d49b82d
children 7848fc12602b
comparison
equal deleted inserted replaced
20688:f913964f3fde 20689:3f4a5fdca318
539 if( !liveout.member(r) && n->Opcode() != Op_SafePoint ) { 539 if( !liveout.member(r) && n->Opcode() != Op_SafePoint ) {
540 Node *def = n->in(0); 540 Node *def = n->in(0);
541 if( !n->is_Proj() || 541 if( !n->is_Proj() ||
542 // Could also be a flags-projection of a dead ADD or such. 542 // Could also be a flags-projection of a dead ADD or such.
543 (_lrg_map.live_range_id(def) && !liveout.member(_lrg_map.live_range_id(def)))) { 543 (_lrg_map.live_range_id(def) && !liveout.member(_lrg_map.live_range_id(def)))) {
544 bool remove = true;
544 if (n->is_MachProj()) { 545 if (n->is_MachProj()) {
545 // Don't remove KILL projections if their "defining" nodes have 546 // Don't remove KILL projections if their "defining" nodes have
546 // memory effects (have SCMemProj projection node) - 547 // memory effects (have SCMemProj projection node) -
547 // they are not dead even when their result is not used. 548 // they are not dead even when their result is not used.
548 // For example, compareAndSwapL (and other CAS) and EncodeISOArray nodes. 549 // For example, compareAndSwapL (and other CAS) and EncodeISOArray nodes.
551 // in block in such order that KILL MachProj nodes are processed first. 552 // in block in such order that KILL MachProj nodes are processed first.
552 uint cnt = def->outcnt(); 553 uint cnt = def->outcnt();
553 for (uint i = 0; i < cnt; i++) { 554 for (uint i = 0; i < cnt; i++) {
554 Node* proj = def->raw_out(i); 555 Node* proj = def->raw_out(i);
555 if (proj->Opcode() == Op_SCMemProj) { 556 if (proj->Opcode() == Op_SCMemProj) {
556 return false; 557 remove = false;
558 break;
557 } 559 }
558 } 560 }
559 } 561 }
560 block->remove_node(j - 1); 562 if (remove) {
561 if (lrgs(r)._def == n) { 563 block->remove_node(j - 1);
562 lrgs(r)._def = 0; 564 if (lrgs(r)._def == n) {
563 } 565 lrgs(r)._def = 0;
564 n->disconnect_inputs(NULL, C); 566 }
565 _cfg.unmap_node_from_block(n); 567 n->disconnect_inputs(NULL, C);
566 n->replace_by(C->top()); 568 _cfg.unmap_node_from_block(n);
567 // Since yanking a Node from block, high pressure moves up one 569 n->replace_by(C->top());
568 hrp_index[0]--; 570 // Since yanking a Node from block, high pressure moves up one
569 hrp_index[1]--; 571 hrp_index[0]--;
570 continue; 572 hrp_index[1]--;
573 continue;
574 }
571 } 575 }
572 576
573 // Fat-projections kill many registers which cannot be used to 577 // Fat-projections kill many registers which cannot be used to
574 // hold live ranges. 578 // hold live ranges.
575 if (lrgs(r)._fat_proj) { 579 if (lrgs(r)._fat_proj) {