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

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

Issue 2348383003: [wasm] Support asm.js modules with a single function. (Closed)
Patch Set: fix Created 4 years, 3 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/asmjs/asm-wasm-builder.cc ('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: --validate-asm --allow-natives-syntax 5 // Flags: --validate-asm --allow-natives-syntax
6 6
7 var stdlib = this; 7 var stdlib = this;
8 8
9 function assertValidAsm(func) { 9 function assertValidAsm(func) {
10 assertTrue(%IsAsmWasmCode(func)); 10 assertTrue(%IsAsmWasmCode(func));
(...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 } while (0xffffffff); 1574 } while (0xffffffff);
1575 if ((val>>>0) == 2147483668) { 1575 if ((val>>>0) == 2147483668) {
1576 return 323; 1576 return 323;
1577 } 1577 }
1578 return 0; 1578 return 0;
1579 } 1579 }
1580 return {caller:main}; 1580 return {caller:main};
1581 } 1581 }
1582 1582
1583 assertWasm(323, TestLoopsWithUnsigned); 1583 assertWasm(323, TestLoopsWithUnsigned);
1584
1585
1586 function TestSingleFunctionModule() {
1587 "use asm";
1588 function add(a, b) {
1589 a = a | 0;
1590 b = b | 0;
1591 return (a + b) | 0;
1592 }
1593 return add;
1594 }
1595
1596 assertEquals(7, TestSingleFunctionModule()(3, 4));
OLDNEW
« no previous file with comments | « src/asmjs/asm-wasm-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698