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

Unified Diff: test/cctest/compiler/test-machine-operator-reducer.cc

Issue 552653003: [turbofan] Fix the node matchers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address nit. 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 | « test/cctest/compiler/test-js-typed-lowering.cc ('k') | test/cctest/compiler/test-representation-change.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-machine-operator-reducer.cc
diff --git a/test/cctest/compiler/test-machine-operator-reducer.cc b/test/cctest/compiler/test-machine-operator-reducer.cc
index 562766230d16d4a060642d24b3f2568061ad7efa..bcd68356e84db18c0f841d730592b7de77450293 100644
--- a/test/cctest/compiler/test-machine-operator-reducer.cc
+++ b/test/cctest/compiler/test-machine-operator-reducer.cc
@@ -30,6 +30,22 @@ Operator* NewConstantOperator<double>(CommonOperatorBuilder* common,
}
+template <typename T>
+T ValueOfOperator(const Operator* op);
+
+template <>
+int32_t ValueOfOperator<int32_t>(const Operator* op) {
+ CHECK_EQ(IrOpcode::kInt32Constant, op->opcode());
+ return OpParameter<int32_t>(op);
+}
+
+template <>
+double ValueOfOperator<double>(const Operator* op) {
+ CHECK_EQ(IrOpcode::kFloat64Constant, op->opcode());
+ return OpParameter<double>(op);
+}
+
+
class ReducerTester : public HandleAndZoneScope {
public:
explicit ReducerTester(int num_parameters = 0)
@@ -61,6 +77,11 @@ class ReducerTester : public HandleAndZoneScope {
return graph.NewNode(NewConstantOperator<T>(&common, value));
}
+ template <typename T>
+ const T ValueOf(const Operator* op) {
+ return ValueOfOperator<T>(op);
+ }
+
// Check that the reduction of this binop applied to constants {a} and {b}
// yields the {expect} value.
template <typename T>
« no previous file with comments | « test/cctest/compiler/test-js-typed-lowering.cc ('k') | test/cctest/compiler/test-representation-change.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698