Commit ec1c5009 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

Revert "[heap] Use AdjustAmountOfExternalMemory to account freed array buffers."

This reverts commit 5ea58bde.

Reason for revert: potential perf regression.

BUG=chromium:748100

Original change's description:
> [heap] Use AdjustAmountOfExternalMemory to account freed array buffers.
> 
> Currently GC decrements the external memory counter directly bypassing
> the AdjustAmountOfExternalMemory. This is inconsistent with array
> buffer allocation, which actually uses the API to increment the counter.
> 
> Change-Id: I401087872213fdd60f1a40c99c8f459c14dc0608
> Reviewed-on: https://chromium-review.googlesource.com/582008
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46835}

TBR=ulan@chromium.org,mlippautz@chromium.org

Change-Id: Ibde2acb9ae2e4274946124fc4606321b95c80758
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/583453Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46847}
parent 3d5f2e08
......@@ -44,8 +44,7 @@ void ArrayBufferTracker::Unregister(Heap* heap, JSArrayBuffer* buffer) {
DCHECK_NOT_NULL(tracker);
tracker->Remove(buffer, length);
}
reinterpret_cast<v8::Isolate*>(heap->isolate())
->AdjustAmountOfExternalAllocatedMemory(-static_cast<int64_t>(length));
heap->update_external_memory(-static_cast<intptr_t>(length));
}
void LocalArrayBufferTracker::Add(JSArrayBuffer* buffer, size_t length) {
......
......@@ -2256,14 +2256,6 @@ void Heap::UnregisterArrayBuffer(JSArrayBuffer* buffer) {
ArrayBufferTracker::Unregister(this, buffer);
}
void Heap::account_external_memory_concurrently_freed() {
DCHECK_NE(gc_state_, NOT_IN_GC);
uint64_t delta = external_memory_concurrently_freed_.Value();
external_memory_concurrently_freed_.SetValue(0);
reinterpret_cast<v8::Isolate*>(isolate())
->AdjustAmountOfExternalAllocatedMemory(delta);
}
void Heap::ConfigureInitialOldGenerationSize() {
if (!old_generation_size_configured_ && tracer()->SurvivalEventsRecorded()) {
old_generation_allocation_limit_ =
......
......@@ -855,7 +855,10 @@ class Heap {
external_memory_concurrently_freed_.Increment(freed);
}
void account_external_memory_concurrently_freed();
void account_external_memory_concurrently_freed() {
external_memory_ -= external_memory_concurrently_freed_.Value();
external_memory_concurrently_freed_.SetValue(0);
}
void DeoptMarkedAllocationSites();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment