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/trap-handler/trap-handler.h" |
10 #include "src/wasm/wasm-macro-gen.h" | 11 #include "src/wasm/wasm-macro-gen.h" |
11 | 12 |
12 #include "test/cctest/cctest.h" | 13 #include "test/cctest/cctest.h" |
13 #include "test/cctest/compiler/value-helper.h" | 14 #include "test/cctest/compiler/value-helper.h" |
14 #include "test/cctest/wasm/wasm-run-utils.h" | 15 #include "test/cctest/wasm/wasm-run-utils.h" |
15 #include "test/common/wasm/test-signatures.h" | 16 #include "test/common/wasm/test-signatures.h" |
16 | 17 |
17 // If the target architecture is 64-bit, enable all tests. | 18 // If the target architecture is 64-bit, enable all tests. |
18 #if !V8_TARGET_ARCH_32_BIT || V8_TARGET_ARCH_X64 | 19 #if !V8_TARGET_ARCH_32_BIT || V8_TARGET_ARCH_X64 |
19 #define WASM_64 1 | 20 #define WASM_64 1 |
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 | 1454 |
1454 FOR_UINT64_INPUTS(i) { | 1455 FOR_UINT64_INPUTS(i) { |
1455 FOR_UINT64_INPUTS(j) { | 1456 FOR_UINT64_INPUTS(j) { |
1456 int64_t expected = bits::RotateLeft64(*i, *j & 0x3f); | 1457 int64_t expected = bits::RotateLeft64(*i, *j & 0x3f); |
1457 CHECK_EQ(expected, r.Call(*i, *j)); | 1458 CHECK_EQ(expected, r.Call(*i, *j)); |
1458 } | 1459 } |
1459 } | 1460 } |
1460 } | 1461 } |
1461 | 1462 |
1462 WASM_EXEC_TEST_WITH_TRAP(StoreMem_offset_oob_i64) { | 1463 WASM_EXEC_TEST_WITH_TRAP(StoreMem_offset_oob_i64) { |
| 1464 if (trap_handler::EnableTrapHandler()) { |
| 1465 // With trap handlers enabled, we need additional guard pages and such set |
| 1466 // up. This path does not enable these, so we skip this test. The behavior |
| 1467 // covered by this tests is also covered by mjsunit tests, such as |
| 1468 // test/mjsunit/wasm/import-memory.js |
| 1469 return; |
| 1470 } |
1463 static const MachineType machineTypes[] = { | 1471 static const MachineType machineTypes[] = { |
1464 MachineType::Int8(), MachineType::Uint8(), MachineType::Int16(), | 1472 MachineType::Int8(), MachineType::Uint8(), MachineType::Int16(), |
1465 MachineType::Uint16(), MachineType::Int32(), MachineType::Uint32(), | 1473 MachineType::Uint16(), MachineType::Int32(), MachineType::Uint32(), |
1466 MachineType::Int64(), MachineType::Uint64(), MachineType::Float32(), | 1474 MachineType::Int64(), MachineType::Uint64(), MachineType::Float32(), |
1467 MachineType::Float64()}; | 1475 MachineType::Float64()}; |
1468 | 1476 |
1469 for (size_t m = 0; m < arraysize(machineTypes); m++) { | 1477 for (size_t m = 0; m < arraysize(machineTypes); m++) { |
1470 WasmRunner<int32_t, uint32_t> r(execution_mode); | 1478 WasmRunner<int32_t, uint32_t> r(execution_mode); |
1471 byte* memory = r.module().AddMemoryElems<byte>(32); | 1479 byte* memory = r.module().AddMemoryElems<byte>(32); |
1472 r.module().RandomizeMemory(1119 + static_cast<int>(m)); | 1480 r.module().RandomizeMemory(1119 + static_cast<int>(m)); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1591 CHECK_EQ(expected, result); | 1599 CHECK_EQ(expected, result); |
1592 } | 1600 } |
1593 } | 1601 } |
1594 } | 1602 } |
1595 } | 1603 } |
1596 | 1604 |
1597 WASM_EXEC_TEST(MixedCall_i64_0) { Run_WasmMixedCall_N(execution_mode, 0); } | 1605 WASM_EXEC_TEST(MixedCall_i64_0) { Run_WasmMixedCall_N(execution_mode, 0); } |
1598 WASM_EXEC_TEST(MixedCall_i64_1) { Run_WasmMixedCall_N(execution_mode, 1); } | 1606 WASM_EXEC_TEST(MixedCall_i64_1) { Run_WasmMixedCall_N(execution_mode, 1); } |
1599 WASM_EXEC_TEST(MixedCall_i64_2) { Run_WasmMixedCall_N(execution_mode, 2); } | 1607 WASM_EXEC_TEST(MixedCall_i64_2) { Run_WasmMixedCall_N(execution_mode, 2); } |
1600 WASM_EXEC_TEST(MixedCall_i64_3) { Run_WasmMixedCall_N(execution_mode, 3); } | 1608 WASM_EXEC_TEST(MixedCall_i64_3) { Run_WasmMixedCall_N(execution_mode, 3); } |
OLD | NEW |