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

changeset 1
2d8a650513c2
parent 0
f90c822e73f8
child 25
873fd82b133d
equal deleted inserted replaced
0:f90c822e73f8 1:2d8a650513c2
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
25 #include "precompiled.hpp" 31 #include "precompiled.hpp"
26 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" 32 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
27 #include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" 33 #include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
28 #include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp" 34 #include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp"
29 #include "gc_implementation/parallelScavenge/psOldGen.hpp" 35 #include "gc_implementation/parallelScavenge/psOldGen.hpp"
36 #include "gc_implementation/shared/mutableNUMASpace.hpp"
30 #include "gc_implementation/shared/spaceDecorator.hpp" 37 #include "gc_implementation/shared/spaceDecorator.hpp"
31 #include "memory/cardTableModRefBS.hpp" 38 #include "memory/cardTableModRefBS.hpp"
32 #include "memory/gcLocker.inline.hpp" 39 #include "memory/gcLocker.inline.hpp"
33 #include "oops/oop.inline.hpp" 40 #include "oops/oop.inline.hpp"
34 #include "runtime/java.hpp" 41 #include "runtime/java.hpp"
126 } 133 }
127 134
128 // 135 //
129 // ObjectSpace stuff 136 // ObjectSpace stuff
130 // 137 //
131 138 if(UseOldNUMA) {
132 _object_space = new MutableSpace(virtual_space()->alignment()); 139 _object_space = new MutableNUMASpace(virtual_space()->alignment());
140 }
141 else {
142 _object_space = new MutableSpace(virtual_space()->alignment());
143 }
133 144
134 if (_object_space == NULL) 145 if (_object_space == NULL)
135 vm_exit_during_initialization("Could not allocate an old gen space"); 146 vm_exit_during_initialization("Could not allocate an old gen space");
136 147
137 object_space()->initialize(cmr, 148 object_space()->initialize(cmr,
212 os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false); 223 os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
213 } 224 }
214 return allocate_noexpand(word_size); 225 return allocate_noexpand(word_size);
215 } 226 }
216 227
217 HeapWord* PSOldGen::expand_and_cas_allocate(size_t word_size) { 228 HeapWord* PSOldGen::expand_and_cas_allocate(size_t word_size, int node) {
218 expand(word_size*HeapWordSize); 229 expand(word_size*HeapWordSize);
219 if (GCExpandToAllocateDelayMillis > 0) { 230 if (GCExpandToAllocateDelayMillis > 0) {
220 os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false); 231 os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
221 } 232 }
222 return cas_allocate_noexpand(word_size); 233 return cas_allocate_noexpand(word_size, node);
223 } 234 }
224 235
225 void PSOldGen::expand(size_t bytes) { 236 void PSOldGen::expand(size_t bytes) {
226 if (bytes == 0) { 237 if (bytes == 0) {
227 return; 238 return;
400 411
401 start_array()->set_covered_region(new_memregion); 412 start_array()->set_covered_region(new_memregion);
402 Universe::heap()->barrier_set()->resize_covered_region(new_memregion); 413 Universe::heap()->barrier_set()->resize_covered_region(new_memregion);
403 414
404 // ALWAYS do this last!! 415 // ALWAYS do this last!!
405 object_space()->initialize(new_memregion, 416 if(UseOldNUMA) {
406 SpaceDecorator::DontClear, 417 HeapWord* const virtual_space_high = (HeapWord*) virtual_space()->high();
407 SpaceDecorator::DontMangle); 418 object_space()->set_end(virtual_space_high);
408 419 }
420 else {
421 object_space()->initialize(new_memregion,
422 SpaceDecorator::DontClear,
423 SpaceDecorator::DontMangle);
424 }
425
409 assert(new_word_size == heap_word_size(object_space()->capacity_in_bytes()), 426 assert(new_word_size == heap_word_size(object_space()->capacity_in_bytes()),
410 "Sanity"); 427 "Sanity");
411 } 428 }
412 429
413 size_t PSOldGen::gen_size_limit() { 430 size_t PSOldGen::gen_size_limit() {

mercurial