| 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: --expose-wasm |
| 6 | 6 |
| 7 load("test/mjsunit/wasm/wasm-constants.js"); | 7 load("test/mjsunit/wasm/wasm-constants.js"); |
| 8 load("test/mjsunit/wasm/wasm-module-builder.js"); | 8 load("test/mjsunit/wasm/wasm-module-builder.js"); |
| 9 | 9 |
| 10 Debug = debug.Debug | 10 Debug = debug.Debug |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } catch (e) { | 41 } catch (e) { |
| 42 exception = e; | 42 exception = e; |
| 43 } | 43 } |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 var builder = new WasmModuleBuilder(); | 46 var builder = new WasmModuleBuilder(); |
| 47 | 47 |
| 48 // wasm_1 calls wasm_2 on offset 2. | 48 // wasm_1 calls wasm_2 on offset 2. |
| 49 // wasm_2 calls call_debugger on offset 1. | 49 // wasm_2 calls call_debugger on offset 1. |
| 50 | 50 |
| 51 builder.addImport('func', kSig_v_v); | 51 builder.addImport("mod", 'func', kSig_v_v); |
| 52 | 52 |
| 53 builder.addFunction('wasm_1', kSig_v_v) | 53 builder.addFunction('wasm_1', kSig_v_v) |
| 54 .addBody([kExprNop, kExprCallFunction, 2]) | 54 .addBody([kExprNop, kExprCallFunction, 2]) |
| 55 .exportAs('main'); | 55 .exportAs('main'); |
| 56 | 56 |
| 57 builder.addFunction('wasm_2', kSig_v_v).addBody([kExprCallFunction, 0]); | 57 builder.addFunction('wasm_2', kSig_v_v).addBody([kExprCallFunction, 0]); |
| 58 | 58 |
| 59 function call_debugger() { | 59 function call_debugger() { |
| 60 debugger; | 60 debugger; |
| 61 } | 61 } |
| 62 | 62 |
| 63 var module = builder.instantiate({func: call_debugger}); | 63 var module = builder.instantiate({mod: {func: call_debugger}}); |
| 64 | 64 |
| 65 (function testFrameInspection() { | 65 (function testFrameInspection() { |
| 66 Debug.setListener(listener); | 66 Debug.setListener(listener); |
| 67 module.exports.main(); | 67 module.exports.main(); |
| 68 Debug.setListener(null); | 68 Debug.setListener(null); |
| 69 | 69 |
| 70 assertEquals(1, break_count); | 70 assertEquals(1, break_count); |
| 71 if (exception) throw exception; | 71 if (exception) throw exception; |
| 72 })(); | 72 })(); |
| OLD | NEW |