2024-08-14 20:41:00 +02:00
|
|
|
// Copyright 2024 the V8 project authors. All rights reserved.
|
2023-03-30 12:11:08 +02:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2025-04-29 08:03:15 +02:00
|
|
|
// Flags: --allow-natives-syntax --wasm-lazy-compilation
|
2023-03-30 12:11:08 +02:00
|
|
|
|
|
|
|
d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
|
|
|
|
|
|
|
|
const builder = new WasmModuleBuilder();
|
|
|
|
builder.addFunction('f1', kSig_i_i).addBody([kExprLocalGet, 0]).exportFunc();
|
|
|
|
builder.addFunction('f2', kSig_i_i).addBody([kExprLocalGet, 0]).exportFunc();
|
|
|
|
builder.addFunction('f3', kSig_i_i).addBody([kExprLocalGet, 0]).exportFunc();
|
|
|
|
|
2024-08-14 20:41:00 +02:00
|
|
|
const exports = builder.instantiate().exports;
|
2023-03-30 12:11:08 +02:00
|
|
|
|
2024-08-14 20:41:00 +02:00
|
|
|
exports.f1(1);
|
|
|
|
exports.f2(2);
|
|
|
|
exports.f3(3);
|
2023-03-30 12:11:08 +02:00
|
|
|
|
2024-08-14 20:41:00 +02:00
|
|
|
%FlushLiftoffCode();
|
2023-03-30 12:11:08 +02:00
|
|
|
|
2024-08-14 20:41:00 +02:00
|
|
|
exports.f1(1);
|
|
|
|
exports.f2(2);
|
|
|
|
exports.f3(3);
|
2023-03-30 12:11:08 +02:00
|
|
|
|
2024-08-14 20:41:00 +02:00
|
|
|
%WasmTierUpFunction(exports.f3);
|
2023-03-30 12:11:08 +02:00
|
|
|
|
2024-08-14 20:41:00 +02:00
|
|
|
%FlushLiftoffCode();
|
2023-03-30 12:11:08 +02:00
|
|
|
|
2024-08-14 20:41:00 +02:00
|
|
|
exports.f1(1);
|
|
|
|
exports.f2(2);
|
|
|
|
exports.f3(3);
|