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

Unified Diff: test/cctest/wasm/test-run-wasm-asmjs.cc

Issue 1972153002: [wasm] Implement an interpreter for WASM. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/wasm/test-run-wasm-64.cc ('k') | test/cctest/wasm/test-run-wasm-interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-run-wasm-asmjs.cc
diff --git a/test/cctest/wasm/test-run-wasm-asmjs.cc b/test/cctest/wasm/test-run-wasm-asmjs.cc
index c597fc8e43a1581c280715f87cdd662589129d04..30de588a062e45344ab0f313c380f4853d602841 100644
--- a/test/cctest/wasm/test-run-wasm-asmjs.cc
+++ b/test/cctest/wasm/test-run-wasm-asmjs.cc
@@ -27,7 +27,8 @@ using namespace v8::internal::wasm;
#define RET_I8(x) kExprI8Const, x, kExprReturn, 1
WASM_EXEC_TEST(Int32AsmjsDivS) {
- WasmRunner<int32_t> r(MachineType::Int32(), MachineType::Int32());
+ WasmRunner<int32_t> r(execution_mode, MachineType::Int32(),
+ MachineType::Int32());
BUILD(r, WASM_BINOP(kExprI32AsmjsDivS, WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
const int32_t kMin = std::numeric_limits<int32_t>::min();
CHECK_EQ(0, r.Call(0, 100));
@@ -38,7 +39,8 @@ WASM_EXEC_TEST(Int32AsmjsDivS) {
}
WASM_EXEC_TEST(Int32AsmjsRemS) {
- WasmRunner<int32_t> r(MachineType::Int32(), MachineType::Int32());
+ WasmRunner<int32_t> r(execution_mode, MachineType::Int32(),
+ MachineType::Int32());
BUILD(r, WASM_BINOP(kExprI32AsmjsRemS, WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
const int32_t kMin = std::numeric_limits<int32_t>::min();
CHECK_EQ(33, r.Call(133, 100));
@@ -49,7 +51,8 @@ WASM_EXEC_TEST(Int32AsmjsRemS) {
}
WASM_EXEC_TEST(Int32AsmjsDivU) {
- WasmRunner<int32_t> r(MachineType::Int32(), MachineType::Int32());
+ WasmRunner<int32_t> r(execution_mode, MachineType::Int32(),
+ MachineType::Int32());
BUILD(r, WASM_BINOP(kExprI32AsmjsDivU, WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
const int32_t kMin = std::numeric_limits<int32_t>::min();
CHECK_EQ(0, r.Call(0, 100));
@@ -60,7 +63,8 @@ WASM_EXEC_TEST(Int32AsmjsDivU) {
}
WASM_EXEC_TEST(Int32AsmjsRemU) {
- WasmRunner<int32_t> r(MachineType::Int32(), MachineType::Int32());
+ WasmRunner<int32_t> r(execution_mode, MachineType::Int32(),
+ MachineType::Int32());
BUILD(r, WASM_BINOP(kExprI32AsmjsRemU, WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
const int32_t kMin = std::numeric_limits<int32_t>::min();
CHECK_EQ(17, r.Call(217, 100));
@@ -71,7 +75,7 @@ WASM_EXEC_TEST(Int32AsmjsRemU) {
}
WASM_EXEC_TEST(I32AsmjsSConvertF32) {
- WasmRunner<int32_t> r(MachineType::Float32());
+ WasmRunner<int32_t> r(execution_mode, MachineType::Float32());
BUILD(r, WASM_UNOP(kExprI32AsmjsSConvertF32, WASM_GET_LOCAL(0)));
FOR_FLOAT32_INPUTS(i) {
@@ -81,7 +85,7 @@ WASM_EXEC_TEST(I32AsmjsSConvertF32) {
}
WASM_EXEC_TEST(I32AsmjsSConvertF64) {
- WasmRunner<int32_t> r(MachineType::Float64());
+ WasmRunner<int32_t> r(execution_mode, MachineType::Float64());
BUILD(r, WASM_UNOP(kExprI32AsmjsSConvertF64, WASM_GET_LOCAL(0)));
FOR_FLOAT64_INPUTS(i) {
@@ -91,7 +95,7 @@ WASM_EXEC_TEST(I32AsmjsSConvertF64) {
}
WASM_EXEC_TEST(I32AsmjsUConvertF32) {
- WasmRunner<uint32_t> r(MachineType::Float32());
+ WasmRunner<uint32_t> r(execution_mode, MachineType::Float32());
BUILD(r, WASM_UNOP(kExprI32AsmjsUConvertF32, WASM_GET_LOCAL(0)));
FOR_FLOAT32_INPUTS(i) {
@@ -101,7 +105,7 @@ WASM_EXEC_TEST(I32AsmjsUConvertF32) {
}
WASM_EXEC_TEST(I32AsmjsUConvertF64) {
- WasmRunner<uint32_t> r(MachineType::Float64());
+ WasmRunner<uint32_t> r(execution_mode, MachineType::Float64());
BUILD(r, WASM_UNOP(kExprI32AsmjsUConvertF64, WASM_GET_LOCAL(0)));
FOR_FLOAT64_INPUTS(i) {
@@ -111,7 +115,7 @@ WASM_EXEC_TEST(I32AsmjsUConvertF64) {
}
WASM_EXEC_TEST(LoadMemI32_oob_asm) {
- TestingModule module;
+ TestingModule module(execution_mode);
int32_t* memory = module.AddMemoryElems<int32_t>(8);
WasmRunner<int32_t> r(&module, MachineType::Uint32());
module.RandomizeMemory(1112);
@@ -131,7 +135,7 @@ WASM_EXEC_TEST(LoadMemI32_oob_asm) {
}
WASM_EXEC_TEST(LoadMemF32_oob_asm) {
- TestingModule module;
+ TestingModule module(execution_mode);
float* memory = module.AddMemoryElems<float>(8);
WasmRunner<float> r(&module, MachineType::Uint32());
module.RandomizeMemory(1112);
@@ -151,7 +155,7 @@ WASM_EXEC_TEST(LoadMemF32_oob_asm) {
}
WASM_EXEC_TEST(LoadMemF64_oob_asm) {
- TestingModule module;
+ TestingModule module(execution_mode);
double* memory = module.AddMemoryElems<double>(8);
WasmRunner<double> r(&module, MachineType::Uint32());
module.RandomizeMemory(1112);
@@ -173,7 +177,7 @@ WASM_EXEC_TEST(LoadMemF64_oob_asm) {
}
WASM_EXEC_TEST(StoreMemI32_oob_asm) {
- TestingModule module;
+ TestingModule module(execution_mode);
int32_t* memory = module.AddMemoryElems<int32_t>(8);
WasmRunner<int32_t> r(&module, MachineType::Uint32(), MachineType::Uint32());
module.RandomizeMemory(1112);
« no previous file with comments | « test/cctest/wasm/test-run-wasm-64.cc ('k') | test/cctest/wasm/test-run-wasm-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698