Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 642:660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
Summary: Use zero based compressed oops if java heap is below 32gb and unscaled compressed oops if java heap is below 4gb.
Reviewed-by: never, twisti, jcoomes, coleenp
author | kvn |
---|---|
date | Thu, 12 Mar 2009 10:37:46 -0700 |
parents | bcedf688d882 |
children | bd441136a5ce |
comparison
equal
deleted
inserted
replaced
641:6af0a709d52b | 642:660978a2a31a |
---|---|
1358 _cg1r = new ConcurrentG1Refine(); | 1358 _cg1r = new ConcurrentG1Refine(); |
1359 | 1359 |
1360 // Reserve the maximum. | 1360 // Reserve the maximum. |
1361 PermanentGenerationSpec* pgs = collector_policy()->permanent_generation(); | 1361 PermanentGenerationSpec* pgs = collector_policy()->permanent_generation(); |
1362 // Includes the perm-gen. | 1362 // Includes the perm-gen. |
1363 | |
1364 const size_t total_reserved = max_byte_size + pgs->max_size(); | |
1365 char* addr = Universe::preferred_heap_base(total_reserved, Universe::UnscaledNarrowOop); | |
1366 | |
1363 ReservedSpace heap_rs(max_byte_size + pgs->max_size(), | 1367 ReservedSpace heap_rs(max_byte_size + pgs->max_size(), |
1364 HeapRegion::GrainBytes, | 1368 HeapRegion::GrainBytes, |
1365 false /*ism*/); | 1369 false /*ism*/, addr); |
1370 | |
1371 if (UseCompressedOops) { | |
1372 if (addr != NULL && !heap_rs.is_reserved()) { | |
1373 // Failed to reserve at specified address - the requested memory | |
1374 // region is taken already, for example, by 'java' launcher. | |
1375 // Try again to reserver heap higher. | |
1376 addr = Universe::preferred_heap_base(total_reserved, Universe::ZeroBasedNarrowOop); | |
1377 ReservedSpace heap_rs0(total_reserved, HeapRegion::GrainBytes, | |
1378 false /*ism*/, addr); | |
1379 if (addr != NULL && !heap_rs0.is_reserved()) { | |
1380 // Failed to reserve at specified address again - give up. | |
1381 addr = Universe::preferred_heap_base(total_reserved, Universe::HeapBasedNarrowOop); | |
1382 assert(addr == NULL, ""); | |
1383 ReservedSpace heap_rs1(total_reserved, HeapRegion::GrainBytes, | |
1384 false /*ism*/, addr); | |
1385 heap_rs = heap_rs1; | |
1386 } else { | |
1387 heap_rs = heap_rs0; | |
1388 } | |
1389 } | |
1390 } | |
1366 | 1391 |
1367 if (!heap_rs.is_reserved()) { | 1392 if (!heap_rs.is_reserved()) { |
1368 vm_exit_during_initialization("Could not reserve enough space for object heap"); | 1393 vm_exit_during_initialization("Could not reserve enough space for object heap"); |
1369 return JNI_ENOMEM; | 1394 return JNI_ENOMEM; |
1370 } | 1395 } |