comparison src/share/vm/opto/phaseX.cpp @ 14422:2b8e28fdf503

Merge
author kvn
date Tue, 05 Nov 2013 17:38:04 -0800
parents b2ee5dc63353
children de6a9e811145
comparison
equal deleted inserted replaced
14421:3068270ba476 14422:2b8e28fdf503
1383 if (imem != NULL) add_users_to_worklist0(imem); 1383 if (imem != NULL) add_users_to_worklist0(imem);
1384 } 1384 }
1385 } 1385 }
1386 } 1386 }
1387 1387
1388 /**
1389 * Remove the speculative part of all types that we know of
1390 */
1391 void PhaseIterGVN::remove_speculative_types() {
1392 assert(UseTypeSpeculation, "speculation is off");
1393 for (uint i = 0; i < _types.Size(); i++) {
1394 const Type* t = _types.fast_lookup(i);
1395 if (t != NULL && t->isa_oopptr()) {
1396 const TypeOopPtr* to = t->is_oopptr();
1397 _types.map(i, to->remove_speculative());
1398 }
1399 }
1400 }
1401
1388 //============================================================================= 1402 //=============================================================================
1389 #ifndef PRODUCT 1403 #ifndef PRODUCT
1390 uint PhaseCCP::_total_invokes = 0; 1404 uint PhaseCCP::_total_invokes = 0;
1391 uint PhaseCCP::_total_constants = 0; 1405 uint PhaseCCP::_total_constants = 0;
1392 #endif 1406 #endif
1646 for (uint block_number = 1; block_number < _cfg.number_of_blocks(); ++block_number) { 1660 for (uint block_number = 1; block_number < _cfg.number_of_blocks(); ++block_number) {
1647 Block* block = _cfg.get_block(block_number); 1661 Block* block = _cfg.get_block(block_number);
1648 bool block_not_printed = true; 1662 bool block_not_printed = true;
1649 1663
1650 // and each instruction within a block 1664 // and each instruction within a block
1651 uint end_index = block->_nodes.size(); 1665 uint end_index = block->number_of_nodes();
1652 // block->end_idx() not valid after PhaseRegAlloc 1666 // block->end_idx() not valid after PhaseRegAlloc
1653 for( uint instruction_index = 1; instruction_index < end_index; ++instruction_index ) { 1667 for( uint instruction_index = 1; instruction_index < end_index; ++instruction_index ) {
1654 Node *n = block->_nodes.at(instruction_index); 1668 Node *n = block->get_node(instruction_index);
1655 if( n->is_Mach() ) { 1669 if( n->is_Mach() ) {
1656 MachNode *m = n->as_Mach(); 1670 MachNode *m = n->as_Mach();
1657 int deleted_count = 0; 1671 int deleted_count = 0;
1658 // check for peephole opportunities 1672 // check for peephole opportunities
1659 MachNode *m2 = m->peephole( block, instruction_index, _regalloc, deleted_count, C ); 1673 MachNode *m2 = m->peephole( block, instruction_index, _regalloc, deleted_count, C );
1671 block->dump(); 1685 block->dump();
1672 block_not_printed = false; 1686 block_not_printed = false;
1673 } 1687 }
1674 // Print instructions being deleted 1688 // Print instructions being deleted
1675 for( int i = (deleted_count - 1); i >= 0; --i ) { 1689 for( int i = (deleted_count - 1); i >= 0; --i ) {
1676 block->_nodes.at(instruction_index-i)->as_Mach()->format(_regalloc); tty->cr(); 1690 block->get_node(instruction_index-i)->as_Mach()->format(_regalloc); tty->cr();
1677 } 1691 }
1678 tty->print_cr("replaced with"); 1692 tty->print_cr("replaced with");
1679 // Print new instruction 1693 // Print new instruction
1680 m2->format(_regalloc); 1694 m2->format(_regalloc);
1681 tty->print("\n\n"); 1695 tty->print("\n\n");
1685 // (old nodes still exist and may have edges pointing to them 1699 // (old nodes still exist and may have edges pointing to them
1686 // as register allocation info is stored in the allocator using 1700 // as register allocation info is stored in the allocator using
1687 // the node index to live range mappings.) 1701 // the node index to live range mappings.)
1688 uint safe_instruction_index = (instruction_index - deleted_count); 1702 uint safe_instruction_index = (instruction_index - deleted_count);
1689 for( ; (instruction_index > safe_instruction_index); --instruction_index ) { 1703 for( ; (instruction_index > safe_instruction_index); --instruction_index ) {
1690 block->_nodes.remove( instruction_index ); 1704 block->remove_node( instruction_index );
1691 } 1705 }
1692 // install new node after safe_instruction_index 1706 // install new node after safe_instruction_index
1693 block->_nodes.insert( safe_instruction_index + 1, m2 ); 1707 block->insert_node(m2, safe_instruction_index + 1);
1694 end_index = block->_nodes.size() - 1; // Recompute new block size 1708 end_index = block->number_of_nodes() - 1; // Recompute new block size
1695 NOT_PRODUCT( inc_peepholes(); ) 1709 NOT_PRODUCT( inc_peepholes(); )
1696 } 1710 }
1697 } 1711 }
1698 } 1712 }
1699 } 1713 }