From b287b9e64b7e51fff86e72d9faf7a13948f54746 Mon Sep 17 00:00:00 2001 From: Ali Ijaz Sheikh Date: Tue, 12 Dec 2017 13:24:42 -0800 Subject: [PATCH] deps: V8: cherry-pick e8e9c07 from upstream Original commit message: Make sure the heap is in consistent state when calling allocation observers. The observer might want to lookup something in the heap, e.g. code objects it has in the call stack. BUG=v8:4959 LOG=N Review-Url: https://codereview.chromium.org/1948893002 Cr-Commit-Position: refs/heads/master@{#36027} Ref: https://bugs.chromium.org/p/v8/issues/detail?id=4959 Ref: https://github.com/v8/v8/commit/e8e9c07e548ea5386f918e8a7f4f42d517725223 --- deps/v8/include/v8-version.h | 2 +- deps/v8/src/heap/spaces.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 2c4fc5f7b09ad0..8dfca512ad4a27 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 5 #define V8_MINOR_VERSION 1 #define V8_BUILD_NUMBER 281 -#define V8_PATCH_LEVEL 110 +#define V8_PATCH_LEVEL 111 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/src/heap/spaces.cc b/deps/v8/src/heap/spaces.cc index 8a7fd1a14fa608..e51c27b56ff447 100644 --- a/deps/v8/src/heap/spaces.cc +++ b/deps/v8/src/heap/spaces.cc @@ -2382,7 +2382,6 @@ HeapObject* FreeList::Allocate(int size_in_bytes) { int new_node_size = 0; FreeSpace* new_node = FindNodeFor(size_in_bytes, &new_node_size); if (new_node == nullptr) return nullptr; - owner_->AllocationStep(new_node->address(), size_in_bytes); int bytes_left = new_node_size - size_in_bytes; DCHECK(bytes_left >= 0); @@ -2428,6 +2427,8 @@ HeapObject* FreeList::Allocate(int size_in_bytes) { new_node->address() + new_node_size); } + owner_->AllocationStep(new_node->address(), size_in_bytes); + return new_node; }