src/hotspot/share/gc/g1/g1CollectedHeap.cpp
changeset 59249 29b0d0b61615
parent 59198 92c98aa0f801
child 59252 623722a6aeb9
equal deleted inserted replaced
59248:e92153ed8bdc 59249:29b0d0b61615
  4224     G1CollectedHeap* g1h = G1CollectedHeap::heap();
  4224     G1CollectedHeap* g1h = G1CollectedHeap::heap();
  4225 
  4225 
  4226     HeapRegion* r = g1h->region_at(region_idx);
  4226     HeapRegion* r = g1h->region_at(region_idx);
  4227     assert(!g1h->is_on_master_free_list(r), "sanity");
  4227     assert(!g1h->is_on_master_free_list(r), "sanity");
  4228 
  4228 
  4229     Atomic::add(r->rem_set()->occupied_locked(), &_rs_length);
  4229     Atomic::add(&_rs_length, r->rem_set()->occupied_locked());
  4230 
  4230 
  4231     if (!is_young) {
  4231     if (!is_young) {
  4232       g1h->hot_card_cache()->reset_card_counts(r);
  4232       g1h->hot_card_cache()->reset_card_counts(r);
  4233     }
  4233     }
  4234 
  4234 
  4288   virtual void work(uint worker_id) {
  4288   virtual void work(uint worker_id) {
  4289     G1GCPhaseTimes* timer = G1CollectedHeap::heap()->phase_times();
  4289     G1GCPhaseTimes* timer = G1CollectedHeap::heap()->phase_times();
  4290 
  4290 
  4291     // Claim serial work.
  4291     // Claim serial work.
  4292     if (_serial_work_claim == 0) {
  4292     if (_serial_work_claim == 0) {
  4293       jint value = Atomic::add(1, &_serial_work_claim) - 1;
  4293       jint value = Atomic::add(&_serial_work_claim, 1) - 1;
  4294       if (value == 0) {
  4294       if (value == 0) {
  4295         double serial_time = os::elapsedTime();
  4295         double serial_time = os::elapsedTime();
  4296         do_serial_work();
  4296         do_serial_work();
  4297         timer->record_serial_free_cset_time_ms((os::elapsedTime() - serial_time) * 1000.0);
  4297         timer->record_serial_free_cset_time_ms((os::elapsedTime() - serial_time) * 1000.0);
  4298       }
  4298       }
  4303     bool has_young_time = false;
  4303     bool has_young_time = false;
  4304     double non_young_time = 0.0;
  4304     double non_young_time = 0.0;
  4305     bool has_non_young_time = false;
  4305     bool has_non_young_time = false;
  4306 
  4306 
  4307     while (true) {
  4307     while (true) {
  4308       size_t end = Atomic::add(chunk_size(), &_parallel_work_claim);
  4308       size_t end = Atomic::add(&_parallel_work_claim, chunk_size());
  4309       size_t cur = end - chunk_size();
  4309       size_t cur = end - chunk_size();
  4310 
  4310 
  4311       if (cur >= _num_work_items) {
  4311       if (cur >= _num_work_items) {
  4312         break;
  4312         break;
  4313       }
  4313       }