< prev index next >

src/hotspot/share/opto/buildOopMap.cpp

Print this page




 371   while (OptoReg::is_reg(reg2)) {
 372     if( dup_check[reg2] != 0) cnt_callee_saves++;
 373     assert( cnt_callee_saves==3 || cnt_callee_saves==5, "missed some callee-save" );
 374     reg2++;
 375   }
 376   */
 377 #endif
 378 
 379 #ifdef ASSERT
 380   for( OopMapStream oms1(omap, OopMapValue::derived_oop_value); !oms1.is_done(); oms1.next()) {
 381     OopMapValue omv1 = oms1.current();
 382     bool found = false;
 383     for( OopMapStream oms2(omap,OopMapValue::oop_value); !oms2.is_done(); oms2.next()) {
 384       if( omv1.content_reg() == oms2.current().reg() ) {
 385         found = true;
 386         break;
 387       }
 388     }
 389     assert( found, "derived with no base in oopmap" );
 390   }





 391 #endif
 392 
 393   return omap;
 394 }
 395 
 396 // Compute backwards liveness on registers
 397 static void do_liveness(PhaseRegAlloc* regalloc, PhaseCFG* cfg, Block_List* worklist, int max_reg_ints, Arena* A, Dict* safehash) {
 398   int* live = NEW_ARENA_ARRAY(A, int, (cfg->number_of_blocks() + 1) * max_reg_ints);
 399   int* tmp_live = &live[cfg->number_of_blocks() * max_reg_ints];
 400   Node* root = cfg->get_root_node();
 401   // On CISC platforms, get the node representing the stack pointer  that regalloc
 402   // used for spills
 403   Node *fp = NodeSentinel;
 404   if (UseCISCSpill && root->req() > 1) {
 405     fp = root->in(1)->in(TypeFunc::FramePtr);
 406   }
 407   memset(live, 0, cfg->number_of_blocks() * (max_reg_ints << LogBytesPerInt));
 408   // Push preds onto worklist
 409   for (uint i = 1; i < root->req(); i++) {
 410     Block* block = cfg->get_block_for_node(root->in(i));




 371   while (OptoReg::is_reg(reg2)) {
 372     if( dup_check[reg2] != 0) cnt_callee_saves++;
 373     assert( cnt_callee_saves==3 || cnt_callee_saves==5, "missed some callee-save" );
 374     reg2++;
 375   }
 376   */
 377 #endif
 378 
 379 #ifdef ASSERT
 380   for( OopMapStream oms1(omap, OopMapValue::derived_oop_value); !oms1.is_done(); oms1.next()) {
 381     OopMapValue omv1 = oms1.current();
 382     bool found = false;
 383     for( OopMapStream oms2(omap,OopMapValue::oop_value); !oms2.is_done(); oms2.next()) {
 384       if( omv1.content_reg() == oms2.current().reg() ) {
 385         found = true;
 386         break;
 387       }
 388     }
 389     assert( found, "derived with no base in oopmap" );
 390   }
 391 
 392   int num_oops = 0;
 393   for (OopMapStream oms2(omap, OopMapValue::oop_value | OopMapValue::narrowoop_value); !oms2.is_done(); oms2.next())
 394     num_oops++;
 395   assert (num_oops == omap->num_oops(), "num_oops: %d omap->num_oops(): %d", num_oops, omap->num_oops());
 396 #endif
 397 
 398   return omap;
 399 }
 400 
 401 // Compute backwards liveness on registers
 402 static void do_liveness(PhaseRegAlloc* regalloc, PhaseCFG* cfg, Block_List* worklist, int max_reg_ints, Arena* A, Dict* safehash) {
 403   int* live = NEW_ARENA_ARRAY(A, int, (cfg->number_of_blocks() + 1) * max_reg_ints);
 404   int* tmp_live = &live[cfg->number_of_blocks() * max_reg_ints];
 405   Node* root = cfg->get_root_node();
 406   // On CISC platforms, get the node representing the stack pointer  that regalloc
 407   // used for spills
 408   Node *fp = NodeSentinel;
 409   if (UseCISCSpill && root->req() > 1) {
 410     fp = root->in(1)->in(TypeFunc::FramePtr);
 411   }
 412   memset(live, 0, cfg->number_of_blocks() * (max_reg_ints << LogBytesPerInt));
 413   // Push preds onto worklist
 414   for (uint i = 1; i < root->req(); i++) {
 415     Block* block = cfg->get_block_for_node(root->in(i));


< prev index next >