< prev index next >

src/hotspot/share/gc/cms/parNewGeneration.cpp

Print this page

1385         observed_overflow_list =
1386           Atomic::cmpxchg((oopDesc*)suffix, &_overflow_list, (oopDesc*)cur_overflow_list);
1387       } while (cur_overflow_list != observed_overflow_list);
1388     }
1389   }
1390 
1391   // Push objects on prefix list onto this thread's work queue
1392   assert(prefix != NULL && prefix != BUSY, "program logic");
1393   cur = prefix;
1394   ssize_t n = 0;
1395   while (cur != NULL) {
1396     oop obj_to_push = cur->forwardee();
1397     oop next        = cur->list_ptr_from_klass();
1398     cur->set_klass(obj_to_push->klass());
1399     // This may be an array object that is self-forwarded. In that case, the list pointer
1400     // space, cur, is not in the Java heap, but rather in the C-heap and should be freed.
1401     if (!is_in_reserved(cur)) {
1402       // This can become a scaling bottleneck when there is work queue overflow coincident
1403       // with promotion failure.
1404       oopDesc* f = cur;
1405       FREE_C_HEAP_ARRAY(oopDesc, f);
1406     } else if (par_scan_state->should_be_partially_scanned(obj_to_push, cur)) {
1407       assert(arrayOop(cur)->length() == 0, "entire array remaining to be scanned");
1408       obj_to_push = cur;
1409     }
1410     bool ok = work_q->push(obj_to_push);
1411     assert(ok, "Should have succeeded");
1412     cur = next;
1413     n++;
1414   }
1415   TASKQUEUE_STATS_ONLY(par_scan_state->note_overflow_refill(n));
1416 #ifndef PRODUCT
1417   assert(_num_par_pushes >= n, "Too many pops?");
1418   Atomic::sub(n, &_num_par_pushes);
1419 #endif
1420   return true;
1421 }
1422 #undef BUSY
1423 
1424 void ParNewGeneration::ref_processor_init() {
1425   if (_ref_processor == NULL) {

1385         observed_overflow_list =
1386           Atomic::cmpxchg((oopDesc*)suffix, &_overflow_list, (oopDesc*)cur_overflow_list);
1387       } while (cur_overflow_list != observed_overflow_list);
1388     }
1389   }
1390 
1391   // Push objects on prefix list onto this thread's work queue
1392   assert(prefix != NULL && prefix != BUSY, "program logic");
1393   cur = prefix;
1394   ssize_t n = 0;
1395   while (cur != NULL) {
1396     oop obj_to_push = cur->forwardee();
1397     oop next        = cur->list_ptr_from_klass();
1398     cur->set_klass(obj_to_push->klass());
1399     // This may be an array object that is self-forwarded. In that case, the list pointer
1400     // space, cur, is not in the Java heap, but rather in the C-heap and should be freed.
1401     if (!is_in_reserved(cur)) {
1402       // This can become a scaling bottleneck when there is work queue overflow coincident
1403       // with promotion failure.
1404       oopDesc* f = cur;
1405       FREE_C_HEAP_OBJ(f);
1406     } else if (par_scan_state->should_be_partially_scanned(obj_to_push, cur)) {
1407       assert(arrayOop(cur)->length() == 0, "entire array remaining to be scanned");
1408       obj_to_push = cur;
1409     }
1410     bool ok = work_q->push(obj_to_push);
1411     assert(ok, "Should have succeeded");
1412     cur = next;
1413     n++;
1414   }
1415   TASKQUEUE_STATS_ONLY(par_scan_state->note_overflow_refill(n));
1416 #ifndef PRODUCT
1417   assert(_num_par_pushes >= n, "Too many pops?");
1418   Atomic::sub(n, &_num_par_pushes);
1419 #endif
1420   return true;
1421 }
1422 #undef BUSY
1423 
1424 void ParNewGeneration::ref_processor_init() {
1425   if (_ref_processor == NULL) {
< prev index next >