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

Side by Side Diff: test/mjsunit/wasm/wasm-module-builder.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 | « test/mjsunit/wasm/unreachable-validation.js ('k') | no next file » | 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 // Used for encoding f32 and double constants to bits. 5 // Used for encoding f32 and double constants to bits.
6 let __buffer = new ArrayBuffer(8); 6 let __buffer = new ArrayBuffer(8);
7 let byte_view = new Int8Array(__buffer); 7 let byte_view = new Int8Array(__buffer);
8 let f32_view = new Float32Array(__buffer); 8 let f32_view = new Float32Array(__buffer);
9 let f64_view = new Float64Array(__buffer); 9 let f64_view = new Float64Array(__buffer);
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 this.module.addExport(name, this.index); 90 this.module.addExport(name, this.index);
91 return this; 91 return this;
92 } 92 }
93 93
94 exportFunc() { 94 exportFunc() {
95 this.exportAs(this.name); 95 this.exportAs(this.name);
96 return this; 96 return this;
97 } 97 }
98 98
99 addBody(body) { 99 addBody(body) {
100 for (let b of body) {
101 if (typeof b != 'number') throw new Error("invalid body");
102 }
100 this.body = body; 103 this.body = body;
101 // Automatically add the end for the function block to the body. 104 // Automatically add the end for the function block to the body.
102 body.push(kExprEnd); 105 body.push(kExprEnd);
103 return this; 106 return this;
104 } 107 }
105 108
106 addBodyWithEnd(body) { 109 addBodyWithEnd(body) {
107 this.body = body; 110 this.body = body;
108 return this; 111 return this;
109 } 112 }
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 } 572 }
570 return buffer; 573 return buffer;
571 } 574 }
572 575
573 instantiate(ffi) { 576 instantiate(ffi) {
574 let module = new WebAssembly.Module(this.toBuffer()); 577 let module = new WebAssembly.Module(this.toBuffer());
575 let instance = new WebAssembly.Instance(module, ffi); 578 let instance = new WebAssembly.Instance(module, ffi);
576 return instance; 579 return instance;
577 } 580 }
578 } 581 }
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/unreachable-validation.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698