diff options
author | kvn <none@none> | 2009-07-01 20:22:18 -0700 |
---|---|---|
committer | kvn <none@none> | 2009-07-01 20:22:18 -0700 |
commit | 0cf847c751048c4472801c767c2733d008e0f025 (patch) | |
tree | 22d09a062f413a13620a8ed1eceb8e322f941a40 /src/share/vm/opto/buildOopMap.cpp | |
parent | e92d647dcee2231b209565b18e9c78ce59b229f4 (diff) |
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
Summary: Put missed reference to allocated array in copyOf() intrinsic into OopMap for the call slow_arraycopy().
Reviewed-by: never
Diffstat (limited to 'src/share/vm/opto/buildOopMap.cpp')
-rw-r--r-- | src/share/vm/opto/buildOopMap.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/share/vm/opto/buildOopMap.cpp b/src/share/vm/opto/buildOopMap.cpp index 9401e024a..81ad6b7db 100644 --- a/src/share/vm/opto/buildOopMap.cpp +++ b/src/share/vm/opto/buildOopMap.cpp @@ -74,9 +74,11 @@ struct OopFlow : public ResourceObj { // this block. Block *_b; // Block for this struct OopFlow *_next; // Next free OopFlow + // or NULL if dead/conflict + Compile* C; - OopFlow( short *callees, Node **defs ) : _callees(callees), _defs(defs), - _b(NULL), _next(NULL) { } + OopFlow( short *callees, Node **defs, Compile* c ) : _callees(callees), _defs(defs), + _b(NULL), _next(NULL), C(c) { } // Given reaching-defs for this block start, compute it for this block end void compute_reach( PhaseRegAlloc *regalloc, int max_reg, Dict *safehash ); @@ -88,7 +90,7 @@ struct OopFlow : public ResourceObj { void clone( OopFlow *flow, int max_size); // Make a new OopFlow from scratch - static OopFlow *make( Arena *A, int max_size ); + static OopFlow *make( Arena *A, int max_size, Compile* C ); // Build an oopmap from the current flow info OopMap *build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, int* live ); @@ -180,11 +182,11 @@ void OopFlow::clone( OopFlow *flow, int max_size ) { } //------------------------------make------------------------------------------- -OopFlow *OopFlow::make( Arena *A, int max_size ) { +OopFlow *OopFlow::make( Arena *A, int max_size, Compile* C ) { short *callees = NEW_ARENA_ARRAY(A,short,max_size+1); Node **defs = NEW_ARENA_ARRAY(A,Node*,max_size+1); debug_only( memset(defs,0,(max_size+1)*sizeof(Node*)) ); - OopFlow *flow = new (A) OopFlow(callees+1, defs+1); + OopFlow *flow = new (A) OopFlow(callees+1, defs+1, C); assert( &flow->_callees[OptoReg::Bad] == callees, "Ok to index at OptoReg::Bad" ); assert( &flow->_defs [OptoReg::Bad] == defs , "Ok to index at OptoReg::Bad" ); return flow; @@ -288,7 +290,7 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i m = m->in(idx); } } - guarantee( 0, "must find derived/base pair" ); + guarantee( 0, "must find derived/base pair" ); } found: ; Node *base = n->in(i+1); // Base is other half of pair @@ -347,6 +349,13 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i } else { // Other - some reaching non-oop value omap->set_value( r); +#ifdef ASSERT + if( t->isa_rawptr() && C->cfg()->_raw_oops.member(def) ) { + def->dump(); + n->dump(); + assert(false, "there should be a oop in OopMap instead of a live raw oop at safepoint"); + } +#endif } } @@ -562,7 +571,7 @@ void Compile::BuildOopMaps() { // Do the first block 'by hand' to prime the worklist Block *entry = _cfg->_blocks[1]; - OopFlow *rootflow = OopFlow::make(A,max_reg); + OopFlow *rootflow = OopFlow::make(A,max_reg,this); // Initialize to 'bottom' (not 'top') memset( rootflow->_callees, OptoReg::Bad, max_reg*sizeof(short) ); memset( rootflow->_defs , 0, max_reg*sizeof(Node*) ); @@ -628,7 +637,7 @@ void Compile::BuildOopMaps() { // Carry it forward. } else { // Draw a new OopFlow from the freelist if( !free_list ) - free_list = OopFlow::make(A,max_reg); + free_list = OopFlow::make(A,max_reg,C); flow = free_list; assert( flow->_b == NULL, "oopFlow is not free" ); free_list = flow->_next; |