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

Unified Diff: test/cctest/compiler/instruction-selector-tester.h

Issue 441883004: [turbofan] Improve testability of the InstructionSelector. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Also add sample test for ia32. Created 6 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 | « test/cctest/cctest.gyp ('k') | test/cctest/compiler/test-instruction-selector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/instruction-selector-tester.h
diff --git a/test/cctest/compiler/instruction-selector-tester.h b/test/cctest/compiler/instruction-selector-tester.h
index 2a84b5703afa9e5492b67dbd5ec45bc2690e192e..75da5014a6550fd64b2d4690ad1c1e7e2149b786 100644
--- a/test/cctest/compiler/instruction-selector-tester.h
+++ b/test/cctest/compiler/instruction-selector-tester.h
@@ -36,15 +36,27 @@ class InstructionSelectorTester : public HandleAndZoneScope,
return array;
}
- explicit InstructionSelectorTester(Mode mode = kTargetMode)
+ InstructionSelectorTester()
: RawMachineAssembler(
new (main_zone()) Graph(main_zone()), new (main_zone())
MachineCallDescriptorBuilder(kMachineWord32, kParameterCount,
BuildParameterArray(main_zone())),
- MachineOperatorBuilder::pointer_rep()),
- mode_(mode) {}
+ MachineOperatorBuilder::pointer_rep()) {}
- void SelectInstructions() {
+ void SelectInstructions(CpuFeature feature) {
+ SelectInstructions(InstructionSelector::Features(feature));
+ }
+
+ void SelectInstructions(CpuFeature feature1, CpuFeature feature2) {
+ SelectInstructions(InstructionSelector::Features(feature1, feature2));
+ }
+
+ void SelectInstructions(Mode mode = kTargetMode) {
+ SelectInstructions(InstructionSelector::Features(), mode);
+ }
+
+ void SelectInstructions(InstructionSelector::Features features,
+ Mode mode = kTargetMode) {
OFStream out(stdout);
Schedule* schedule = Export();
CHECK_NE(0, graph()->NodeCount());
@@ -52,7 +64,7 @@ class InstructionSelectorTester : public HandleAndZoneScope,
Linkage linkage(&info, call_descriptor());
InstructionSequence sequence(&linkage, graph(), schedule);
SourcePositionTable source_positions(graph());
- InstructionSelector selector(&sequence, &source_positions);
+ InstructionSelector selector(&sequence, &source_positions, features);
selector.SelectInstructions();
out << "--- Code sequence after instruction selection --- " << endl
<< sequence;
@@ -60,7 +72,7 @@ class InstructionSelectorTester : public HandleAndZoneScope,
i != sequence.end(); ++i) {
Instruction* instr = *i;
if (instr->opcode() < 0) continue;
- if (mode_ == kTargetMode) {
+ if (mode == kTargetMode) {
switch (ArchOpcodeField::decode(instr->opcode())) {
#define CASE(Name) \
case k##Name: \
@@ -98,9 +110,6 @@ class InstructionSelectorTester : public HandleAndZoneScope,
VirtualRegisterSet doubles;
VirtualRegisterSet references;
std::deque<Constant> immediates;
-
- private:
- Mode mode_;
};
« no previous file with comments | « test/cctest/cctest.gyp ('k') | test/cctest/compiler/test-instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698