src/share/vm/opto/escape.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/escape.cpp

Print this page
rev 8981 : 8134031: Incorrect JIT compilation of complex code with inlining and escape analysis
Summary: Bad rewiring of memory edges when we split unique types during EA
Reviewed-by:


3224           use->dump();
3225           assert(false, "EA: missing memory path");
3226         }
3227 #endif
3228       }
3229     }
3230   }
3231 
3232   //  Phase 3:  Process MergeMem nodes from mergemem_worklist.
3233   //            Walk each memory slice moving the first node encountered of each
3234   //            instance type to the the input corresponding to its alias index.
3235   uint length = _mergemem_worklist.length();
3236   for( uint next = 0; next < length; ++next ) {
3237     MergeMemNode* nmm = _mergemem_worklist.at(next);
3238     assert(!visited.test_set(nmm->_idx), "should not be visited before");
3239     // Note: we don't want to use MergeMemStream here because we only want to
3240     // scan inputs which exist at the start, not ones we add during processing.
3241     // Note 2: MergeMem may already contains instance memory slices added
3242     // during find_inst_mem() call when memory nodes were processed above.
3243     igvn->hash_delete(nmm);
3244     uint nslices = nmm->req();
3245     for (uint i = Compile::AliasIdxRaw+1; i < nslices; i++) {
3246       Node* mem = nmm->in(i);
3247       Node* cur = NULL;
3248       if (mem == NULL || mem->is_top())
3249         continue;
3250       // First, update mergemem by moving memory nodes to corresponding slices
3251       // if their type became more precise since this mergemem was created.
3252       while (mem->is_Mem()) {
3253         const Type *at = igvn->type(mem->in(MemNode::Address));
3254         if (at != Type::TOP) {
3255           assert (at->isa_ptr() != NULL, "pointer type required.");
3256           uint idx = (uint)_compile->get_alias_index(at->is_ptr());
3257           if (idx == i) {
3258             if (cur == NULL)
3259               cur = mem;
3260           } else {
3261             if (idx >= nmm->req() || nmm->is_empty_memory(nmm->in(idx))) {
3262               nmm->set_memory_at(idx, mem);
3263             }
3264           }




3224           use->dump();
3225           assert(false, "EA: missing memory path");
3226         }
3227 #endif
3228       }
3229     }
3230   }
3231 
3232   //  Phase 3:  Process MergeMem nodes from mergemem_worklist.
3233   //            Walk each memory slice moving the first node encountered of each
3234   //            instance type to the the input corresponding to its alias index.
3235   uint length = _mergemem_worklist.length();
3236   for( uint next = 0; next < length; ++next ) {
3237     MergeMemNode* nmm = _mergemem_worklist.at(next);
3238     assert(!visited.test_set(nmm->_idx), "should not be visited before");
3239     // Note: we don't want to use MergeMemStream here because we only want to
3240     // scan inputs which exist at the start, not ones we add during processing.
3241     // Note 2: MergeMem may already contains instance memory slices added
3242     // during find_inst_mem() call when memory nodes were processed above.
3243     igvn->hash_delete(nmm);
3244     uint nslices = MIN2(nmm->req(), new_index_start);
3245     for (uint i = Compile::AliasIdxRaw+1; i < nslices; i++) {
3246       Node* mem = nmm->in(i);
3247       Node* cur = NULL;
3248       if (mem == NULL || mem->is_top())
3249         continue;
3250       // First, update mergemem by moving memory nodes to corresponding slices
3251       // if their type became more precise since this mergemem was created.
3252       while (mem->is_Mem()) {
3253         const Type *at = igvn->type(mem->in(MemNode::Address));
3254         if (at != Type::TOP) {
3255           assert (at->isa_ptr() != NULL, "pointer type required.");
3256           uint idx = (uint)_compile->get_alias_index(at->is_ptr());
3257           if (idx == i) {
3258             if (cur == NULL)
3259               cur = mem;
3260           } else {
3261             if (idx >= nmm->req() || nmm->is_empty_memory(nmm->in(idx))) {
3262               nmm->set_memory_at(idx, mem);
3263             }
3264           }


src/share/vm/opto/escape.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File