src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp

changeset 25
873fd82b133d
parent 1
2d8a650513c2
child 6876
710a3c8b516e
equal deleted inserted replaced
24:d2be62fdfa50 25:873fd82b133d
20 * or visit www.oracle.com if you need additional information or have any 20 * or visit www.oracle.com if you need additional information or have any
21 * questions. 21 * questions.
22 * 22 *
23 */ 23 */
24 24
25 /*
26 * This file has been modified by Loongson Technology in 2015. These
27 * modifications are Copyright (c) 2015 Loongson Technology, and are made
28 * available on the same license terms set forth above.
29 */
30
31 #include "precompiled.hpp" 25 #include "precompiled.hpp"
32 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" 26 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
33 #include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" 27 #include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
34 #include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp" 28 #include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp"
35 #include "gc_implementation/parallelScavenge/psOldGen.hpp" 29 #include "gc_implementation/parallelScavenge/psOldGen.hpp"
36 #include "gc_implementation/shared/mutableNUMASpace.hpp"
37 #include "gc_implementation/shared/spaceDecorator.hpp" 30 #include "gc_implementation/shared/spaceDecorator.hpp"
38 #include "memory/cardTableModRefBS.hpp" 31 #include "memory/cardTableModRefBS.hpp"
39 #include "memory/gcLocker.inline.hpp" 32 #include "memory/gcLocker.inline.hpp"
40 #include "oops/oop.inline.hpp" 33 #include "oops/oop.inline.hpp"
41 #include "runtime/java.hpp" 34 #include "runtime/java.hpp"
133 } 126 }
134 127
135 // 128 //
136 // ObjectSpace stuff 129 // ObjectSpace stuff
137 // 130 //
138 if(UseOldNUMA) { 131
139 _object_space = new MutableNUMASpace(virtual_space()->alignment()); 132 _object_space = new MutableSpace(virtual_space()->alignment());
140 }
141 else {
142 _object_space = new MutableSpace(virtual_space()->alignment());
143 }
144 133
145 if (_object_space == NULL) 134 if (_object_space == NULL)
146 vm_exit_during_initialization("Could not allocate an old gen space"); 135 vm_exit_during_initialization("Could not allocate an old gen space");
147 136
148 object_space()->initialize(cmr, 137 object_space()->initialize(cmr,
223 os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false); 212 os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
224 } 213 }
225 return allocate_noexpand(word_size); 214 return allocate_noexpand(word_size);
226 } 215 }
227 216
228 HeapWord* PSOldGen::expand_and_cas_allocate(size_t word_size, int node) { 217 HeapWord* PSOldGen::expand_and_cas_allocate(size_t word_size) {
229 expand(word_size*HeapWordSize); 218 expand(word_size*HeapWordSize);
230 if (GCExpandToAllocateDelayMillis > 0) { 219 if (GCExpandToAllocateDelayMillis > 0) {
231 os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false); 220 os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
232 } 221 }
233 return cas_allocate_noexpand(word_size, node); 222 return cas_allocate_noexpand(word_size);
234 } 223 }
235 224
236 void PSOldGen::expand(size_t bytes) { 225 void PSOldGen::expand(size_t bytes) {
237 if (bytes == 0) { 226 if (bytes == 0) {
238 return; 227 return;
411 400
412 start_array()->set_covered_region(new_memregion); 401 start_array()->set_covered_region(new_memregion);
413 Universe::heap()->barrier_set()->resize_covered_region(new_memregion); 402 Universe::heap()->barrier_set()->resize_covered_region(new_memregion);
414 403
415 // ALWAYS do this last!! 404 // ALWAYS do this last!!
416 if(UseOldNUMA) { 405 object_space()->initialize(new_memregion,
417 HeapWord* const virtual_space_high = (HeapWord*) virtual_space()->high(); 406 SpaceDecorator::DontClear,
418 object_space()->set_end(virtual_space_high); 407 SpaceDecorator::DontMangle);
419 } 408
420 else {
421 object_space()->initialize(new_memregion,
422 SpaceDecorator::DontClear,
423 SpaceDecorator::DontMangle);
424 }
425
426 assert(new_word_size == heap_word_size(object_space()->capacity_in_bytes()), 409 assert(new_word_size == heap_word_size(object_space()->capacity_in_bytes()),
427 "Sanity"); 410 "Sanity");
428 } 411 }
429 412
430 size_t PSOldGen::gen_size_limit() { 413 size_t PSOldGen::gen_size_limit() {

mercurial