node/deps/v8/test/debugger/debug/wasm/breakpoint-memoryestimation-concurrency.js
Michaël Zasso 9d7cd9b864
deps: update V8 to 12.8.374.13
PR-URL: https://github.com/nodejs/node/pull/54077
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2024-08-16 16:03:01 +02:00

25 lines
894 B
JavaScript

// Copyright 2024 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.
// Test that there is no lock-order inversion between the `allocation_mutex_`
// (used by `NativeModule::EstimateCurrentMemoryConsumption`) and the `mutex_`
// (used by `DebugInfoImpl::SetBreakpoint`) when running concurrently in
// multiple isolates (see `run-tests.py --isolates`).
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
const builder = new WasmModuleBuilder();
const body_f = [kExprI32Const, 123];
const offset_in_body = body_f.indexOf(kExprI32Const);
builder.addFunction('f', kSig_i_v).addBody(body_f).exportFunc();
const instance = builder.instantiate();
Debug = debug.Debug;
const breakpoint = Debug.setBreakPoint(instance.exports.f, 0, offset_in_body);
%EstimateCurrentMemoryConsumption();