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

Unified Diff: test/cctest/wasm/wasm-run-utils.h

Issue 1704033002: [wasm] WasmRunner can run tests with I64 parameters and return value. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@new_wasm_runner
Patch Set: Created 4 years, 10 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
« src/compiler/linkage.h ('K') | « test/cctest/wasm/test-run-wasm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/wasm-run-utils.h
diff --git a/test/cctest/wasm/wasm-run-utils.h b/test/cctest/wasm/wasm-run-utils.h
index e76b463a6cb364d64796014a82e65d4278c64d60..3ff802f7e5ea0f486df58eaf5c6a7ce3d4574fb5 100644
--- a/test/cctest/wasm/wasm-run-utils.h
+++ b/test/cctest/wasm/wasm-run-utils.h
@@ -243,7 +243,7 @@ inline void TestBuildingGraph(Zone* zone, JSGraph* jsgraph, FunctionEnv* env,
str << ", msg = " << result.error_msg.get();
FATAL(str.str().c_str());
}
- builder.Int64LoweringForTesting();
+ builder.Int64LoweringForTesting(env->sig);
if (FLAG_trace_turbo_graph) {
OFStream os(stdout);
os << AsRPO(*jsgraph->graph());
@@ -267,7 +267,8 @@ class WasmFunctionWrapper : public HandleAndZoneScope,
signature_ = sig_builder.Build();
}
- void Init(CallDescriptor* descriptor, MachineType p0 = MachineType::None(),
+ void Init(const CallDescriptor* descriptor,
+ MachineType p0 = MachineType::None(),
MachineType p1 = MachineType::None(),
MachineType p2 = MachineType::None(),
MachineType p3 = MachineType::None()) {
@@ -348,6 +349,19 @@ class WasmFunctionWrapper : public HandleAndZoneScope,
CallDescriptor* descriptor =
Linkage::GetSimplifiedCDescriptor(zone(), signature_, true);
+#if !WASM_64
+
+ Signature<MachineRepresentation>::Builder rep_builder(zone(), 1, 4);
+
+ rep_builder.AddReturn(MachineRepresentation::kWord32);
+ for (int i = 0; i < 4; i++) {
+ rep_builder.AddParam(MachineRepresentation::kWord32);
+ }
+ Int64Lowering r(graph(), machine(), common(), zone(),
+ rep_builder.Build());
+ r.LowerGraph();
+#endif
+
CompilationInfo info("testing", isolate, graph()->zone());
code_ =
Pipeline::GenerateCodeForTesting(&info, descriptor, graph(), nullptr);
@@ -387,7 +401,7 @@ class WasmFunctionCompiler : public HandleAndZoneScope,
JSGraph jsgraph;
FunctionEnv env;
// The call descriptor is initialized when the function is compiled.
- CallDescriptor* descriptor_;
+ const CallDescriptor* descriptor_;
Isolate* isolate() { return main_isolate(); }
Graph* graph() const { return main_graph_; }
@@ -399,7 +413,7 @@ class WasmFunctionCompiler : public HandleAndZoneScope,
descriptor_ = env.module->GetWasmCallDescriptor(main_zone(), env.sig);
}
}
- CallDescriptor* descriptor() { return descriptor_; }
+ const CallDescriptor* descriptor() { return descriptor_; }
void Build(const byte* start, const byte* end) {
TestBuildingGraph(main_zone(), &jsgraph, &env, start, end);
@@ -415,9 +429,13 @@ class WasmFunctionCompiler : public HandleAndZoneScope,
Handle<Code> Compile(ModuleEnv* module) {
InitializeDescriptor();
+ const CallDescriptor* desc = descriptor_;
+#if !WASM_64
+ desc = module->GetI32WasmCallDescriptor(this->zone(), desc);
+#endif
CompilationInfo info("wasm compile", this->isolate(), this->zone());
Handle<Code> result =
- Pipeline::GenerateCodeForTesting(&info, descriptor_, this->graph());
+ Pipeline::GenerateCodeForTesting(&info, desc, this->graph());
#ifdef ENABLE_DISASSEMBLER
if (!result.is_null() && FLAG_print_opt_code) {
OFStream os(stdout);
« src/compiler/linkage.h ('K') | « test/cctest/wasm/test-run-wasm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698