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

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

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/wasm/test-run-wasm.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-64.cc
diff --git a/test/cctest/wasm/test-run-wasm-64.cc b/test/cctest/wasm/test-run-wasm-64.cc
index 8ccc03901e95ba6ac5d98788fe9d245e5e697e2a..966524497e82cab79a460f2347bbca6cfe9719f0 100644
--- a/test/cctest/wasm/test-run-wasm-64.cc
+++ b/test/cctest/wasm/test-run-wasm-64.cc
@@ -32,6 +32,7 @@
#define asu64(x) static_cast<uint64_t>(x)
#define B2(a, b) kExprBlock, a, b, kExprEnd
+#define B1(a) kExprBlock, a, kExprEnd
// Can't bridge macro land with nested macros.
#if V8_TARGET_ARCH_MIPS
@@ -834,8 +835,8 @@
WasmRunner<int32_t> r(&module);
BUILD(
r,
- WASM_I32_CONVERT_I64(WASM_CALL_FUNCTION(
- index, WASM_I64V_9(0xbcd12340000000b),
+ WASM_I32_CONVERT_I64(WASM_CALL_FUNCTIONN(
+ 19, index, WASM_I64V_9(0xbcd12340000000b),
WASM_I64V_9(0xbcd12340000000c), WASM_I32V_1(0xd),
WASM_I32_CONVERT_I64(WASM_I64V_9(0xbcd12340000000e)),
WASM_I64V_9(0xbcd12340000000f), WASM_I64V_10(0xbcd1234000000010),
@@ -1118,7 +1119,7 @@
// Build the caller function.
WasmRunner<int64_t> r(&module, MachineType::Int64(), MachineType::Int64());
- BUILD(r, WASM_CALL_FUNCTION(index, WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ BUILD(r, WASM_CALL_FUNCTION2(index, WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
FOR_INT32_INPUTS(i) {
FOR_INT32_INPUTS(j) {
@@ -1153,11 +1154,7 @@
ZERO_OFFSET, // --
kExprI64StoreMem, // --
ZERO_ALIGNMENT, // --
- ZERO_OFFSET, // --
- kExprI8Const, 0, // --
- loads[m], // --
- ZERO_ALIGNMENT, // --
- ZERO_OFFSET, // --
+ ZERO_OFFSET // --
};
r.Build(code, code + arraysize(code));
@@ -1259,9 +1256,10 @@
int64_t* memory = module.AddMemoryElems<int64_t>(8);
WasmRunner<int64_t> r(&module, MachineType::Int64());
- BUILD(r, WASM_STORE_MEM(MachineType::Float64(), WASM_ZERO,
- WASM_F64_REINTERPRET_I64(WASM_GET_LOCAL(0))),
- WASM_GET_LOCAL(0));
+ BUILD(r,
+ WASM_BLOCK(WASM_STORE_MEM(MachineType::Float64(), WASM_ZERO,
+ WASM_F64_REINTERPRET_I64(WASM_GET_LOCAL(0))),
+ WASM_GET_LOCAL(0)));
FOR_INT32_INPUTS(i) {
int64_t expected = static_cast<int64_t>(*i) * 0x300010001;
@@ -1322,17 +1320,18 @@
WasmRunner<uint64_t> r(&module, MachineType::Int32());
const byte kSum = r.AllocateLocal(kAstI64);
- BUILD(
- r,
- WASM_WHILE(
- WASM_GET_LOCAL(0),
- WASM_BLOCK(
- WASM_SET_LOCAL(kSum,
- WASM_I64_ADD(WASM_GET_LOCAL(kSum),
- WASM_LOAD_MEM(MachineType::Int64(),
- WASM_GET_LOCAL(0)))),
- WASM_SET_LOCAL(0, WASM_I32_SUB(WASM_GET_LOCAL(0), WASM_I8(8))))),
- WASM_GET_LOCAL(1));
+ BUILD(r,
+ WASM_BLOCK(
+ WASM_WHILE(
+ WASM_GET_LOCAL(0),
+ WASM_BLOCK(
+ WASM_SET_LOCAL(
+ kSum, WASM_I64_ADD(WASM_GET_LOCAL(kSum),
+ WASM_LOAD_MEM(MachineType::Int64(),
+ WASM_GET_LOCAL(0)))),
+ WASM_SET_LOCAL(
+ 0, WASM_I32_SUB(WASM_GET_LOCAL(0), WASM_I8(8))))),
+ WASM_GET_LOCAL(1)));
// Run 4 trials.
for (int i = 0; i < 3; i++) {
@@ -1354,8 +1353,7 @@
for (byte i = 0; i <= 3; i++) {
WasmRunner<int64_t> r(&module, MachineType::Int64());
BUILD(r, WASM_STORE_MEM_ALIGNMENT(MachineType::Int64(), WASM_ZERO, i,
- WASM_GET_LOCAL(0)),
- WASM_GET_LOCAL(0));
+ WASM_GET_LOCAL(0)));
module.RandomizeMemory(1111);
module.WriteMemory<int64_t>(&memory[0], 0);
@@ -1373,10 +1371,10 @@
int64_t* global = module.AddGlobal<int64_t>(kAstI64);
WasmRunner<int32_t> r(&module, MachineType::Int32());
// global = global + p0
- BUILD(r, WASM_SET_GLOBAL(
- 0, WASM_I64_AND(WASM_GET_GLOBAL(0),
- WASM_I64_SCONVERT_I32(WASM_GET_LOCAL(0)))),
- WASM_ZERO);
+ BUILD(r, B2(WASM_SET_GLOBAL(
+ 0, WASM_I64_AND(WASM_GET_GLOBAL(0),
+ WASM_I64_SCONVERT_I32(WASM_GET_LOCAL(0)))),
+ WASM_ZERO));
module.WriteMemory<int64_t>(global, 0xFFFFFFFFFFFFFFFFLL);
for (int i = 9; i < 444444; i += 111111) {
@@ -1479,11 +1477,11 @@
WasmFunctionCompiler t(sig, &module);
std::vector<byte> code;
+ ADD_CODE(code, kExprI8Const, 0);
for (byte p = 0; p < num_params; p++) {
ADD_CODE(code, kExprGetLocal, p);
}
- ADD_CODE(code, kExprI8Const, 0);
- ADD_CODE(code, kExprCallIndirect, 1);
+ ADD_CODE(code, kExprCallIndirect, static_cast<byte>(num_params), 1);
t.Build(&code[0], &code[0] + code.size());
t.Compile();
@@ -1542,7 +1540,8 @@
}
// Call the selector function.
- ADD_CODE(code, kExprCallFunction, static_cast<byte>(index));
+ ADD_CODE(code, kExprCallFunction, static_cast<byte>(num_params),
+ static_cast<byte>(index));
// Store the result in memory.
ADD_CODE(code,
« no previous file with comments | « test/cctest/wasm/test-run-wasm.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