comparison src/share/vm/opto/coalesce.cpp @ 20581:b8e2e616c1e9

8047383: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init> Summary: Do not rematerialize constant table loads in PhaseAggressiveCoalesce::insert_copies() Reviewed-by: kvn
author iveresov
date Thu, 23 Oct 2014 09:41:59 -1000
parents 4b078f877b56
children 7848fc12602b
comparison
equal deleted inserted replaced
20580:e244cb6bdedf 20581:b8e2e616c1e9
279 uint src_name = _phc._lrg_map.find(m); 279 uint src_name = _phc._lrg_map.find(m);
280 if (src_name != phi_name) { 280 if (src_name != phi_name) {
281 Block *pred = _phc._cfg.get_block_for_node(b->pred(j)); 281 Block *pred = _phc._cfg.get_block_for_node(b->pred(j));
282 Node *copy; 282 Node *copy;
283 assert(!m->is_Con() || m->is_Mach(), "all Con must be Mach"); 283 assert(!m->is_Con() || m->is_Mach(), "all Con must be Mach");
284 // Rematerialize constants instead of copying them 284 // Rematerialize constants instead of copying them.
285 if( m->is_Mach() && m->as_Mach()->is_Con() && 285 // We do this only for immediate constants, we avoid constant table loads
286 m->as_Mach()->rematerialize() ) { 286 // because that will unsafely extend the live range of the constant table base.
287 if (m->is_Mach() && m->as_Mach()->is_Con() && !m->as_Mach()->is_MachConstant() &&
288 m->as_Mach()->rematerialize()) {
287 copy = m->clone(); 289 copy = m->clone();
288 // Insert the copy in the predecessor basic block 290 // Insert the copy in the predecessor basic block
289 pred->add_inst(copy); 291 pred->add_inst(copy);
290 // Copy any flags as well 292 // Copy any flags as well
291 _phc.clone_projs(pred, pred->end_idx(), m, copy, _phc._lrg_map); 293 _phc.clone_projs(pred, pred->end_idx(), m, copy, _phc._lrg_map);
315 if (_phc._lrg_map.find(m) != name) { 317 if (_phc._lrg_map.find(m) != name) {
316 Node *copy; 318 Node *copy;
317 assert(!m->is_Con() || m->is_Mach(), "all Con must be Mach"); 319 assert(!m->is_Con() || m->is_Mach(), "all Con must be Mach");
318 // At this point it is unsafe to extend live ranges (6550579). 320 // At this point it is unsafe to extend live ranges (6550579).
319 // Rematerialize only constants as we do for Phi above. 321 // Rematerialize only constants as we do for Phi above.
320 if(m->is_Mach() && m->as_Mach()->is_Con() && 322 if (m->is_Mach() && m->as_Mach()->is_Con() && !m->as_Mach()->is_MachConstant() &&
321 m->as_Mach()->rematerialize()) { 323 m->as_Mach()->rematerialize()) {
322 copy = m->clone(); 324 copy = m->clone();
323 // Insert the copy in the basic block, just before us 325 // Insert the copy in the basic block, just before us
324 b->insert_node(copy, l++); 326 b->insert_node(copy, l++);
325 l += _phc.clone_projs(b, l, m, copy, _phc._lrg_map); 327 l += _phc.clone_projs(b, l, m, copy, _phc._lrg_map);
326 } else { 328 } else {