v8/test/mjsunit/wasm/asm-wasm-deopt.js
bradnelson 2e87c7f5ae Add a test of depot across an asm.js -> wasm module.
This previously tickled the failure fixed in this issue:
https://crrev.com/6a806a558158cbab55ad9a1a456942a7c509c810

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=asm-wasm-deopt
R=aseemgarg@chromium.org,titzer@chromium.org
LOG=N

Review URL: https://codereview.chromium.org/1766153002

Cr-Commit-Position: refs/heads/master@{#35064}
2016-03-24 17:28:26 +00:00

30 lines
702 B
JavaScript

// Copyright 2016 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: --expose-wasm
// Flags: --allow-natives-syntax
(function TestDeoptimizeArgMismatch() {
function deopt() {
%DeoptimizeFunction(test);
}
function Module(global, env, buffer) {
"use asm";
var deopt = env.deopt;
function _main(i4, i5) {
i4 = i4 | 0;
i5 = i5 | 0;
deopt();
return i5 | 0;
}
return {'_main': _main}
}
function test() {
var wasm = Wasm.instantiateModuleFromAsm(
Module.toString(), {'deopt': deopt});
wasm._main(0, 0, 0);
}
test();
})();