Commit 48625b37 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm] Fix committed code space tracking with --perf-prof

If --perf-prof is specified, we commit the whole code range at once, and
never update the {total_committed_code_space_} counter (see
{WasmCodeManager::Commit} and {WasmCodeManager::Decommit}). Hence we
should also not decrement that counter when the native module dies.

R=jkummerow@chromium.org

Bug: chromium:1032753
Change-Id: I9a40f1a1322485d7142ed56f5c9365305aa0e056
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1969790Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65476}
parent be5dd772
...@@ -1845,9 +1845,13 @@ void WasmCodeManager::FreeNativeModule(Vector<VirtualMemory> owned_code_space, ...@@ -1845,9 +1845,13 @@ void WasmCodeManager::FreeNativeModule(Vector<VirtualMemory> owned_code_space,
} }
DCHECK(IsAligned(committed_size, CommitPageSize())); DCHECK(IsAligned(committed_size, CommitPageSize()));
size_t old_committed = total_committed_code_space_.fetch_sub(committed_size); // TODO(v8:8462): Remove this once perf supports remapping.
if (!FLAG_perf_prof) {
size_t old_committed =
total_committed_code_space_.fetch_sub(committed_size);
DCHECK_LE(committed_size, old_committed); DCHECK_LE(committed_size, old_committed);
USE(old_committed); USE(old_committed);
}
} }
NativeModule* WasmCodeManager::LookupNativeModule(Address pc) const { NativeModule* WasmCodeManager::LookupNativeModule(Address pc) const {
......
...@@ -1093,6 +1093,7 @@ ...@@ -1093,6 +1093,7 @@
['arch not in [x64, arm, arm64] or system != linux', { ['arch not in [x64, arm, arm64] or system != linux', {
# Unwinding info writer is only supported on x64, arm, and arm64 Linux # Unwinding info writer is only supported on x64, arm, and arm64 Linux
'regress/regress-913844': [SKIP], 'regress/regress-913844': [SKIP],
'regress/wasm/regress-1032753': [SKIP],
}], }],
############################################################################## ##############################################################################
......
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --perf-prof
load('test/mjsunit/wasm/wasm-module-builder.js');
new WasmModuleBuilder().instantiate();
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