Skip to content

Commit

Permalink
Merge pull request #3683 from amicic/CS_no_Nusery_movement
Browse files Browse the repository at this point in the history
Prevent object movement in Nursery contract
  • Loading branch information
charliegracie authored Mar 24, 2019
2 parents aa81833 + 0649b2b commit 9f86693
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions gc/base/standard/PhysicalSubArenaVirtualMemorySemiSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,19 @@ MM_PhysicalSubArenaVirtualMemorySemiSpace::contract(MM_EnvironmentBase *env, uin

/* Check if the move location actually does in fact move any valid heap */
if(allocateSegmentBase > allocateLeadingFreeTop) {
if (extensions->isConcurrentScavengerEnabled()) {
/* Fixup logic does not account for possible object growth, which would be required for objects
* that have been allocated and hashed during the last concurrent phase (hence, in hybrid Survivor-Allocate
* that is subject to movement).
*/
if(debug) {
omrtty_printf("\tHeap movement (%p %p) to (%p %p) required, but not allowed with CS enabled.\n",
allocateLeadingFreeTop, allocateTrailingFreeBase,
allocateSegmentBase, ((uintptr_t)allocateSegmentBase) + heapSizeToMove);
}
return 0;
}

/* Adjust all fields that point to the refered to region */
struct Modron_psavmssMoveData psavmssMoveData;
psavmssMoveData.env = env;
Expand Down Expand Up @@ -716,6 +729,19 @@ MM_PhysicalSubArenaVirtualMemorySemiSpace::contract(MM_EnvironmentBase *env, uin

/* Check if the move location actually does in fact move any valid heap */
if(allocateSegmentBase > allocateLeadingFreeTop) {
if (extensions->isConcurrentScavengerEnabled()) {
/* Fixup logic does not account for possible object growth, which would be required for objects
* that have been allocated and hashed during the last concurrent phase (hence, in hybrid Survivor-Allocate
* that is subject to movement).
*/
if(debug) {
omrtty_printf("\tHeap movement (%p %p) to (%p %p) required, but not allowed with CS enabled.\n",
allocateLeadingFreeTop, allocateTrailingFreeBase,
allocateSegmentBase, ((uintptr_t)allocateSegmentBase) + heapSizeToMove);
}
return 0;
}

/* Adjust all fields that point to the refered to region */
struct Modron_psavmssMoveData psavmssMoveData;
psavmssMoveData.env = env;
Expand Down

0 comments on commit 9f86693

Please sign in to comment.