Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/g1/concurrentMark.cpp
          +++ new/src/share/vm/gc_implementation/g1/concurrentMark.cpp
↓ open down ↓ 2133 lines elided ↑ open up ↑
2134 2134    // about how reference processing currently works in G1.
2135 2135  
2136 2136    // Process weak references.
2137 2137    rp->setup_policy(clear_all_soft_refs);
2138 2138    assert(_markStack.isEmpty(), "mark stack should be empty");
2139 2139  
2140 2140    G1CMIsAliveClosure   g1_is_alive(g1h);
2141 2141    G1CMKeepAliveClosure g1_keep_alive(g1h, this, nextMarkBitMap());
2142 2142    G1CMDrainMarkingStackClosure
2143 2143      g1_drain_mark_stack(nextMarkBitMap(), &_markStack, &g1_keep_alive);
2144      -
2145 2144    // We use the work gang from the G1CollectedHeap and we utilize all
2146 2145    // the worker threads.
2147      -  int active_workers = MAX2(MIN2(g1h->workers()->total_workers(), (int)_max_task_num), 1);
     2146 +  int active_workers = g1h->workers() ? g1h->workers()->total_workers() : 1;
     2147 +  active_workers = MAX2(MIN2(active_workers, (int)_max_task_num), 1);
2148 2148  
2149 2149    G1RefProcTaskExecutor par_task_executor(g1h, this, nextMarkBitMap(),
2150 2150                                            g1h->workers(), active_workers);
2151 2151  
     2152 +
2152 2153    if (rp->processing_is_mt()) {
2153 2154      // Set the degree of MT here.  If the discovery is done MT, there
2154 2155      // may have been a different number of threads doing the discovery
2155 2156      // and a different number of discovered lists may have Ref objects.
2156 2157      // That is OK as long as the Reference lists are balanced (see
2157 2158      // balance_all_queues() and balance_queues()).
2158      -    rp->set_mt_degree(active_workers);
     2159 +    rp->set_active_mt_degree(active_workers);
2159 2160  
2160 2161      rp->process_discovered_references(&g1_is_alive,
2161 2162                                        &g1_keep_alive,
2162 2163                                        &g1_drain_mark_stack,
2163 2164                                        &par_task_executor);
2164 2165  
2165 2166      // The work routines of the parallel keep_alive and drain_marking_stack
2166 2167      // will set the has_overflown flag if we overflow the global marking
2167 2168      // stack.
2168 2169    } else {
↓ open down ↓ 2256 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX