Skip to content

Commit 635cd85

Browse files
Change policy on root removal
Currently, if RootRelease is called on a pinned object, we indicate that we have a candidate for an exhaustive GC. However, we don't do this for other sources of root removal- this change expands the RootRelease behavior to all cases of explicit root unpinning.
1 parent cf864b3 commit 635cd85

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

lib/Common/Memory/Recycler.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,9 +702,9 @@ Recycler::RootRelease(void* obj, uint *count)
702702
RECYCLER_PERF_COUNTER_DEC(PinnedObject);
703703
}
704704

705-
// Not a real collection. This doesn't activate GC.
706-
// This tell the GC that we have an exhaustive candidate, and should trigger
707-
// another GC if there is an exhaustive GC going on.
705+
// Any time a root is removed during a GC, it indicates that an exhaustive
706+
// collection is likely going to have work to do so trigger an exhaustive
707+
// candidate GC to indicate this fact
708708
this->CollectNow<CollectExhaustiveCandidate>();
709709
}
710710

@@ -7717,6 +7717,11 @@ Recycler::DeleteGuestArena(ArenaAllocator * arenaAllocator)
77177717
{
77187718
guestArenaList.RemoveElement(&HeapAllocator::Instance, guestArenaAllocator);
77197719
}
7720+
7721+
// Any time a root is removed during a GC, it indicates that an exhaustive
7722+
// collection is likely going to have work to do so trigger an exhaustive
7723+
// candidate GC to indicate this fact
7724+
this->CollectNow<CollectExhaustiveCandidate>();
77207725
}
77217726

77227727
#ifdef LEAK_REPORT

lib/Common/Memory/Recycler.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,11 +1247,21 @@ class Recycler
12471247
void UnregisterExternalGuestArena(ArenaData* guestArena)
12481248
{
12491249
externalGuestArenaList.Remove(&NoThrowHeapAllocator::Instance, guestArena);
1250+
1251+
// Any time a root is removed during a GC, it indicates that an exhaustive
1252+
// collection is likely going to have work to do so trigger an exhaustive
1253+
// candidate GC to indicate this fact
1254+
this->CollectNow<CollectExhaustiveCandidate>();
12501255
}
12511256

12521257
void UnregisterExternalGuestArena(ArenaData** guestArena)
12531258
{
12541259
externalGuestArenaList.RemoveElement(&NoThrowHeapAllocator::Instance, guestArena);
1260+
1261+
// Any time a root is removed during a GC, it indicates that an exhaustive
1262+
// collection is likely going to have work to do so trigger an exhaustive
1263+
// candidate GC to indicate this fact
1264+
this->CollectNow<CollectExhaustiveCandidate>();
12551265
}
12561266

12571267
#ifdef RECYCLER_TEST_SUPPORT

test/typedarray/rlexe.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,13 @@ Below test fails with difference in space. Investigate the cause and re-enable t
314314
<compile-flags>-mic:1 -off:simplejit -off:JITLoopBody -mmoc:0</compile-flags>
315315
</default>
316316
</test>
317-
<!--Disabling this test case until the bug 9706251 is fixed
318317
<test>
319318
<default>
320319
<files>typedarray_bugfixes.js</files>
321320
<compile-flags>-Off:Deferparse -args summary -endargs</compile-flags>
322321
<tags>BugFix</tags>
323322
</default>
324-
</test>-->
323+
</test>
325324
<test>
326325
<default>
327326
<files>bug_OS_6911900.js</files>

0 commit comments

Comments
 (0)