1.1 --- a/src/share/vm/opto/buildOopMap.cpp Wed Jul 01 15:06:54 2009 -0700 1.2 +++ b/src/share/vm/opto/buildOopMap.cpp Wed Jul 01 20:22:18 2009 -0700 1.3 @@ -74,9 +74,11 @@ 1.4 // this block. 1.5 Block *_b; // Block for this struct 1.6 OopFlow *_next; // Next free OopFlow 1.7 + // or NULL if dead/conflict 1.8 + Compile* C; 1.9 1.10 - OopFlow( short *callees, Node **defs ) : _callees(callees), _defs(defs), 1.11 - _b(NULL), _next(NULL) { } 1.12 + OopFlow( short *callees, Node **defs, Compile* c ) : _callees(callees), _defs(defs), 1.13 + _b(NULL), _next(NULL), C(c) { } 1.14 1.15 // Given reaching-defs for this block start, compute it for this block end 1.16 void compute_reach( PhaseRegAlloc *regalloc, int max_reg, Dict *safehash ); 1.17 @@ -88,7 +90,7 @@ 1.18 void clone( OopFlow *flow, int max_size); 1.19 1.20 // Make a new OopFlow from scratch 1.21 - static OopFlow *make( Arena *A, int max_size ); 1.22 + static OopFlow *make( Arena *A, int max_size, Compile* C ); 1.23 1.24 // Build an oopmap from the current flow info 1.25 OopMap *build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, int* live ); 1.26 @@ -180,11 +182,11 @@ 1.27 } 1.28 1.29 //------------------------------make------------------------------------------- 1.30 -OopFlow *OopFlow::make( Arena *A, int max_size ) { 1.31 +OopFlow *OopFlow::make( Arena *A, int max_size, Compile* C ) { 1.32 short *callees = NEW_ARENA_ARRAY(A,short,max_size+1); 1.33 Node **defs = NEW_ARENA_ARRAY(A,Node*,max_size+1); 1.34 debug_only( memset(defs,0,(max_size+1)*sizeof(Node*)) ); 1.35 - OopFlow *flow = new (A) OopFlow(callees+1, defs+1); 1.36 + OopFlow *flow = new (A) OopFlow(callees+1, defs+1, C); 1.37 assert( &flow->_callees[OptoReg::Bad] == callees, "Ok to index at OptoReg::Bad" ); 1.38 assert( &flow->_defs [OptoReg::Bad] == defs , "Ok to index at OptoReg::Bad" ); 1.39 return flow; 1.40 @@ -288,7 +290,7 @@ 1.41 m = m->in(idx); 1.42 } 1.43 } 1.44 - guarantee( 0, "must find derived/base pair" ); 1.45 + guarantee( 0, "must find derived/base pair" ); 1.46 } 1.47 found: ; 1.48 Node *base = n->in(i+1); // Base is other half of pair 1.49 @@ -347,6 +349,13 @@ 1.50 } else { 1.51 // Other - some reaching non-oop value 1.52 omap->set_value( r); 1.53 +#ifdef ASSERT 1.54 + if( t->isa_rawptr() && C->cfg()->_raw_oops.member(def) ) { 1.55 + def->dump(); 1.56 + n->dump(); 1.57 + assert(false, "there should be a oop in OopMap instead of a live raw oop at safepoint"); 1.58 + } 1.59 +#endif 1.60 } 1.61 1.62 } 1.63 @@ -562,7 +571,7 @@ 1.64 1.65 // Do the first block 'by hand' to prime the worklist 1.66 Block *entry = _cfg->_blocks[1]; 1.67 - OopFlow *rootflow = OopFlow::make(A,max_reg); 1.68 + OopFlow *rootflow = OopFlow::make(A,max_reg,this); 1.69 // Initialize to 'bottom' (not 'top') 1.70 memset( rootflow->_callees, OptoReg::Bad, max_reg*sizeof(short) ); 1.71 memset( rootflow->_defs , 0, max_reg*sizeof(Node*) ); 1.72 @@ -628,7 +637,7 @@ 1.73 // Carry it forward. 1.74 } else { // Draw a new OopFlow from the freelist 1.75 if( !free_list ) 1.76 - free_list = OopFlow::make(A,max_reg); 1.77 + free_list = OopFlow::make(A,max_reg,C); 1.78 flow = free_list; 1.79 assert( flow->_b == NULL, "oopFlow is not free" ); 1.80 free_list = flow->_next;