| 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));
|
|
|