Skip to content

Commit 0fcf249

Browse files
Matt Loringjasnell
Matt Loring
authored andcommitted
deps: cherry-pick bb4974d from v8 upstream
Original commit message: [heap] Properly propagate allocated space during new space evacuaton in MC New space evaucation in MC supports, similar to scavenges, fall back allocation in old space. For new space evacuation we support sticky and non-sticky modes for fallback. The sticky mode essentially removes the capability to allocate in new space while the non-sticky mode only falls back for a single allocation. We use the non-sticky mode for allocations that are too large for a LAB but should still go in new space. When such an allocation fails in new space, we allocate in old space in non-sticky mode as we would still like to reuse the remainder memory in new space. However, in such a case we fail to properly report the space allocated in resulting in a missed recorded slot. BUG=chromium:641270 [email protected] Review-Url: https://codereview.chromium.org/2280943002 Cr-Commit-Position: refs/heads/master@{#38940} PR-URL: #9192 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 8bb346d commit 0fcf249

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 5
1212
#define V8_MINOR_VERSION 1
1313
#define V8_BUILD_NUMBER 281
14-
#define V8_PATCH_LEVEL 84
14+
#define V8_PATCH_LEVEL 85
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/heap/mark-compact.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,7 @@ class MarkCompactCollector::EvacuateNewSpaceVisitor final
16741674
const int size = old_object->Size();
16751675
AllocationAlignment alignment = old_object->RequiredAlignment();
16761676
AllocationResult allocation;
1677+
AllocationSpace space_allocated_in = space_to_allocate_;
16771678
if (space_to_allocate_ == NEW_SPACE) {
16781679
if (size > kMaxLabObjectSize) {
16791680
allocation =
@@ -1684,11 +1685,12 @@ class MarkCompactCollector::EvacuateNewSpaceVisitor final
16841685
}
16851686
if (allocation.IsRetry() || (space_to_allocate_ == OLD_SPACE)) {
16861687
allocation = AllocateInOldSpace(size, alignment);
1688+
space_allocated_in = OLD_SPACE;
16871689
}
16881690
bool ok = allocation.To(target_object);
16891691
DCHECK(ok);
16901692
USE(ok);
1691-
return space_to_allocate_;
1693+
return space_allocated_in;
16921694
}
16931695

16941696
inline bool NewLocalAllocationBuffer() {

0 commit comments

Comments
 (0)