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

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

Issue 2361053004: Revert of [wasm] Master CL for Binary 0xC changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « test/fuzzer/wasm-types-section.cc ('k') | test/mjsunit/wasm/asm-wasm-expr.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 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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 } 981 }
982 return 0; 982 return 0;
983 } 983 }
984 984
985 var funBin = [add, sub, sub, add]; 985 var funBin = [add, sub, sub, add];
986 var fun = [inc]; 986 var fun = [inc];
987 987
988 return {caller:caller}; 988 return {caller:caller};
989 } 989 }
990 990
991 print("TestFunctionTable...");
992 var module = TestFunctionTable(stdlib); 991 var module = TestFunctionTable(stdlib);
993 assertEquals(55, module.caller(0, 0, 33, 22)); 992 assertEquals(55, module.caller(0, 0, 33, 22));
994 assertEquals(11, module.caller(0, 1, 33, 22)); 993 assertEquals(11, module.caller(0, 1, 33, 22));
995 assertEquals(9, module.caller(0, 2, 54, 45)); 994 assertEquals(9, module.caller(0, 2, 54, 45));
996 assertEquals(99, module.caller(0, 3, 54, 45)); 995 assertEquals(99, module.caller(0, 3, 54, 45));
997 assertEquals(23, module.caller(0, 4, 12, 11)); 996 assertEquals(23, module.caller(0, 4, 12, 11));
998 assertEquals(31, module.caller(1, 0, 30, 11)); 997 assertEquals(31, module.caller(1, 0, 30, 11));
999 })(); 998 })();
1000 999
1001 1000
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 } 1033 }
1035 1034
1036 var foreign = new ffi(23); 1035 var foreign = new ffi(23);
1037 1036
1038 var module = AsmModule({Math: Math}, foreign, null); 1037 var module = AsmModule({Math: Math}, foreign, null);
1039 assertValidAsm(AsmModule); 1038 assertValidAsm(AsmModule);
1040 1039
1041 assertEquals(103, module.caller(23, 103)); 1040 assertEquals(103, module.caller(23, 103));
1042 } 1041 }
1043 1042
1044 print("TestForeignFunctions...");
1045 TestForeignFunctions(); 1043 TestForeignFunctions();
1046 1044
1047 1045
1048 function TestForeignFunctionMultipleUse() { 1046 function TestForeignFunctionMultipleUse() {
1049 function AsmModule(stdlib, foreign, buffer) { 1047 function AsmModule(stdlib, foreign, buffer) {
1050 "use asm"; 1048 "use asm";
1051 1049
1052 var getVal = foreign.getVal; 1050 var getVal = foreign.getVal;
1053 1051
1054 function caller(int_val, double_val) { 1052 function caller(int_val, double_val) {
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1589 "use asm"; 1587 "use asm";
1590 function add(a, b) { 1588 function add(a, b) {
1591 a = a | 0; 1589 a = a | 0;
1592 b = b | 0; 1590 b = b | 0;
1593 return (a + b) | 0; 1591 return (a + b) | 0;
1594 } 1592 }
1595 return add; 1593 return add;
1596 } 1594 }
1597 1595
1598 assertEquals(7, TestSingleFunctionModule()(3, 4)); 1596 assertEquals(7, TestSingleFunctionModule()(3, 4));
OLDNEW
« no previous file with comments | « test/fuzzer/wasm-types-section.cc ('k') | test/mjsunit/wasm/asm-wasm-expr.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698