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

Unified Diff: test/compiler-unittests/graph-unittest.cc

Issue 479793004: [turbofan] Initial import of SimplifiedOperatorReducer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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
Index: test/compiler-unittests/graph-unittest.cc
diff --git a/test/compiler-unittests/graph-unittest.cc b/test/compiler-unittests/graph-unittest.cc
index c5f247065f04ebaea2a0de1ce84daa0966a370cf..251c5a055f45327e1ff5d9d45500070c2586138d 100644
--- a/test/compiler-unittests/graph-unittest.cc
+++ b/test/compiler-unittests/graph-unittest.cc
@@ -40,6 +40,54 @@ GraphTest::GraphTest(int num_parameters) : graph_(zone()) {
GraphTest::~GraphTest() {}
+Node* GraphTest::Parameter(int32_t index) {
+ return graph()->NewNode(common()->Parameter(index), graph()->start());
+}
+
+
+Node* GraphTest::Float64Constant(double value) {
+ return graph()->NewNode(common()->Float64Constant(value));
+}
+
+
+Node* GraphTest::Int32Constant(int32_t value) {
+ return graph()->NewNode(common()->Int32Constant(value));
+}
+
+
+Node* GraphTest::NumberConstant(double value) {
+ return graph()->NewNode(common()->NumberConstant(value));
+}
+
+
+Node* GraphTest::HeapConstant(const PrintableUnique<HeapObject>& value) {
+ return graph()->NewNode(common()->HeapConstant(value));
+}
+
+
+Node* GraphTest::FalseConstant() {
+ return HeapConstant(PrintableUnique<HeapObject>::CreateImmovable(
+ zone(), factory()->false_value()));
+}
+
+
+Node* GraphTest::TrueConstant() {
+ return HeapConstant(PrintableUnique<HeapObject>::CreateImmovable(
+ zone(), factory()->true_value()));
+}
+
+
+Matcher<Node*> GraphTest::IsFalseConstant() {
+ return IsHeapConstant(PrintableUnique<HeapObject>::CreateImmovable(
+ zone(), factory()->false_value()));
+}
+
+
+Matcher<Node*> GraphTest::IsTrueConstant() {
+ return IsHeapConstant(PrintableUnique<HeapObject>::CreateImmovable(
+ zone(), factory()->true_value()));
+}
+
namespace {
template <typename T>
@@ -599,6 +647,12 @@ Matcher<Node*> IsInt32Constant(const Matcher<int32_t>& value_matcher) {
}
+Matcher<Node*> IsFloat64Constant(const Matcher<double>& value_matcher) {
+ return MakeMatcher(
+ new IsConstantMatcher<double>(IrOpcode::kFloat64Constant, value_matcher));
+}
+
+
Matcher<Node*> IsNumberConstant(const Matcher<double>& value_matcher) {
return MakeMatcher(
new IsConstantMatcher<double>(IrOpcode::kNumberConstant, value_matcher));
« no previous file with comments | « test/compiler-unittests/graph-unittest.h ('k') | test/compiler-unittests/machine-operator-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698