| OLD | NEW |
| 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 #include <stdint.h> | 5 #include <stdint.h> |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/wasm/wasm-macro-gen.h" | 10 #include "src/wasm/wasm-macro-gen.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 CHECK_EQ(0xdeadbeef, (bit_cast<uint32_t>(x)) & 0xFFFFFFFF) | 25 CHECK_EQ(0xdeadbeef, (bit_cast<uint32_t>(x)) & 0xFFFFFFFF) |
| 26 #define CHECK_TRAP64(x) \ | 26 #define CHECK_TRAP64(x) \ |
| 27 CHECK_EQ(0xdeadbeefdeadbeef, (bit_cast<uint64_t>(x)) & 0xFFFFFFFFFFFFFFFF) | 27 CHECK_EQ(0xdeadbeefdeadbeef, (bit_cast<uint64_t>(x)) & 0xFFFFFFFFFFFFFFFF) |
| 28 #define CHECK_TRAP(x) CHECK_TRAP32(x) | 28 #define CHECK_TRAP(x) CHECK_TRAP32(x) |
| 29 | 29 |
| 30 #define asi64(x) static_cast<int64_t>(x) | 30 #define asi64(x) static_cast<int64_t>(x) |
| 31 | 31 |
| 32 #define asu64(x) static_cast<uint64_t>(x) | 32 #define asu64(x) static_cast<uint64_t>(x) |
| 33 | 33 |
| 34 #define B2(a, b) kExprBlock, a, b, kExprEnd | 34 #define B2(a, b) kExprBlock, a, b, kExprEnd |
| 35 #define B1(a) kExprBlock, a, kExprEnd |
| 35 | 36 |
| 36 // Can't bridge macro land with nested macros. | 37 // Can't bridge macro land with nested macros. |
| 37 #if V8_TARGET_ARCH_MIPS | 38 #if V8_TARGET_ARCH_MIPS |
| 38 #define MIPS true | 39 #define MIPS true |
| 39 #else | 40 #else |
| 40 #define MIPS false | 41 #define MIPS false |
| 41 #endif | 42 #endif |
| 42 | 43 |
| 43 #define FOREACH_I64_OPERATOR(V) \ | 44 #define FOREACH_I64_OPERATOR(V) \ |
| 44 V(DepthFirst, true) \ | 45 V(DepthFirst, true) \ |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 continue; | 828 continue; |
| 828 } else { | 829 } else { |
| 829 BUILD(t, WASM_GET_LOCAL(i)); | 830 BUILD(t, WASM_GET_LOCAL(i)); |
| 830 } | 831 } |
| 831 uint32_t index = t.CompileAndAdd(); | 832 uint32_t index = t.CompileAndAdd(); |
| 832 | 833 |
| 833 // Build the calling function. | 834 // Build the calling function. |
| 834 WasmRunner<int32_t> r(&module); | 835 WasmRunner<int32_t> r(&module); |
| 835 BUILD( | 836 BUILD( |
| 836 r, | 837 r, |
| 837 WASM_I32_CONVERT_I64(WASM_CALL_FUNCTION( | 838 WASM_I32_CONVERT_I64(WASM_CALL_FUNCTIONN( |
| 838 index, WASM_I64V_9(0xbcd12340000000b), | 839 19, index, WASM_I64V_9(0xbcd12340000000b), |
| 839 WASM_I64V_9(0xbcd12340000000c), WASM_I32V_1(0xd), | 840 WASM_I64V_9(0xbcd12340000000c), WASM_I32V_1(0xd), |
| 840 WASM_I32_CONVERT_I64(WASM_I64V_9(0xbcd12340000000e)), | 841 WASM_I32_CONVERT_I64(WASM_I64V_9(0xbcd12340000000e)), |
| 841 WASM_I64V_9(0xbcd12340000000f), WASM_I64V_10(0xbcd1234000000010), | 842 WASM_I64V_9(0xbcd12340000000f), WASM_I64V_10(0xbcd1234000000010), |
| 842 WASM_I64V_10(0xbcd1234000000011), WASM_I64V_10(0xbcd1234000000012), | 843 WASM_I64V_10(0xbcd1234000000011), WASM_I64V_10(0xbcd1234000000012), |
| 843 WASM_I64V_10(0xbcd1234000000013), WASM_I64V_10(0xbcd1234000000014), | 844 WASM_I64V_10(0xbcd1234000000013), WASM_I64V_10(0xbcd1234000000014), |
| 844 WASM_I64V_10(0xbcd1234000000015), WASM_I64V_10(0xbcd1234000000016), | 845 WASM_I64V_10(0xbcd1234000000015), WASM_I64V_10(0xbcd1234000000016), |
| 845 WASM_I64V_10(0xbcd1234000000017), WASM_I64V_10(0xbcd1234000000018), | 846 WASM_I64V_10(0xbcd1234000000017), WASM_I64V_10(0xbcd1234000000018), |
| 846 WASM_I64V_10(0xbcd1234000000019), WASM_I64V_10(0xbcd123400000001a), | 847 WASM_I64V_10(0xbcd1234000000019), WASM_I64V_10(0xbcd123400000001a), |
| 847 WASM_I64V_10(0xbcd123400000001b), WASM_I64V_10(0xbcd123400000001c), | 848 WASM_I64V_10(0xbcd123400000001b), WASM_I64V_10(0xbcd123400000001c), |
| 848 WASM_I64V_10(0xbcd123400000001d)))); | 849 WASM_I64V_10(0xbcd123400000001d)))); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 REQUIRE(I64Sub); | 1112 REQUIRE(I64Sub); |
| 1112 // Build the target function. | 1113 // Build the target function. |
| 1113 TestSignatures sigs; | 1114 TestSignatures sigs; |
| 1114 TestingModule module(execution_mode); | 1115 TestingModule module(execution_mode); |
| 1115 WasmFunctionCompiler t(sigs.l_ll(), &module); | 1116 WasmFunctionCompiler t(sigs.l_ll(), &module); |
| 1116 BUILD(t, WASM_I64_SUB(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); | 1117 BUILD(t, WASM_I64_SUB(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
| 1117 uint32_t index = t.CompileAndAdd(); | 1118 uint32_t index = t.CompileAndAdd(); |
| 1118 | 1119 |
| 1119 // Build the caller function. | 1120 // Build the caller function. |
| 1120 WasmRunner<int64_t> r(&module, MachineType::Int64(), MachineType::Int64()); | 1121 WasmRunner<int64_t> r(&module, MachineType::Int64(), MachineType::Int64()); |
| 1121 BUILD(r, WASM_CALL_FUNCTION(index, WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); | 1122 BUILD(r, WASM_CALL_FUNCTION2(index, WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
| 1122 | 1123 |
| 1123 FOR_INT32_INPUTS(i) { | 1124 FOR_INT32_INPUTS(i) { |
| 1124 FOR_INT32_INPUTS(j) { | 1125 FOR_INT32_INPUTS(j) { |
| 1125 int64_t a = static_cast<int64_t>(*i) << 32 | | 1126 int64_t a = static_cast<int64_t>(*i) << 32 | |
| 1126 (static_cast<int64_t>(*j) | 0xFFFFFFFF); | 1127 (static_cast<int64_t>(*j) | 0xFFFFFFFF); |
| 1127 int64_t b = static_cast<int64_t>(*j) << 32 | | 1128 int64_t b = static_cast<int64_t>(*j) << 32 | |
| 1128 (static_cast<int64_t>(*i) | 0xFFFFFFFF); | 1129 (static_cast<int64_t>(*i) | 0xFFFFFFFF); |
| 1129 | 1130 |
| 1130 int64_t expected = static_cast<int64_t>(static_cast<uint64_t>(a) - | 1131 int64_t expected = static_cast<int64_t>(static_cast<uint64_t>(a) - |
| 1131 static_cast<uint64_t>(b)); | 1132 static_cast<uint64_t>(b)); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1146 WasmRunner<int64_t> r(&module); | 1147 WasmRunner<int64_t> r(&module); |
| 1147 | 1148 |
| 1148 byte code[] = { | 1149 byte code[] = { |
| 1149 kExprI8Const, 8, // -- | 1150 kExprI8Const, 8, // -- |
| 1150 kExprI8Const, 0, // -- | 1151 kExprI8Const, 0, // -- |
| 1151 loads[m], // -- | 1152 loads[m], // -- |
| 1152 ZERO_ALIGNMENT, // -- | 1153 ZERO_ALIGNMENT, // -- |
| 1153 ZERO_OFFSET, // -- | 1154 ZERO_OFFSET, // -- |
| 1154 kExprI64StoreMem, // -- | 1155 kExprI64StoreMem, // -- |
| 1155 ZERO_ALIGNMENT, // -- | 1156 ZERO_ALIGNMENT, // -- |
| 1156 ZERO_OFFSET, // -- | 1157 ZERO_OFFSET // -- |
| 1157 kExprI8Const, 0, // -- | |
| 1158 loads[m], // -- | |
| 1159 ZERO_ALIGNMENT, // -- | |
| 1160 ZERO_OFFSET, // -- | |
| 1161 }; | 1158 }; |
| 1162 | 1159 |
| 1163 r.Build(code, code + arraysize(code)); | 1160 r.Build(code, code + arraysize(code)); |
| 1164 | 1161 |
| 1165 // Try a bunch of different negative values. | 1162 // Try a bunch of different negative values. |
| 1166 for (int i = -1; i >= -128; i -= 11) { | 1163 for (int i = -1; i >= -128; i -= 11) { |
| 1167 int size = 1 << m; | 1164 int size = 1 << m; |
| 1168 module.BlankMemory(); | 1165 module.BlankMemory(); |
| 1169 memory[size - 1] = static_cast<byte>(i); // set the high order byte. | 1166 memory[size - 1] = static_cast<byte>(i); // set the high order byte. |
| 1170 | 1167 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 CHECK_EQ(expected, r.Call()); | 1249 CHECK_EQ(expected, r.Call()); |
| 1253 } | 1250 } |
| 1254 } | 1251 } |
| 1255 | 1252 |
| 1256 WASM_EXEC_TEST(F64ReinterpretI64) { | 1253 WASM_EXEC_TEST(F64ReinterpretI64) { |
| 1257 REQUIRE(F64ReinterpretI64); | 1254 REQUIRE(F64ReinterpretI64); |
| 1258 TestingModule module(execution_mode); | 1255 TestingModule module(execution_mode); |
| 1259 int64_t* memory = module.AddMemoryElems<int64_t>(8); | 1256 int64_t* memory = module.AddMemoryElems<int64_t>(8); |
| 1260 WasmRunner<int64_t> r(&module, MachineType::Int64()); | 1257 WasmRunner<int64_t> r(&module, MachineType::Int64()); |
| 1261 | 1258 |
| 1262 BUILD(r, WASM_STORE_MEM(MachineType::Float64(), WASM_ZERO, | 1259 BUILD(r, |
| 1263 WASM_F64_REINTERPRET_I64(WASM_GET_LOCAL(0))), | 1260 WASM_BLOCK(WASM_STORE_MEM(MachineType::Float64(), WASM_ZERO, |
| 1264 WASM_GET_LOCAL(0)); | 1261 WASM_F64_REINTERPRET_I64(WASM_GET_LOCAL(0))), |
| 1262 WASM_GET_LOCAL(0))); |
| 1265 | 1263 |
| 1266 FOR_INT32_INPUTS(i) { | 1264 FOR_INT32_INPUTS(i) { |
| 1267 int64_t expected = static_cast<int64_t>(*i) * 0x300010001; | 1265 int64_t expected = static_cast<int64_t>(*i) * 0x300010001; |
| 1268 CHECK_EQ(expected, r.Call(expected)); | 1266 CHECK_EQ(expected, r.Call(expected)); |
| 1269 CHECK_EQ(expected, module.ReadMemory<int64_t>(&memory[0])); | 1267 CHECK_EQ(expected, module.ReadMemory<int64_t>(&memory[0])); |
| 1270 } | 1268 } |
| 1271 } | 1269 } |
| 1272 | 1270 |
| 1273 WASM_EXEC_TEST(LoadMemI64) { | 1271 WASM_EXEC_TEST(LoadMemI64) { |
| 1274 REQUIRE(I64LoadStore); | 1272 REQUIRE(I64LoadStore); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1315 REQUIRE(I64LoadStore); | 1313 REQUIRE(I64LoadStore); |
| 1316 REQUIRE(I64Add); | 1314 REQUIRE(I64Add); |
| 1317 REQUIRE(I64Sub); | 1315 REQUIRE(I64Sub); |
| 1318 REQUIRE(I64Phi); | 1316 REQUIRE(I64Phi); |
| 1319 const int kNumElems = 20; | 1317 const int kNumElems = 20; |
| 1320 TestingModule module(execution_mode); | 1318 TestingModule module(execution_mode); |
| 1321 uint64_t* memory = module.AddMemoryElems<uint64_t>(kNumElems); | 1319 uint64_t* memory = module.AddMemoryElems<uint64_t>(kNumElems); |
| 1322 WasmRunner<uint64_t> r(&module, MachineType::Int32()); | 1320 WasmRunner<uint64_t> r(&module, MachineType::Int32()); |
| 1323 const byte kSum = r.AllocateLocal(kAstI64); | 1321 const byte kSum = r.AllocateLocal(kAstI64); |
| 1324 | 1322 |
| 1325 BUILD( | 1323 BUILD(r, |
| 1326 r, | 1324 WASM_BLOCK( |
| 1327 WASM_WHILE( | 1325 WASM_WHILE( |
| 1328 WASM_GET_LOCAL(0), | 1326 WASM_GET_LOCAL(0), |
| 1329 WASM_BLOCK( | 1327 WASM_BLOCK( |
| 1330 WASM_SET_LOCAL(kSum, | 1328 WASM_SET_LOCAL( |
| 1331 WASM_I64_ADD(WASM_GET_LOCAL(kSum), | 1329 kSum, WASM_I64_ADD(WASM_GET_LOCAL(kSum), |
| 1332 WASM_LOAD_MEM(MachineType::Int64(), | 1330 WASM_LOAD_MEM(MachineType::Int64(), |
| 1333 WASM_GET_LOCAL(0)))), | 1331 WASM_GET_LOCAL(0)))), |
| 1334 WASM_SET_LOCAL(0, WASM_I32_SUB(WASM_GET_LOCAL(0), WASM_I8(8))))), | 1332 WASM_SET_LOCAL( |
| 1335 WASM_GET_LOCAL(1)); | 1333 0, WASM_I32_SUB(WASM_GET_LOCAL(0), WASM_I8(8))))), |
| 1334 WASM_GET_LOCAL(1))); |
| 1336 | 1335 |
| 1337 // Run 4 trials. | 1336 // Run 4 trials. |
| 1338 for (int i = 0; i < 3; i++) { | 1337 for (int i = 0; i < 3; i++) { |
| 1339 module.RandomizeMemory(i * 33); | 1338 module.RandomizeMemory(i * 33); |
| 1340 uint64_t expected = 0; | 1339 uint64_t expected = 0; |
| 1341 for (size_t j = kNumElems - 1; j > 0; j--) { | 1340 for (size_t j = kNumElems - 1; j > 0; j--) { |
| 1342 expected += module.ReadMemory(&memory[j]); | 1341 expected += module.ReadMemory(&memory[j]); |
| 1343 } | 1342 } |
| 1344 uint64_t result = r.Call(8 * (kNumElems - 1)); | 1343 uint64_t result = r.Call(8 * (kNumElems - 1)); |
| 1345 CHECK_EQ(expected, result); | 1344 CHECK_EQ(expected, result); |
| 1346 } | 1345 } |
| 1347 } | 1346 } |
| 1348 | 1347 |
| 1349 WASM_EXEC_TEST(StoreMemI64_alignment) { | 1348 WASM_EXEC_TEST(StoreMemI64_alignment) { |
| 1350 TestingModule module(execution_mode); | 1349 TestingModule module(execution_mode); |
| 1351 int64_t* memory = module.AddMemoryElems<int64_t>(4); | 1350 int64_t* memory = module.AddMemoryElems<int64_t>(4); |
| 1352 const int64_t kWritten = 0x12345678abcd0011ll; | 1351 const int64_t kWritten = 0x12345678abcd0011ll; |
| 1353 | 1352 |
| 1354 for (byte i = 0; i <= 3; i++) { | 1353 for (byte i = 0; i <= 3; i++) { |
| 1355 WasmRunner<int64_t> r(&module, MachineType::Int64()); | 1354 WasmRunner<int64_t> r(&module, MachineType::Int64()); |
| 1356 BUILD(r, WASM_STORE_MEM_ALIGNMENT(MachineType::Int64(), WASM_ZERO, i, | 1355 BUILD(r, WASM_STORE_MEM_ALIGNMENT(MachineType::Int64(), WASM_ZERO, i, |
| 1357 WASM_GET_LOCAL(0)), | 1356 WASM_GET_LOCAL(0))); |
| 1358 WASM_GET_LOCAL(0)); | |
| 1359 module.RandomizeMemory(1111); | 1357 module.RandomizeMemory(1111); |
| 1360 module.WriteMemory<int64_t>(&memory[0], 0); | 1358 module.WriteMemory<int64_t>(&memory[0], 0); |
| 1361 | 1359 |
| 1362 CHECK_EQ(kWritten, r.Call(kWritten)); | 1360 CHECK_EQ(kWritten, r.Call(kWritten)); |
| 1363 CHECK_EQ(kWritten, module.ReadMemory(&memory[0])); | 1361 CHECK_EQ(kWritten, module.ReadMemory(&memory[0])); |
| 1364 } | 1362 } |
| 1365 } | 1363 } |
| 1366 | 1364 |
| 1367 WASM_EXEC_TEST(I64Global) { | 1365 WASM_EXEC_TEST(I64Global) { |
| 1368 REQUIRE(I64LoadStore); | 1366 REQUIRE(I64LoadStore); |
| 1369 REQUIRE(I64SConvertI32); | 1367 REQUIRE(I64SConvertI32); |
| 1370 REQUIRE(I64And); | 1368 REQUIRE(I64And); |
| 1371 REQUIRE(DepthFirst); | 1369 REQUIRE(DepthFirst); |
| 1372 TestingModule module(execution_mode); | 1370 TestingModule module(execution_mode); |
| 1373 int64_t* global = module.AddGlobal<int64_t>(kAstI64); | 1371 int64_t* global = module.AddGlobal<int64_t>(kAstI64); |
| 1374 WasmRunner<int32_t> r(&module, MachineType::Int32()); | 1372 WasmRunner<int32_t> r(&module, MachineType::Int32()); |
| 1375 // global = global + p0 | 1373 // global = global + p0 |
| 1376 BUILD(r, WASM_SET_GLOBAL( | 1374 BUILD(r, B2(WASM_SET_GLOBAL( |
| 1377 0, WASM_I64_AND(WASM_GET_GLOBAL(0), | 1375 0, WASM_I64_AND(WASM_GET_GLOBAL(0), |
| 1378 WASM_I64_SCONVERT_I32(WASM_GET_LOCAL(0)))), | 1376 WASM_I64_SCONVERT_I32(WASM_GET_LOCAL(0)))), |
| 1379 WASM_ZERO); | 1377 WASM_ZERO)); |
| 1380 | 1378 |
| 1381 module.WriteMemory<int64_t>(global, 0xFFFFFFFFFFFFFFFFLL); | 1379 module.WriteMemory<int64_t>(global, 0xFFFFFFFFFFFFFFFFLL); |
| 1382 for (int i = 9; i < 444444; i += 111111) { | 1380 for (int i = 9; i < 444444; i += 111111) { |
| 1383 int64_t expected = *global & i; | 1381 int64_t expected = *global & i; |
| 1384 r.Call(i); | 1382 r.Call(i); |
| 1385 CHECK_EQ(expected, *global); | 1383 CHECK_EQ(expected, *global); |
| 1386 } | 1384 } |
| 1387 } | 1385 } |
| 1388 | 1386 |
| 1389 WASM_EXEC_TEST(I64Eqz) { | 1387 WASM_EXEC_TEST(I64Eqz) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 TestingModule module(kExecuteCompiled); | 1470 TestingModule module(kExecuteCompiled); |
| 1473 FunctionSig* sig = sigs.many(&zone, kAstStmt, param, num_params); | 1471 FunctionSig* sig = sigs.many(&zone, kAstStmt, param, num_params); |
| 1474 | 1472 |
| 1475 module.AddSignature(sig); | 1473 module.AddSignature(sig); |
| 1476 module.AddSignature(sig); | 1474 module.AddSignature(sig); |
| 1477 module.AddIndirectFunctionTable(nullptr, 0); | 1475 module.AddIndirectFunctionTable(nullptr, 0); |
| 1478 | 1476 |
| 1479 WasmFunctionCompiler t(sig, &module); | 1477 WasmFunctionCompiler t(sig, &module); |
| 1480 | 1478 |
| 1481 std::vector<byte> code; | 1479 std::vector<byte> code; |
| 1480 ADD_CODE(code, kExprI8Const, 0); |
| 1482 for (byte p = 0; p < num_params; p++) { | 1481 for (byte p = 0; p < num_params; p++) { |
| 1483 ADD_CODE(code, kExprGetLocal, p); | 1482 ADD_CODE(code, kExprGetLocal, p); |
| 1484 } | 1483 } |
| 1485 ADD_CODE(code, kExprI8Const, 0); | 1484 ADD_CODE(code, kExprCallIndirect, static_cast<byte>(num_params), 1); |
| 1486 ADD_CODE(code, kExprCallIndirect, 1); | |
| 1487 | 1485 |
| 1488 t.Build(&code[0], &code[0] + code.size()); | 1486 t.Build(&code[0], &code[0] + code.size()); |
| 1489 t.Compile(); | 1487 t.Compile(); |
| 1490 } | 1488 } |
| 1491 } | 1489 } |
| 1492 | 1490 |
| 1493 TEST(Compile_Wasm_CallIndirect_Many_i64) { CompileCallIndirectMany(kAstI64); } | 1491 TEST(Compile_Wasm_CallIndirect_Many_i64) { CompileCallIndirectMany(kAstI64); } |
| 1494 | 1492 |
| 1495 static void Run_WasmMixedCall_N(WasmExecutionMode execution_mode, int start) { | 1493 static void Run_WasmMixedCall_N(WasmExecutionMode execution_mode, int start) { |
| 1496 const int kExpected = 6333; | 1494 const int kExpected = 6333; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1535 // Load the offset for the store. | 1533 // Load the offset for the store. |
| 1536 ADD_CODE(code, WASM_ZERO); | 1534 ADD_CODE(code, WASM_ZERO); |
| 1537 | 1535 |
| 1538 // Load the arguments. | 1536 // Load the arguments. |
| 1539 for (int i = 0; i < num_params; i++) { | 1537 for (int i = 0; i < num_params; i++) { |
| 1540 int offset = (i + 1) * kElemSize; | 1538 int offset = (i + 1) * kElemSize; |
| 1541 ADD_CODE(code, WASM_LOAD_MEM(memtypes[i], WASM_I8(offset))); | 1539 ADD_CODE(code, WASM_LOAD_MEM(memtypes[i], WASM_I8(offset))); |
| 1542 } | 1540 } |
| 1543 | 1541 |
| 1544 // Call the selector function. | 1542 // Call the selector function. |
| 1545 ADD_CODE(code, kExprCallFunction, static_cast<byte>(index)); | 1543 ADD_CODE(code, kExprCallFunction, static_cast<byte>(num_params), |
| 1544 static_cast<byte>(index)); |
| 1546 | 1545 |
| 1547 // Store the result in memory. | 1546 // Store the result in memory. |
| 1548 ADD_CODE(code, | 1547 ADD_CODE(code, |
| 1549 static_cast<byte>(WasmOpcodes::LoadStoreOpcodeOf(result, true)), | 1548 static_cast<byte>(WasmOpcodes::LoadStoreOpcodeOf(result, true)), |
| 1550 ZERO_ALIGNMENT, ZERO_OFFSET); | 1549 ZERO_ALIGNMENT, ZERO_OFFSET); |
| 1551 | 1550 |
| 1552 // Return the expected value. | 1551 // Return the expected value. |
| 1553 ADD_CODE(code, WASM_I32V_2(kExpected)); | 1552 ADD_CODE(code, WASM_I32V_2(kExpected)); |
| 1554 | 1553 |
| 1555 r.Build(&code[0], &code[0] + code.size()); | 1554 r.Build(&code[0], &code[0] + code.size()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1567 CHECK_EQ(expected, result); | 1566 CHECK_EQ(expected, result); |
| 1568 } | 1567 } |
| 1569 } | 1568 } |
| 1570 } | 1569 } |
| 1571 } | 1570 } |
| 1572 | 1571 |
| 1573 WASM_EXEC_TEST(MixedCall_i64_0) { Run_WasmMixedCall_N(execution_mode, 0); } | 1572 WASM_EXEC_TEST(MixedCall_i64_0) { Run_WasmMixedCall_N(execution_mode, 0); } |
| 1574 WASM_EXEC_TEST(MixedCall_i64_1) { Run_WasmMixedCall_N(execution_mode, 1); } | 1573 WASM_EXEC_TEST(MixedCall_i64_1) { Run_WasmMixedCall_N(execution_mode, 1); } |
| 1575 WASM_EXEC_TEST(MixedCall_i64_2) { Run_WasmMixedCall_N(execution_mode, 2); } | 1574 WASM_EXEC_TEST(MixedCall_i64_2) { Run_WasmMixedCall_N(execution_mode, 2); } |
| 1576 WASM_EXEC_TEST(MixedCall_i64_3) { Run_WasmMixedCall_N(execution_mode, 3); } | 1575 WASM_EXEC_TEST(MixedCall_i64_3) { Run_WasmMixedCall_N(execution_mode, 3); } |
| OLD | NEW |