Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: test/mjsunit/wasm/function-names.js

Issue 2696813002: [wasm] Inspect right control frames for unreachable flag (Closed)
Patch Set: Avoid conversion warning Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/wasm/function-body-decoder.cc ('k') | test/mjsunit/wasm/globals.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 last_func_index = builder.addFunction("exec_unreachable", kSig_v_v) 12 var last_func_index = builder.addFunction("exec_unreachable", kSig_v_v)
13 .addBody([kExprUnreachable]) 13 .addBody([kExprUnreachable]).index
14 14
15 var illegal_func_name = [0xff]; 15 var illegal_func_name = [0xff];
16 var func_names = [ "☠", illegal_func_name, "some math: (½)² = ¼", "" ]; 16 var func_names = [ "☠", illegal_func_name, "some math: (½)² = ¼", "" ];
17 var expected_names = ["exec_unreachable", "☠", null, 17 var expected_names = ["exec_unreachable", "☠", null,
18 "some math: (½)² = ¼", "", "main"]; 18 "some math: (½)² = ¼", "", "main"];
19 19
20 for (var func_name of func_names) { 20 for (var func_name of func_names) {
21 last_func_index = builder.addFunction(func_name, kSig_v_v) 21 last_func_index = builder.addFunction(func_name, kSig_v_v)
22 .addBody([kExprCallFunction, last_func_index]).index; 22 .addBody([kExprCallFunction, last_func_index]).index;
23 } 23 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 try { 60 try {
61 module.exports.main(); 61 module.exports.main();
62 assertFalse("should throw"); 62 assertFalse("should throw");
63 } catch (e) { 63 } catch (e) {
64 assertEquals(names.length, e.stack.length); 64 assertEquals(names.length, e.stack.length);
65 for (var i = 0; i < names.length; ++i) { 65 for (var i = 0; i < names.length; ++i) {
66 assertEquals(names[i], e.stack[i].getFunctionName()); 66 assertEquals(names[i], e.stack[i].getFunctionName());
67 } 67 }
68 } 68 }
69 })(); 69 })();
OLDNEW
« no previous file with comments | « src/wasm/function-body-decoder.cc ('k') | test/mjsunit/wasm/globals.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698