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 var builder = new WasmModuleBuilder(); | 10 var builder = new WasmModuleBuilder(); |
11 | 11 |
12 var imported_idx = builder.addImport("func", kSig_v_v); | 12 var imported_idx = builder.addImport("func", kSig_v_v); |
13 | 13 |
14 var call_imported_idx = builder.addFunction("main", kSig_v_v) | 14 var call_imported_idx = builder.addFunction("call_func", kSig_v_v) |
15 .addBody([kExprCallFunction, imported_idx]) | 15 .addBody([kExprCallFunction, imported_idx]) |
16 .index; | 16 .index; |
17 | 17 |
18 builder.addFunction("main", kSig_v_v) | 18 builder.addFunction("main", kSig_v_v) |
19 .addBody([kExprCallFunction, call_imported_idx]) | 19 .addBody([kExprCallFunction, call_imported_idx]) |
20 .exportAs("main"); | 20 .exportAs("main"); |
21 | 21 |
22 var module_bytes = builder.toArray(); | 22 var module_bytes = builder.toArray(); |
23 | 23 |
24 function testFunction(bytes) { | 24 function testFunction(bytes) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 { | 85 { |
86 InspectorTest.log( | 86 InspectorTest.log( |
87 'Result of evaluate (' + response.result.result.type + '):'); | 87 'Result of evaluate (' + response.result.result.type + '):'); |
88 var result_lines = response.result.result.value.split('\n'); | 88 var result_lines = response.result.result.value.split('\n'); |
89 // Skip the second line, containing the 'evaluate' position. | 89 // Skip the second line, containing the 'evaluate' position. |
90 result_lines[1] = ' -- skipped --'; | 90 result_lines[1] = ' -- skipped --'; |
91 InspectorTest.log(result_lines.join('\n')); | 91 InspectorTest.log(result_lines.join('\n')); |
92 InspectorTest.log('Finished!'); | 92 InspectorTest.log('Finished!'); |
93 InspectorTest.completeTest(); | 93 InspectorTest.completeTest(); |
94 } | 94 } |
OLD | NEW |