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: https://github.com/nodejs/node/pull/21269
Fixes: https://github.com/nodejs/node/issues/21021
Reviewed-By: Myles Borins <myles.borins@gmail.com>
This commit is contained in:
Ali Ijaz Sheikh authored and Rod Vagg committed 2018-08-16 11:38:49 +10:00
1 parent d868eb784c
commit e6cd7e57b3
2 files changed
+7 -3

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 2
#define V8_BUILD_NUMBER 414
#define V8_PATCH_LEVEL 56
#define V8_PATCH_LEVEL 57
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
+6 -2
View File
@@ -10251,7 +10251,7 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
typedef internal::Internals I;
int64_t* external_memory = reinterpret_cast<int64_t*>(
reinterpret_cast<uint8_t*>(this) + I::kExternalMemoryOffset);
const int64_t external_memory_limit = *reinterpret_cast<int64_t*>(
int64_t* external_memory_limit = reinterpret_cast<int64_t*>(
reinterpret_cast<uint8_t*>(this) + I::kExternalMemoryLimitOffset);
int64_t* external_memory_at_last_mc =
reinterpret_cast<int64_t*>(reinterpret_cast<uint8_t*>(this) +
@@ -10269,7 +10269,11 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
CheckMemoryPressure();
}
if (change_in_bytes > 0 && amount > external_memory_limit) {
if (change_in_bytes < 0) {
*external_memory_limit += change_in_bytes;
}
if (change_in_bytes > 0 && amount > *external_memory_limit) {
ReportExternalAllocationLimitReached();
}
return *external_memory;