OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --expose-wasm | 5 // Flags: --validate-asm --allow-natives-syntax |
6 // Flags: --allow-natives-syntax | |
7 | 6 |
8 (function TestDeoptimizeArgMismatch() { | 7 (function TestDeoptimizeArgMismatch() { |
9 function deopt() { | 8 function deopt() { |
10 %DeoptimizeFunction(test); | 9 %DeoptimizeFunction(test); |
11 } | 10 } |
12 function Module(global, env, buffer) { | 11 function Module(global, env, buffer) { |
13 "use asm"; | 12 "use asm"; |
14 var deopt = env.deopt; | 13 var deopt = env.deopt; |
15 function _main(i4, i5) { | 14 function _main(i4, i5) { |
16 i4 = i4 | 0; | 15 i4 = i4 | 0; |
17 i5 = i5 | 0; | 16 i5 = i5 | 0; |
18 deopt(); | 17 deopt(); |
19 return i5 | 0; | 18 return i5 | 0; |
20 } | 19 } |
21 return {'_main': _main} | 20 return {'_main': _main} |
22 } | 21 } |
23 function test() { | 22 function test() { |
24 var wasm = Wasm.instantiateModuleFromAsm( | 23 var wasm = Module(null, {'deopt': deopt}); |
25 Module.toString(), null, {'deopt': deopt}); | |
26 wasm._main(0, 0, 0); | 24 wasm._main(0, 0, 0); |
27 } | 25 } |
28 test(); | 26 test(); |
29 })(); | 27 })(); |
OLD | NEW |