Skip to content

Commit

Permalink
deps: V8: partially revert d868eb7
Browse files Browse the repository at this point in the history
d868eb7 ended up being an inadvertant ABI change. Remove the call to
CheckMemoryPressure from the header itself.

PR-URL: #24499
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
  • Loading branch information
ofrobots authored and MylesBorins committed Nov 20, 2018
1 parent 62dd1d7 commit 5245d6a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 2
#define V8_BUILD_NUMBER 414
#define V8_PATCH_LEVEL 70
#define V8_PATCH_LEVEL 71

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
13 changes: 0 additions & 13 deletions deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -10247,28 +10247,15 @@ uint32_t Isolate::GetNumberOfDataSlots() {

int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
int64_t change_in_bytes) {
const int64_t kMemoryReducerActivationLimit = 1024 * 1024;
typedef internal::Internals I;
int64_t* external_memory = reinterpret_cast<int64_t*>(
reinterpret_cast<uint8_t*>(this) + I::kExternalMemoryOffset);
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) +
I::kExternalMemoryAtLastMarkCompactOffset);
const int64_t amount = *external_memory + change_in_bytes;

*external_memory = amount;

int64_t allocation_diff_since_last_mc =
*external_memory_at_last_mc - *external_memory;
allocation_diff_since_last_mc = allocation_diff_since_last_mc < 0
? -allocation_diff_since_last_mc
: allocation_diff_since_last_mc;
if (allocation_diff_since_last_mc > kMemoryReducerActivationLimit) {
CheckMemoryPressure();
}

if (change_in_bytes < 0) {
*external_memory_limit += change_in_bytes;
}
Expand Down

0 comments on commit 5245d6a

Please sign in to comment.