Skip to content

Commit 859dc64

Browse files
ofrobotsMylesBorins
authored andcommitted
deps: V8: cherry-pick 5ebd6fcd from upstream
Original commit message: [heap] Lower external allocation limit when external memory shrinks. BUG=chromium:728228 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_rel_ng Review-Url: https://codereview.chromium.org/2921883002 Cr-Commit-Position: refs/heads/master@{#45726} PR-URL: #21269 Fixes: #21021 Reviewed-By: Myles Borins <[email protected]>
1 parent ce5ba6d commit 859dc64

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
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 6
1212
#define V8_MINOR_VERSION 2
1313
#define V8_BUILD_NUMBER 414
14-
#define V8_PATCH_LEVEL 56
14+
#define V8_PATCH_LEVEL 57
1515

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

deps/v8/include/v8.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -10251,7 +10251,7 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
1025110251
typedef internal::Internals I;
1025210252
int64_t* external_memory = reinterpret_cast<int64_t*>(
1025310253
reinterpret_cast<uint8_t*>(this) + I::kExternalMemoryOffset);
10254-
const int64_t external_memory_limit = *reinterpret_cast<int64_t*>(
10254+
int64_t* external_memory_limit = reinterpret_cast<int64_t*>(
1025510255
reinterpret_cast<uint8_t*>(this) + I::kExternalMemoryLimitOffset);
1025610256
int64_t* external_memory_at_last_mc =
1025710257
reinterpret_cast<int64_t*>(reinterpret_cast<uint8_t*>(this) +
@@ -10269,7 +10269,11 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
1026910269
CheckMemoryPressure();
1027010270
}
1027110271

10272-
if (change_in_bytes > 0 && amount > external_memory_limit) {
10272+
if (change_in_bytes < 0) {
10273+
*external_memory_limit += change_in_bytes;
10274+
}
10275+
10276+
if (change_in_bytes > 0 && amount > *external_memory_limit) {
1027310277
ReportExternalAllocationLimitReached();
1027410278
}
1027510279
return *external_memory;

0 commit comments

Comments
 (0)