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 <stdlib.h> | 5 #include <stdlib.h> |
6 #include <string.h> | 6 #include <string.h> |
7 | 7 |
8 #include "src/compiler/graph-visualizer.h" | 8 #include "src/compiler/graph-visualizer.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/wasm-compiler.h" | 10 #include "src/compiler/wasm-compiler.h" |
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 CHECK_EQ(i == 1 ? kWritten : 88888888, memory[2]); | 1892 CHECK_EQ(i == 1 ? kWritten : 88888888, memory[2]); |
1893 CHECK_EQ(i == 2 ? kWritten : 99999999, memory[3]); | 1893 CHECK_EQ(i == 2 ? kWritten : 99999999, memory[3]); |
1894 } | 1894 } |
1895 } | 1895 } |
1896 | 1896 |
1897 | 1897 |
1898 TEST(Run_Wasm_StoreMem_offset_oob) { | 1898 TEST(Run_Wasm_StoreMem_offset_oob) { |
1899 TestingModule module; | 1899 TestingModule module; |
1900 byte* memory = module.AddMemoryElems<byte>(32); | 1900 byte* memory = module.AddMemoryElems<byte>(32); |
1901 | 1901 |
| 1902 #if WASM_64 |
1902 static const MachineType machineTypes[] = { | 1903 static const MachineType machineTypes[] = { |
1903 MachineType::Int8(), MachineType::Uint8(), MachineType::Int16(), | 1904 MachineType::Int8(), MachineType::Uint8(), MachineType::Int16(), |
1904 MachineType::Uint16(), MachineType::Int32(), MachineType::Uint32(), | 1905 MachineType::Uint16(), MachineType::Int32(), MachineType::Uint32(), |
1905 MachineType::Int64(), MachineType::Uint64(), MachineType::Float32(), | 1906 MachineType::Int64(), MachineType::Uint64(), MachineType::Float32(), |
1906 MachineType::Float64()}; | 1907 MachineType::Float64()}; |
| 1908 #else |
| 1909 static const MachineType machineTypes[] = { |
| 1910 MachineType::Int8(), MachineType::Uint8(), MachineType::Int16(), |
| 1911 MachineType::Uint16(), MachineType::Int32(), MachineType::Uint32(), |
| 1912 MachineType::Float32(), MachineType::Float64()}; |
| 1913 #endif |
1907 | 1914 |
1908 for (size_t m = 0; m < arraysize(machineTypes); m++) { | 1915 for (size_t m = 0; m < arraysize(machineTypes); m++) { |
1909 module.RandomizeMemory(1119 + static_cast<int>(m)); | 1916 module.RandomizeMemory(1119 + static_cast<int>(m)); |
1910 WasmRunner<int32_t> r(MachineType::Uint32()); | 1917 WasmRunner<int32_t> r(MachineType::Uint32()); |
1911 r.env()->module = &module; | 1918 r.env()->module = &module; |
1912 | 1919 |
1913 BUILD(r, WASM_STORE_MEM_OFFSET(machineTypes[m], 8, WASM_GET_LOCAL(0), | 1920 BUILD(r, WASM_STORE_MEM_OFFSET(machineTypes[m], 8, WASM_GET_LOCAL(0), |
1914 WASM_LOAD_MEM(machineTypes[m], WASM_ZERO)), | 1921 WASM_LOAD_MEM(machineTypes[m], WASM_ZERO)), |
1915 WASM_ZERO); | 1922 WASM_ZERO); |
1916 | 1923 |
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3384 | 3391 |
3385 | 3392 |
3386 TEST(Run_Wasm_F32CopySign) { | 3393 TEST(Run_Wasm_F32CopySign) { |
3387 WasmRunner<float> r(MachineType::Float32(), MachineType::Float32()); | 3394 WasmRunner<float> r(MachineType::Float32(), MachineType::Float32()); |
3388 BUILD(r, WASM_F32_COPYSIGN(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); | 3395 BUILD(r, WASM_F32_COPYSIGN(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
3389 | 3396 |
3390 FOR_FLOAT32_INPUTS(i) { | 3397 FOR_FLOAT32_INPUTS(i) { |
3391 FOR_FLOAT32_INPUTS(j) { CheckFloatEq(copysign(*i, *j), r.Call(*i, *j)); } | 3398 FOR_FLOAT32_INPUTS(j) { CheckFloatEq(copysign(*i, *j), r.Call(*i, *j)); } |
3392 } | 3399 } |
3393 } | 3400 } |
OLD | NEW |