comparison src/share/vm/opto/macro.cpp @ 1339:09ac706c2623

Merge
author asaha
date Wed, 24 Mar 2010 17:16:33 -0700
parents f96a1a986f7b
children 9e321dcfa5b7
comparison
equal deleted inserted replaced
1338:f5dd08ad65df 1339:09ac706c2623
314 return mem; 314 return mem;
315 } else { 315 } else {
316 assert(adr_idx == Compile::AliasIdxRaw, "address must match or be raw"); 316 assert(adr_idx == Compile::AliasIdxRaw, "address must match or be raw");
317 } 317 }
318 mem = mem->in(MemNode::Memory); 318 mem = mem->in(MemNode::Memory);
319 } else if (mem->is_ClearArray()) {
320 if (!ClearArrayNode::step_through(&mem, alloc->_idx, phase)) {
321 // Can not bypass initialization of the instance
322 // we are looking.
323 debug_only(intptr_t offset;)
324 assert(alloc == AllocateNode::Ideal_allocation(mem->in(3), phase, offset), "sanity");
325 InitializeNode* init = alloc->as_Allocate()->initialization();
326 // We are looking for stored value, return Initialize node
327 // or memory edge from Allocate node.
328 if (init != NULL)
329 return init;
330 else
331 return alloc->in(TypeFunc::Memory); // It will produce zero value (see callers).
332 }
333 // Otherwise skip it (the call updated 'mem' value).
319 } else if (mem->Opcode() == Op_SCMemProj) { 334 } else if (mem->Opcode() == Op_SCMemProj) {
320 assert(mem->in(0)->is_LoadStore(), "sanity"); 335 assert(mem->in(0)->is_LoadStore(), "sanity");
321 const TypePtr* atype = mem->in(0)->in(MemNode::Address)->bottom_type()->is_ptr(); 336 const TypePtr* atype = mem->in(0)->in(MemNode::Address)->bottom_type()->is_ptr();
322 int adr_idx = Compile::current()->get_alias_index(atype); 337 int adr_idx = Compile::current()->get_alias_index(atype);
323 if (adr_idx == alias_idx) { 338 if (adr_idx == alias_idx) {
821 if (use->is_AddP()) { 836 if (use->is_AddP()) {
822 for (DUIterator_Last kmin, k = use->last_outs(kmin); k >= kmin; ) { 837 for (DUIterator_Last kmin, k = use->last_outs(kmin); k >= kmin; ) {
823 Node *n = use->last_out(k); 838 Node *n = use->last_out(k);
824 uint oc2 = use->outcnt(); 839 uint oc2 = use->outcnt();
825 if (n->is_Store()) { 840 if (n->is_Store()) {
841 #ifdef ASSERT
842 // Verify that there is no dependent MemBarVolatile nodes,
843 // they should be removed during IGVN, see MemBarNode::Ideal().
844 for (DUIterator_Fast pmax, p = n->fast_outs(pmax);
845 p < pmax; p++) {
846 Node* mb = n->fast_out(p);
847 assert(mb->is_Initialize() || !mb->is_MemBar() ||
848 mb->req() <= MemBarNode::Precedent ||
849 mb->in(MemBarNode::Precedent) != n,
850 "MemBarVolatile should be eliminated for non-escaping object");
851 }
852 #endif
826 _igvn.replace_node(n, n->in(MemNode::Memory)); 853 _igvn.replace_node(n, n->in(MemNode::Memory));
827 } else { 854 } else {
828 eliminate_card_mark(n); 855 eliminate_card_mark(n);
829 } 856 }
830 k -= (oc2 - use->outcnt()); 857 k -= (oc2 - use->outcnt());
910 937
911 if (!scalar_replacement(alloc, safepoints)) { 938 if (!scalar_replacement(alloc, safepoints)) {
912 return false; 939 return false;
913 } 940 }
914 941
942 CompileLog* log = C->log();
943 if (log != NULL) {
944 Node* klass = alloc->in(AllocateNode::KlassNode);
945 const TypeKlassPtr* tklass = _igvn.type(klass)->is_klassptr();
946 log->head("eliminate_allocation type='%d'",
947 log->identify(tklass->klass()));
948 JVMState* p = alloc->jvms();
949 while (p != NULL) {
950 log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method()));
951 p = p->caller();
952 }
953 log->tail("eliminate_allocation");
954 }
955
915 process_users_of_allocation(alloc); 956 process_users_of_allocation(alloc);
916 957
917 #ifndef PRODUCT 958 #ifndef PRODUCT
918 if (PrintEliminateAllocations) { 959 if (PrintEliminateAllocations) {
919 if (alloc->is_AllocateArray()) 960 if (alloc->is_AllocateArray())
920 tty->print_cr("++++ Eliminated: %d AllocateArray", alloc->_idx); 961 tty->print_cr("++++ Eliminated: %d AllocateArray", alloc->_idx);
921 else 962 else
922 tty->print_cr("++++ Eliminated: %d Allocate", alloc->_idx); 963 tty->print_cr("++++ Eliminated: %d Allocate", alloc->_idx);
923 } 964 }
924 #endif 965 #endif
925 966
926 return true; 967 return true;
927 } 968 }
928 969
1637 if (next_edge) i++; 1678 if (next_edge) i++;
1638 } // for (uint i = 0; i < oldbox->outcnt();) 1679 } // for (uint i = 0; i < oldbox->outcnt();)
1639 } // if (!oldbox->is_eliminated()) 1680 } // if (!oldbox->is_eliminated())
1640 } // if (alock->is_Lock() && !lock->is_coarsened()) 1681 } // if (alock->is_Lock() && !lock->is_coarsened())
1641 1682
1683 CompileLog* log = C->log();
1684 if (log != NULL) {
1685 log->head("eliminate_lock lock='%d'",
1686 alock->is_Lock());
1687 JVMState* p = alock->jvms();
1688 while (p != NULL) {
1689 log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method()));
1690 p = p->caller();
1691 }
1692 log->tail("eliminate_lock");
1693 }
1694
1642 #ifndef PRODUCT 1695 #ifndef PRODUCT
1643 if (PrintEliminateLocks) { 1696 if (PrintEliminateLocks) {
1644 if (alock->is_Lock()) { 1697 if (alock->is_Lock()) {
1645 tty->print_cr("++++ Eliminating: %d Lock", alock->_idx); 1698 tty->print_cr("++++ Eliminating: %d Lock", alock->_idx);
1646 } else { 1699 } else {