346 347 } else { 348 // Other - some reaching non-oop value 349 omap->set_value( r); 350 } 351 352 } 353 354 #ifdef ASSERT 355 /* Nice, Intel-only assert 356 int cnt_callee_saves=0; 357 int reg2 = 0; 358 while (OptoReg::is_reg(reg2)) { 359 if( dup_check[reg2] != 0) cnt_callee_saves++; 360 assert( cnt_callee_saves==3 || cnt_callee_saves==5, "missed some callee-save" ); 361 reg2++; 362 } 363 */ 364 #endif 365 366 return omap; 367 } 368 369 //------------------------------do_liveness------------------------------------ 370 // Compute backwards liveness on registers 371 static void do_liveness( PhaseRegAlloc *regalloc, PhaseCFG *cfg, Block_List *worklist, int max_reg_ints, Arena *A, Dict *safehash ) { 372 int *live = NEW_ARENA_ARRAY(A, int, (cfg->_num_blocks+1) * max_reg_ints); 373 int *tmp_live = &live[cfg->_num_blocks * max_reg_ints]; 374 Node *root = cfg->C->root(); 375 // On CISC platforms, get the node representing the stack pointer that regalloc 376 // used for spills 377 Node *fp = NodeSentinel; 378 if (UseCISCSpill && root->req() > 1) { 379 fp = root->in(1)->in(TypeFunc::FramePtr); 380 } 381 memset( live, 0, cfg->_num_blocks * (max_reg_ints<<LogBytesPerInt) ); 382 // Push preds onto worklist 383 for( uint i=1; i<root->req(); i++ ) 384 worklist->push(cfg->_bbs[root->in(i)->_idx]); 385 | 346 347 } else { 348 // Other - some reaching non-oop value 349 omap->set_value( r); 350 } 351 352 } 353 354 #ifdef ASSERT 355 /* Nice, Intel-only assert 356 int cnt_callee_saves=0; 357 int reg2 = 0; 358 while (OptoReg::is_reg(reg2)) { 359 if( dup_check[reg2] != 0) cnt_callee_saves++; 360 assert( cnt_callee_saves==3 || cnt_callee_saves==5, "missed some callee-save" ); 361 reg2++; 362 } 363 */ 364 #endif 365 366 #ifdef ASSERT 367 for( OopMapStream oms1(omap, OopMapValue::derived_oop_value); !oms1.is_done(); oms1.next()) { 368 OopMapValue omv1 = oms1.current(); 369 bool found = false; 370 for( OopMapStream oms2(omap,OopMapValue::oop_value); !oms2.is_done(); oms2.next()) { 371 if( omv1.content_reg() == oms2.current().reg() ) { 372 found = true; 373 break; 374 } 375 } 376 assert( found, "derived with no base in oopmap" ); 377 } 378 #endif 379 380 return omap; 381 } 382 383 //------------------------------do_liveness------------------------------------ 384 // Compute backwards liveness on registers 385 static void do_liveness( PhaseRegAlloc *regalloc, PhaseCFG *cfg, Block_List *worklist, int max_reg_ints, Arena *A, Dict *safehash ) { 386 int *live = NEW_ARENA_ARRAY(A, int, (cfg->_num_blocks+1) * max_reg_ints); 387 int *tmp_live = &live[cfg->_num_blocks * max_reg_ints]; 388 Node *root = cfg->C->root(); 389 // On CISC platforms, get the node representing the stack pointer that regalloc 390 // used for spills 391 Node *fp = NodeSentinel; 392 if (UseCISCSpill && root->req() > 1) { 393 fp = root->in(1)->in(TypeFunc::FramePtr); 394 } 395 memset( live, 0, cfg->_num_blocks * (max_reg_ints<<LogBytesPerInt) ); 396 // Push preds onto worklist 397 for( uint i=1; i<root->req(); i++ ) 398 worklist->push(cfg->_bbs[root->in(i)->_idx]); 399 |