From 2e87c7f5ae99c726960635b36b564ce37304579c Mon Sep 17 00:00:00 2001 From: bradnelson Date: Thu, 24 Mar 2016 10:27:40 -0700 Subject: [PATCH] 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} --- test/mjsunit/mjsunit.status | 1 + test/mjsunit/wasm/asm-wasm-deopt.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/mjsunit/wasm/asm-wasm-deopt.js diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status index 8313bfb4fa..8d0d1a5dc7 100644 --- a/test/mjsunit/mjsunit.status +++ b/test/mjsunit/mjsunit.status @@ -273,6 +273,7 @@ 'wasm/asm-wasm-stdlib': [PASS, ['arch in [arm, arm64, mips, mipsel, mips64, mips64el] or ignition == True', SKIP]], 'wasm/asm-wasm-literals': [PASS, ['arch in [arm, arm64, mips, mipsel, mips64, mips64el] or ignition == True', SKIP]], 'wasm/asm-wasm-copy': [PASS, ['arch in [arm, arm64, mips, mipsel, mips64, mips64el]', SKIP]], + 'wasm/asm-wasm-deopt': [PASS, ['arch in [arm, arm64, mips, mipsel, mips64, mips64el]', SKIP]], # TODO(branelson): Figure out why ignition + asm->wasm fails embenchen. 'wasm/embenchen/*': [PASS, ['ignition == True', SKIP]], diff --git a/test/mjsunit/wasm/asm-wasm-deopt.js b/test/mjsunit/wasm/asm-wasm-deopt.js new file mode 100644 index 0000000000..4b16b71239 --- /dev/null +++ b/test/mjsunit/wasm/asm-wasm-deopt.js @@ -0,0 +1,29 @@ +// 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(); +})();