41f231a25a
For memory tracing, output a 'T' for Turbofan code and an 'L' for Liftoff code. To do this, the WasmCodeWrapper now has some dispatch functions which work for both on-the-heap and off-the-heap code. We can probably refactor more code by having this mechanism. Since the output of --wasm-trace-memory differs now between Turbofan and Liftoff, the message test is split in two. R=titzer@chromium.org CC=mstarzinger@chromium.org Bug: v8:6600 Change-Id: Ic5fd18c631f5c8aaad19d639df75b18098895b5a Reviewed-on: https://chromium-review.googlesource.com/868214 Reviewed-by: Ben Titzer <titzer@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#50655}
38 lines
1.3 KiB
JavaScript
38 lines
1.3 KiB
JavaScript
// Copyright 2017 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: --no-stress-opt --expose-wasm --wasm-trace-memory --no-liftoff
|
|
|
|
load("test/mjsunit/wasm/wasm-constants.js");
|
|
load("test/mjsunit/wasm/wasm-module-builder.js");
|
|
|
|
var builder = new WasmModuleBuilder();
|
|
builder.addMemory(1);
|
|
builder.addFunction('load', kSig_v_i)
|
|
.addBody([kExprGetLocal, 0, kExprI32LoadMem, 0, 0, kExprDrop])
|
|
.exportFunc();
|
|
builder.addFunction('load8', kSig_v_i)
|
|
.addBody([kExprGetLocal, 0, kExprI32LoadMem8U, 0, 0, kExprDrop])
|
|
.exportFunc();
|
|
builder.addFunction('loadf', kSig_v_i)
|
|
.addBody([kExprGetLocal, 0, kExprF32LoadMem, 0, 0, kExprDrop])
|
|
.exportFunc();
|
|
builder.addFunction('store', kSig_v_ii)
|
|
.addBody([kExprGetLocal, 0, kExprGetLocal, 1, kExprI32StoreMem, 0, 0])
|
|
.exportFunc();
|
|
builder.addFunction('store8', kSig_v_ii)
|
|
.addBody([kExprGetLocal, 0, kExprGetLocal, 1, kExprI32StoreMem8, 0, 0])
|
|
.exportFunc();
|
|
var module = builder.instantiate();
|
|
|
|
module.exports.load(4);
|
|
module.exports.load8(1);
|
|
module.exports.store(4, 0x12345678);
|
|
module.exports.load(2);
|
|
module.exports.load8(6);
|
|
module.exports.loadf(2);
|
|
module.exports.store8(4, 0xab);
|
|
module.exports.load(2);
|
|
module.exports.loadf(2);
|