1.1 --- a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Wed Jun 27 15:23:36 2012 +0200 1.2 +++ b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Thu Jun 28 17:03:16 2012 -0400 1.3 @@ -59,7 +59,7 @@ 1.4 Generation* old_gen_, 1.5 int thread_num_, 1.6 ObjToScanQueueSet* work_queue_set_, 1.7 - Stack<oop>* overflow_stacks_, 1.8 + Stack<oop, mtGC>* overflow_stacks_, 1.9 size_t desired_plab_sz_, 1.10 ParallelTaskTerminator& term_) : 1.11 _to_space(to_space_), _old_gen(old_gen_), _young_gen(gen_), _thread_num(thread_num_), 1.12 @@ -184,7 +184,7 @@ 1.13 assert(ParGCUseLocalOverflow, "Else should not call"); 1.14 assert(young_gen()->overflow_list() == NULL, "Error"); 1.15 ObjToScanQueue* queue = work_queue(); 1.16 - Stack<oop>* const of_stack = overflow_stack(); 1.17 + Stack<oop, mtGC>* const of_stack = overflow_stack(); 1.18 const size_t num_overflow_elems = of_stack->size(); 1.19 const size_t space_available = queue->max_elems() - queue->size(); 1.20 const size_t num_take_elems = MIN3(space_available / 4, 1.21 @@ -297,7 +297,7 @@ 1.22 ParNewGeneration& gen, 1.23 Generation& old_gen, 1.24 ObjToScanQueueSet& queue_set, 1.25 - Stack<oop>* overflow_stacks_, 1.26 + Stack<oop, mtGC>* overflow_stacks_, 1.27 size_t desired_plab_sz, 1.28 ParallelTaskTerminator& term); 1.29 1.30 @@ -331,7 +331,7 @@ 1.31 ParScanThreadStateSet::ParScanThreadStateSet( 1.32 int num_threads, Space& to_space, ParNewGeneration& gen, 1.33 Generation& old_gen, ObjToScanQueueSet& queue_set, 1.34 - Stack<oop>* overflow_stacks, 1.35 + Stack<oop, mtGC>* overflow_stacks, 1.36 size_t desired_plab_sz, ParallelTaskTerminator& term) 1.37 : ResourceArray(sizeof(ParScanThreadState), num_threads), 1.38 _gen(gen), _next_gen(old_gen), _term(term) 1.39 @@ -649,9 +649,14 @@ 1.40 1.41 _overflow_stacks = NULL; 1.42 if (ParGCUseLocalOverflow) { 1.43 - _overflow_stacks = NEW_C_HEAP_ARRAY(Stack<oop>, ParallelGCThreads); 1.44 + 1.45 + // typedef to workaround NEW_C_HEAP_ARRAY macro, which can not deal 1.46 + // with ',' 1.47 + typedef Stack<oop, mtGC> GCOopStack; 1.48 + 1.49 + _overflow_stacks = NEW_C_HEAP_ARRAY(GCOopStack, ParallelGCThreads, mtGC); 1.50 for (size_t i = 0; i < ParallelGCThreads; ++i) { 1.51 - new (_overflow_stacks + i) Stack<oop>(); 1.52 + new (_overflow_stacks + i) Stack<oop, mtGC>(); 1.53 } 1.54 } 1.55 1.56 @@ -1401,7 +1406,7 @@ 1.57 assert(_num_par_pushes > 0, "Tautology"); 1.58 #endif 1.59 if (from_space_obj->forwardee() == from_space_obj) { 1.60 - oopDesc* listhead = NEW_C_HEAP_ARRAY(oopDesc, 1); 1.61 + oopDesc* listhead = NEW_C_HEAP_ARRAY(oopDesc, 1, mtGC); 1.62 listhead->forward_to(from_space_obj); 1.63 from_space_obj = listhead; 1.64 } 1.65 @@ -1553,7 +1558,7 @@ 1.66 // This can become a scaling bottleneck when there is work queue overflow coincident 1.67 // with promotion failure. 1.68 oopDesc* f = cur; 1.69 - FREE_C_HEAP_ARRAY(oopDesc, f); 1.70 + FREE_C_HEAP_ARRAY(oopDesc, f, mtGC); 1.71 } else if (par_scan_state->should_be_partially_scanned(obj_to_push, cur)) { 1.72 assert(arrayOop(cur)->length() == 0, "entire array remaining to be scanned"); 1.73 obj_to_push = cur;