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

Side by Side Diff: test/mjsunit/wasm/asm-wasm-i32.js

Issue 2107683002: [wasm] Forbid sign mismatch in asm typer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/regress/regress-wasm-crbug-618602.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 // Flags: --expose-wasm 5 // Flags: --expose-wasm
6 6
7 function WrapInAsmModule(func) { 7 function WrapInAsmModule(func) {
8 function MODULE_NAME(stdlib) { 8 function MODULE_NAME(stdlib) {
9 "use asm"; 9 "use asm";
10 var imul = stdlib.Math.imul; 10 var imul = stdlib.Math.imul;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 function i32_mul(a, b) { 61 function i32_mul(a, b) {
62 a = a | 0; 62 a = a | 0;
63 b = b | 0; 63 b = b | 0;
64 return imul(a, b) | 0; 64 return imul(a, b) | 0;
65 } 65 }
66 66
67 function i32_div(a, b) { 67 function i32_div(a, b) {
68 a = a | 0; 68 a = a | 0;
69 b = b | 0; 69 b = b | 0;
70 return (a / b) | 0; 70 return ((a | 0) / (b | 0)) | 0;
71 } 71 }
72 72
73 function i32_mod(a, b) { 73 function i32_mod(a, b) {
74 a = a | 0; 74 a = a | 0;
75 b = b | 0; 75 b = b | 0;
76 return (a % b) | 0; 76 return ((a | 0) % (b | 0)) | 0;
77 } 77 }
78 78
79 function i32_and(a, b) { 79 function i32_and(a, b) {
80 a = a | 0; 80 a = a | 0;
81 b = b | 0; 81 b = b | 0;
82 return (a & b) | 0; 82 return (a & b) | 0;
83 } 83 }
84 84
85 function i32_or(a, b) { 85 function i32_or(a, b) {
86 a = a | 0; 86 a = a | 0;
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 for (a of inputs) { 243 for (a of inputs) {
244 for (b of inputs) { 244 for (b of inputs) {
245 assertEquals(func(a, b), module.main(a, b)); 245 assertEquals(func(a, b), module.main(a, b));
246 } 246 }
247 } 247 }
248 } 248 }
249 }); 249 });
250 } 250 }
251 251
252 })(); 252 })();
OLDNEW
« no previous file with comments | « test/mjsunit/regress/regress-wasm-crbug-618602.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698