< prev index next >

src/share/vm/opto/block.cpp

Print this page

        

*** 207,218 **** // even though it is a count not a probability. return true; } } ! int op = en->is_Mach() ? en->as_Mach()->ideal_Opcode() : en->Opcode(); ! return op == Op_Halt; } // True if block is low enough frequency or guarded by a test which // mostly does not go here. bool PhaseCFG::is_uncommon(const Block* block) { --- 207,218 ---- // even though it is a count not a probability. return true; } } ! Opcodes op = en->is_Mach() ? en->as_Mach()->ideal_Opcode() : en->Opcode(); ! return op == Opcodes::Op_Halt; } // True if block is low enough frequency or guarded by a test which // mostly does not go here. bool PhaseCFG::is_uncommon(const Block* block) {
*** 545,556 **** } if (branch->is_Mach()) { if (branch->is_MachNullCheck()) { return true; } ! int iop = branch->as_Mach()->ideal_Opcode(); ! if (iop == Op_FastLock || iop == Op_FastUnlock) { return true; } // Don't flip if branch has an implicit check. if (branch->as_Mach()->is_TrapBasedCheckNode()) { return true; --- 545,556 ---- } if (branch->is_Mach()) { if (branch->is_MachNullCheck()) { return true; } ! Opcodes iop = branch->as_Mach()->ideal_Opcode(); ! if (iop == Opcodes::Op_FastLock || iop == Opcodes::Op_FastUnlock) { return true; } // Don't flip if branch has an implicit check. if (branch->as_Mach()->is_TrapBasedCheckNode()) { return true;
*** 678,688 **** // true target. NeverBranch are treated as a conditional branch that // always goes the same direction for most of the optimizer and are used // to give a fake exit path to infinite loops. At this late stage they // need to turn into Goto's so that when you enter the infinite loop you // indeed hang. ! if (block->get_node(block->end_idx())->Opcode() == Op_NeverBranch) { convert_NeverBranch_to_Goto(block); } // Look for uncommon blocks and move to end. if (!C->do_freq_based_layout()) { --- 678,688 ---- // true target. NeverBranch are treated as a conditional branch that // always goes the same direction for most of the optimizer and are used // to give a fake exit path to infinite loops. At this late stage they // need to turn into Goto's so that when you enter the infinite loop you // indeed hang. ! if (block->get_node(block->end_idx())->Opcode() == Opcodes::Op_NeverBranch) { convert_NeverBranch_to_Goto(block); } // Look for uncommon blocks and move to end. if (!C->do_freq_based_layout()) {
*** 722,733 **** // Get the If node and the projection for the first successor. MachIfNode *iff = block->get_node(block->number_of_nodes()-3)->as_MachIf(); ProjNode *proj0 = block->get_node(block->number_of_nodes()-2)->as_Proj(); ProjNode *proj1 = block->get_node(block->number_of_nodes()-1)->as_Proj(); ! ProjNode *projt = (proj0->Opcode() == Op_IfTrue) ? proj0 : proj1; ! ProjNode *projf = (proj0->Opcode() == Op_IfFalse) ? proj0 : proj1; // Assert that proj0 and succs[0] match up. Similarly for proj1 and succs[1]. assert(proj0->raw_out(0) == block->_succs[0]->head(), "Mismatch successor 0"); assert(proj1->raw_out(0) == block->_succs[1]->head(), "Mismatch successor 1"); --- 722,733 ---- // Get the If node and the projection for the first successor. MachIfNode *iff = block->get_node(block->number_of_nodes()-3)->as_MachIf(); ProjNode *proj0 = block->get_node(block->number_of_nodes()-2)->as_Proj(); ProjNode *proj1 = block->get_node(block->number_of_nodes()-1)->as_Proj(); ! ProjNode *projt = (proj0->Opcode() == Opcodes::Op_IfTrue) ? proj0 : proj1; ! ProjNode *projf = (proj0->Opcode() == Opcodes::Op_IfFalse) ? proj0 : proj1; // Assert that proj0 and succs[0] match up. Similarly for proj1 and succs[1]. assert(proj0->raw_out(0) == block->_succs[0]->head(), "Mismatch successor 0"); assert(proj1->raw_out(0) == block->_succs[1]->head(), "Mismatch successor 1");
*** 868,878 **** Block* by = bs1; // _prob is the probability of taking the true path. Make // p the probability of taking successor #1. float p = iff->as_MachIf()->_prob; ! if (proj0->Opcode() == Op_IfTrue) { p = 1.0 - p; } // Prefer successor #1 if p > 0.5 if (p > PROB_FAIR) { --- 868,878 ---- Block* by = bs1; // _prob is the probability of taking the true path. Make // p the probability of taking successor #1. float p = iff->as_MachIf()->_prob; ! if (proj0->Opcode() == Opcodes::Op_IfTrue) { p = 1.0 - p; } // Prefer successor #1 if p > 0.5 if (p > PROB_FAIR) {
*** 914,924 **** // block this late in the game is complicated. Sigh. insert_goto_at(i, 1); } // Make sure we TRUE branch to the target ! if (proj0->Opcode() == Op_IfFalse) { iff->as_MachIf()->negate(); } block->pop_node(); // Remove IfFalse & IfTrue projections block->pop_node(); --- 914,924 ---- // block this late in the game is complicated. Sigh. insert_goto_at(i, 1); } // Make sure we TRUE branch to the target ! if (proj0->Opcode() == Opcodes::Op_IfFalse) { iff->as_MachIf()->negate(); } block->pop_node(); // Remove IfFalse & IfTrue projections block->pop_node();
*** 1207,1217 **** uint cnt = block->number_of_nodes(); uint j; for (j = 0; j < cnt; j++) { Node *n = block->get_node(j); assert(get_block_for_node(n) == block, ""); ! if (j >= 1 && n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_CreateEx) { assert(j == 1 || block->get_node(j-1)->is_Phi(), "CreateEx must be first instruction in block"); } for (uint k = 0; k < n->req(); k++) { Node *def = n->in(k); if (def && def != n) { --- 1207,1217 ---- uint cnt = block->number_of_nodes(); uint j; for (j = 0; j < cnt; j++) { Node *n = block->get_node(j); assert(get_block_for_node(n) == block, ""); ! if (j >= 1 && n->is_Mach() && n->as_Mach()->ideal_Opcode() == Opcodes::Op_CreateEx) { assert(j == 1 || block->get_node(j-1)->is_Phi(), "CreateEx must be first instruction in block"); } for (uint k = 0; k < n->req(); k++) { Node *def = n->in(k); if (def && def != n) {
*** 1245,1255 **** if (bp->is_Catch()) { while (block->get_node(--j)->is_MachProj()) { ; } assert(block->get_node(j)->is_MachCall(), "CatchProj must follow call"); ! } else if (bp->is_Mach() && bp->as_Mach()->ideal_Opcode() == Op_If) { assert(block->_num_succs == 2, "Conditional branch must have two targets"); } } #endif } --- 1245,1255 ---- if (bp->is_Catch()) { while (block->get_node(--j)->is_MachProj()) { ; } assert(block->get_node(j)->is_MachCall(), "CatchProj must follow call"); ! } else if (bp->is_Mach() && bp->as_Mach()->ideal_Opcode() == Opcodes::Op_If) { assert(block->_num_succs == 2, "Conditional branch must have two targets"); } } #endif }
< prev index next >