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

Unified Diff: src/compiler/instruction-selector-unittest.h

Issue 530783002: Convert Linkage to use MachineSignature. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase. Created 6 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 | « src/compiler/instruction-selector-impl.h ('k') | src/compiler/instruction-selector-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector-unittest.h
diff --git a/src/compiler/instruction-selector-unittest.h b/src/compiler/instruction-selector-unittest.h
index 3f6f252ea24757b6a6ed6638b165545ca6af137e..476733c01e4757eec35adad8b6773fb6b0ad1d5d 100644
--- a/src/compiler/instruction-selector-unittest.h
+++ b/src/compiler/instruction-selector-unittest.h
@@ -36,28 +36,28 @@ class InstructionSelectorTest : public CompilerTest {
public:
StreamBuilder(InstructionSelectorTest* test, MachineType return_type)
: RawMachineAssembler(new (test->zone()) Graph(test->zone()),
- CallDescriptorBuilder(test->zone(), return_type)),
+ MakeMachineSignature(test->zone(), return_type)),
test_(test) {}
StreamBuilder(InstructionSelectorTest* test, MachineType return_type,
MachineType parameter0_type)
- : RawMachineAssembler(new (test->zone()) Graph(test->zone()),
- CallDescriptorBuilder(test->zone(), return_type,
- parameter0_type)),
+ : RawMachineAssembler(
+ new (test->zone()) Graph(test->zone()),
+ MakeMachineSignature(test->zone(), return_type, parameter0_type)),
test_(test) {}
StreamBuilder(InstructionSelectorTest* test, MachineType return_type,
MachineType parameter0_type, MachineType parameter1_type)
: RawMachineAssembler(
new (test->zone()) Graph(test->zone()),
- CallDescriptorBuilder(test->zone(), return_type, parameter0_type,
- parameter1_type)),
+ MakeMachineSignature(test->zone(), return_type, parameter0_type,
+ parameter1_type)),
test_(test) {}
StreamBuilder(InstructionSelectorTest* test, MachineType return_type,
MachineType parameter0_type, MachineType parameter1_type,
MachineType parameter2_type)
: RawMachineAssembler(
new (test->zone()) Graph(test->zone()),
- CallDescriptorBuilder(test->zone(), return_type, parameter0_type,
- parameter1_type, parameter2_type)),
+ MakeMachineSignature(test->zone(), return_type, parameter0_type,
+ parameter1_type, parameter2_type)),
test_(test) {}
Stream Build(CpuFeature feature) {
@@ -73,38 +73,41 @@ class InstructionSelectorTest : public CompilerTest {
StreamBuilderMode mode = kTargetInstructions);
private:
- MachineCallDescriptorBuilder* CallDescriptorBuilder(
- Zone* zone, MachineType return_type) {
- return new (zone) MachineCallDescriptorBuilder(return_type, 0, NULL);
- }
-
- MachineCallDescriptorBuilder* CallDescriptorBuilder(
- Zone* zone, MachineType return_type, MachineType parameter0_type) {
- MachineType* parameter_types = zone->NewArray<MachineType>(1);
- parameter_types[0] = parameter0_type;
- return new (zone)
- MachineCallDescriptorBuilder(return_type, 1, parameter_types);
- }
-
- MachineCallDescriptorBuilder* CallDescriptorBuilder(
- Zone* zone, MachineType return_type, MachineType parameter0_type,
- MachineType parameter1_type) {
- MachineType* parameter_types = zone->NewArray<MachineType>(2);
- parameter_types[0] = parameter0_type;
- parameter_types[1] = parameter1_type;
- return new (zone)
- MachineCallDescriptorBuilder(return_type, 2, parameter_types);
- }
-
- MachineCallDescriptorBuilder* CallDescriptorBuilder(
- Zone* zone, MachineType return_type, MachineType parameter0_type,
- MachineType parameter1_type, MachineType parameter2_type) {
- MachineType* parameter_types = zone->NewArray<MachineType>(3);
- parameter_types[0] = parameter0_type;
- parameter_types[1] = parameter1_type;
- parameter_types[2] = parameter2_type;
- return new (zone)
- MachineCallDescriptorBuilder(return_type, 3, parameter_types);
+ MachineSignature* MakeMachineSignature(Zone* zone,
+ MachineType return_type) {
+ MachineSignature::Builder builder(zone, 1, 0);
+ builder.AddReturn(return_type);
+ return builder.Build();
+ }
+
+ MachineSignature* MakeMachineSignature(Zone* zone, MachineType return_type,
+ MachineType parameter0_type) {
+ MachineSignature::Builder builder(zone, 1, 1);
+ builder.AddReturn(return_type);
+ builder.AddParam(parameter0_type);
+ return builder.Build();
+ }
+
+ MachineSignature* MakeMachineSignature(Zone* zone, MachineType return_type,
+ MachineType parameter0_type,
+ MachineType parameter1_type) {
+ MachineSignature::Builder builder(zone, 1, 2);
+ builder.AddReturn(return_type);
+ builder.AddParam(parameter0_type);
+ builder.AddParam(parameter1_type);
+ return builder.Build();
+ }
+
+ MachineSignature* MakeMachineSignature(Zone* zone, MachineType return_type,
+ MachineType parameter0_type,
+ MachineType parameter1_type,
+ MachineType parameter2_type) {
+ MachineSignature::Builder builder(zone, 1, 3);
+ builder.AddReturn(return_type);
+ builder.AddParam(parameter0_type);
+ builder.AddParam(parameter1_type);
+ builder.AddParam(parameter2_type);
+ return builder.Build();
}
private:
« no previous file with comments | « src/compiler/instruction-selector-impl.h ('k') | src/compiler/instruction-selector-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698