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

Unified Diff: test/cctest/compiler/test-run-native-calls.cc

Issue 1299023002: [turbofan] Fix stack->stack double moves for pushing on ia32 and x64. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 | « src/compiler/x64/instruction-selector-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-native-calls.cc
diff --git a/test/cctest/compiler/test-run-native-calls.cc b/test/cctest/compiler/test-run-native-calls.cc
index 4a963d5f9743d018c10a899d107f66194fbf1b19..fa639e298dd7e98c090f764520380fabb7f0eb57 100644
--- a/test/cctest/compiler/test-run-native-calls.cc
+++ b/test/cctest/compiler/test-run-native-calls.cc
@@ -447,7 +447,7 @@ class Computer {
Unique<HeapObject> unique =
Unique<HeapObject>::CreateUninitialized(inner);
Node* target = raw.HeapConstant(unique);
- Node** args = zone.NewArray<Node*>(kMaxParamCount);
+ Node** args = zone.NewArray<Node*>(num_params);
for (int i = 0; i < num_params; i++) {
args[i] = io.MakeConstant(raw, io.input[i]);
}
@@ -930,3 +930,56 @@ TEST(Float64Select_stack_params_return_reg) {
RunSelect<float64, 5>(desc);
}
}
+
+
+template <typename CType, int which>
+static void Build_Select_With_Call(CallDescriptor* desc,
+ RawMachineAssembler& raw) {
+ Handle<Code> inner = Handle<Code>::null();
+ int num_params = ParamCount(desc);
+ CHECK_LE(num_params, kMaxParamCount);
+ {
+ Isolate* isolate = CcTest::InitIsolateOnce();
+ // Build the actual select.
+ Zone zone;
+ Graph graph(&zone);
+ RawMachineAssembler raw(isolate, &graph, desc);
+ raw.Return(raw.Parameter(which));
+ inner = CompileGraph("Select-indirection", desc, &graph, raw.Export());
+ CHECK(!inner.is_null());
+ CHECK(inner->IsCode());
+ }
+
+ {
+ // Build a call to the function that does the select.
+ Unique<HeapObject> unique = Unique<HeapObject>::CreateUninitialized(inner);
+ Node* target = raw.HeapConstant(unique);
+ Node** args = raw.zone()->NewArray<Node*>(num_params);
+ for (int i = 0; i < num_params; i++) {
+ args[i] = raw.Parameter(i);
+ }
+
+ Node* call = raw.CallN(desc, target, args);
+ raw.Return(call);
+ }
+}
+
+
+TEST(Float64StackParamsToStackParams) {
+ if (DISABLE_NATIVE_STACK_PARAMS) return;
+
+ int rarray[] = {0};
+ Allocator params(nullptr, 0, nullptr, 0);
+ Allocator rets(nullptr, 0, rarray, 1);
+
+ Zone zone;
+ ArgsBuffer<float64>::Sig sig(2);
+ RegisterConfig config(params, rets);
+ CallDescriptor* desc = config.Create(&zone, &sig);
+
+ Run_Computation<float64>(desc, Build_Select_With_Call<float64, 0>,
+ Compute_Select<float64, 0>, 1098);
+
+ Run_Computation<float64>(desc, Build_Select_With_Call<float64, 1>,
+ Compute_Select<float64, 1>, 1099);
+}
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698