comparison src/share/vm/opto/output.cpp @ 2346:e1162778c1c8

7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error Summary: A referent object that is only weakly reachable at the start of concurrent marking but is re-attached to the strongly reachable object graph during marking may not be marked as live. This can cause the reference object to be processed prematurely and leave dangling pointers to the referent object. Implement a read barrier for the java.lang.ref.Reference::referent field by intrinsifying the Reference.get() method, and intercepting accesses though JNI, reflection, and Unsafe, so that when a non-null referent object is read it is also logged in an SATB buffer. Reviewed-by: kvn, iveresov, never, tonyp, dholmes
author johnc
date Thu, 07 Apr 2011 09:53:20 -0700
parents 1c0cf339481b
children 92add02409c9
comparison
equal deleted inserted replaced
37:652deef02b79 39:c916dfe71dfa
1352 1352
1353 #ifdef ASSERT 1353 #ifdef ASSERT
1354 // Check that oop-store precedes the card-mark 1354 // Check that oop-store precedes the card-mark
1355 else if( mach->ideal_Opcode() == Op_StoreCM ) { 1355 else if( mach->ideal_Opcode() == Op_StoreCM ) {
1356 uint storeCM_idx = j; 1356 uint storeCM_idx = j;
1357 Node *oop_store = mach->in(mach->_cnt); // First precedence edge 1357 int count = 0;
1358 assert( oop_store != NULL, "storeCM expects a precedence edge"); 1358 for (uint prec = mach->req(); prec < mach->len(); prec++) {
1359 uint i4; 1359 Node *oop_store = mach->in(prec); // Precedence edge
1360 for( i4 = 0; i4 < last_inst; ++i4 ) { 1360 if (oop_store == NULL) continue;
1361 if( b->_nodes[i4] == oop_store ) break; 1361 count++;
1362 uint i4;
1363 for( i4 = 0; i4 < last_inst; ++i4 ) {
1364 if( b->_nodes[i4] == oop_store ) break;
1365 }
1366 // Note: This test can provide a false failure if other precedence
1367 // edges have been added to the storeCMNode.
1368 assert( i4 == last_inst || i4 < storeCM_idx, "CM card-mark executes before oop-store");
1362 } 1369 }
1363 // Note: This test can provide a false failure if other precedence 1370 assert(count > 0, "storeCM expects at least one precedence edge");
1364 // edges have been added to the storeCMNode.
1365 assert( i4 == last_inst || i4 < storeCM_idx, "CM card-mark executes before oop-store");
1366 } 1371 }
1367 #endif 1372 #endif
1368 1373
1369 else if( !n->is_Proj() ) { 1374 else if( !n->is_Proj() ) {
1370 // Remember the beginning of the previous instruction, in case 1375 // Remember the beginning of the previous instruction, in case