src/share/vm/opto/coalesce.cpp

changeset 9513
e044997c2eda
parent 7295
b8e2e616c1e9
child 9514
d853bac073f8
equal deleted inserted replaced
9512:992120803410 9513:e044997c2eda
290 // Insert the copy in the predecessor basic block 290 // Insert the copy in the predecessor basic block
291 pred->add_inst(copy); 291 pred->add_inst(copy);
292 // Copy any flags as well 292 // Copy any flags as well
293 _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);
294 } else { 294 } else {
295 const RegMask *rm = C->matcher()->idealreg2spillmask[m->ideal_reg()]; 295 int ireg = m->ideal_reg();
296 if (ireg == 0 || ireg == Op_RegFlags) {
297 assert(false, err_msg("attempted to spill a non-spillable item: %d: %s, ireg = %d",
298 m->_idx, m->Name(), ireg));
299 C->record_method_not_compilable("attempted to spill a non-spillable item");
300 return;
301 }
302 const RegMask *rm = C->matcher()->idealreg2spillmask[ireg];
296 copy = new (C) MachSpillCopyNode(m, *rm, *rm); 303 copy = new (C) MachSpillCopyNode(m, *rm, *rm);
297 // Find a good place to insert. Kinda tricky, use a subroutine 304 // Find a good place to insert. Kinda tricky, use a subroutine
298 insert_copy_with_overlap(pred,copy,phi_name,src_name); 305 insert_copy_with_overlap(pred,copy,phi_name,src_name);
299 } 306 }
300 // Insert the copy in the use-def chain 307 // Insert the copy in the use-def chain
324 copy = m->clone(); 331 copy = m->clone();
325 // Insert the copy in the basic block, just before us 332 // Insert the copy in the basic block, just before us
326 b->insert_node(copy, l++); 333 b->insert_node(copy, l++);
327 l += _phc.clone_projs(b, l, m, copy, _phc._lrg_map); 334 l += _phc.clone_projs(b, l, m, copy, _phc._lrg_map);
328 } else { 335 } else {
329 const RegMask *rm = C->matcher()->idealreg2spillmask[m->ideal_reg()]; 336 int ireg = m->ideal_reg();
337 if (ireg == 0 || ireg == Op_RegFlags) {
338 assert(false, err_msg("attempted to spill a non-spillable item: %d: %s, ireg = %d",
339 m->_idx, m->Name(), ireg));
340 C->record_method_not_compilable("attempted to spill a non-spillable item");
341 return;
342 }
343 const RegMask *rm = C->matcher()->idealreg2spillmask[ireg];
330 copy = new (C) MachSpillCopyNode(m, *rm, *rm); 344 copy = new (C) MachSpillCopyNode(m, *rm, *rm);
331 // Insert the copy in the basic block, just before us 345 // Insert the copy in the basic block, just before us
332 b->insert_node(copy, l++); 346 b->insert_node(copy, l++);
333 } 347 }
334 // Insert the copy in the use-def chain 348 // Insert the copy in the use-def chain
371 if( _phc._live->live(b->_succs[k])->member( nidx ) ) 385 if( _phc._live->live(b->_succs[k])->member( nidx ) )
372 break; // Live in to some successor block? 386 break; // Live in to some successor block?
373 if( k < b->_num_succs ) 387 if( k < b->_num_succs )
374 continue; // Live out; do not pre-split 388 continue; // Live out; do not pre-split
375 // Split the lrg at this use 389 // Split the lrg at this use
376 const RegMask *rm = C->matcher()->idealreg2spillmask[inp->ideal_reg()]; 390 int ireg = inp->ideal_reg();
391 if (ireg == 0 || ireg == Op_RegFlags) {
392 assert(false, err_msg("attempted to spill a non-spillable item: %d: %s, ireg = %d",
393 inp->_idx, inp->Name(), ireg));
394 C->record_method_not_compilable("attempted to spill a non-spillable item");
395 return;
396 }
397 const RegMask *rm = C->matcher()->idealreg2spillmask[ireg];
377 Node *copy = new (C) MachSpillCopyNode( inp, *rm, *rm ); 398 Node *copy = new (C) MachSpillCopyNode( inp, *rm, *rm );
378 // Insert the copy in the use-def chain 399 // Insert the copy in the use-def chain
379 n->set_req(inpidx, copy ); 400 n->set_req(inpidx, copy );
380 // Insert the copy in the basic block, just before us 401 // Insert the copy in the basic block, just before us
381 b->insert_node(copy, l++); 402 b->insert_node(copy, l++);

mercurial