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

Side by Side Diff: test/mjsunit/wasm/wasm-constants.js

Issue 2049513003: [wasm] Support undefined indirect table entries, behind a flag. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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
« src/messages.h ('K') | « test/mjsunit/wasm/default-func-call2.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 bytes() { 7 function bytes() {
8 var buffer = new ArrayBuffer(arguments.length); 8 var buffer = new ArrayBuffer(arguments.length);
9 var view = new Uint8Array(buffer); 9 var view = new Uint8Array(buffer);
10 for (var i = 0; i < arguments.length; i++) { 10 for (var i = 0; i < arguments.length; i++) {
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 var kExprI64Rol = 0xb9; 296 var kExprI64Rol = 0xb9;
297 297
298 var kTrapUnreachable = 0; 298 var kTrapUnreachable = 0;
299 var kTrapMemOutOfBounds = 1; 299 var kTrapMemOutOfBounds = 1;
300 var kTrapDivByZero = 2; 300 var kTrapDivByZero = 2;
301 var kTrapDivUnrepresentable = 3; 301 var kTrapDivUnrepresentable = 3;
302 var kTrapRemByZero = 4; 302 var kTrapRemByZero = 4;
303 var kTrapFloatUnrepresentable = 5; 303 var kTrapFloatUnrepresentable = 5;
304 var kTrapFuncInvalid = 6; 304 var kTrapFuncInvalid = 6;
305 var kTrapFuncSigMismatch = 7; 305 var kTrapFuncSigMismatch = 7;
306 var kTrapDefaultFuncCall = 8;
306 307
307 var kTrapMsgs = [ 308 var kTrapMsgs = [
308 "unreachable", 309 "unreachable",
309 "memory access out of bounds", 310 "memory access out of bounds",
310 "divide by zero", 311 "divide by zero",
311 "divide result unrepresentable", 312 "divide result unrepresentable",
312 "remainder by zero", 313 "remainder by zero",
313 "integer result unrepresentable", 314 "integer result unrepresentable",
314 "invalid function", 315 "invalid function",
315 "function signature mismatch" 316 "function signature mismatch",
317 "default function call"
316 ]; 318 ];
317 319
318 function assertTraps(trap, code) { 320 function assertTraps(trap, code) {
319 var threwException = true; 321 var threwException = true;
320 try { 322 try {
321 if (typeof code === 'function') { 323 if (typeof code === 'function') {
322 code(); 324 code();
323 } else { 325 } else {
324 eval(code); 326 eval(code);
325 } 327 }
326 threwException = false; 328 threwException = false;
327 } catch (e) { 329 } catch (e) {
328 assertEquals("object", typeof e); 330 assertEquals("object", typeof e);
329 assertEquals(kTrapMsgs[trap], e.message); 331 assertEquals(kTrapMsgs[trap], e.message);
330 // Success. 332 // Success.
331 return; 333 return;
332 } 334 }
333 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap] ); 335 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap] );
334 } 336 }
OLDNEW
« src/messages.h ('K') | « test/mjsunit/wasm/default-func-call2.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698