// Copyright 2014 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_COMPILER_UNITTESTS_GRAPH_UNITTEST_H_ #define V8_COMPILER_UNITTESTS_GRAPH_UNITTEST_H_ #include "src/compiler/graph.h" #include "src/compiler/machine-operator.h" #include "test/compiler-unittests/common-operator-unittest.h" #include "testing/gmock/include/gmock/gmock.h" namespace v8 { namespace internal { // Forward declarations. class HeapObject; template class PrintableUnique; namespace compiler { class GraphTest : public CommonOperatorTest { public: explicit GraphTest(int parameters = 1); virtual ~GraphTest(); protected: Graph* graph() { return &graph_; } private: Graph graph_; }; using ::testing::Matcher; Matcher IsBranch(const Matcher& value_matcher, const Matcher& control_matcher); Matcher IsMerge(const Matcher& control0_matcher, const Matcher& control1_matcher); Matcher IsIfTrue(const Matcher& control_matcher); Matcher IsIfFalse(const Matcher& control_matcher); Matcher IsControlEffect(const Matcher& control_matcher); Matcher IsValueEffect(const Matcher& value_matcher); Matcher IsFinish(const Matcher& value_matcher, const Matcher& effect_matcher); Matcher IsExternalConstant( const Matcher& value_matcher); Matcher IsHeapConstant( const Matcher >& value_matcher); Matcher IsInt32Constant(const Matcher& value_matcher); Matcher IsNumberConstant(const Matcher& value_matcher); Matcher IsPhi(const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& merge_matcher); Matcher IsProjection(const Matcher& index_matcher, const Matcher& base_matcher); Matcher IsCall(const Matcher& descriptor_matcher, const Matcher& value0_matcher, const Matcher& value1_matcher, const Matcher& value2_matcher, const Matcher& value3_matcher, const Matcher& effect_matcher, const Matcher& control_matcher); Matcher IsLoad(const Matcher& type_matcher, const Matcher& base_matcher, const Matcher& index_matcher, const Matcher& effect_matcher); Matcher IsStore(const Matcher& type_matcher, const Matcher& write_barrier_matcher, const Matcher& base_matcher, const Matcher& index_matcher, const Matcher& value_matcher, const Matcher& effect_matcher, const Matcher& control_matcher); Matcher IsWord32And(const Matcher& lhs_matcher, const Matcher& rhs_matcher); Matcher IsWord32Sar(const Matcher& lhs_matcher, const Matcher& rhs_matcher); Matcher IsWord32Shl(const Matcher& lhs_matcher, const Matcher& rhs_matcher); Matcher IsWord32Ror(const Matcher& lhs_matcher, const Matcher& rhs_matcher); Matcher IsWord32Equal(const Matcher& lhs_matcher, const Matcher& rhs_matcher); Matcher IsWord64And(const Matcher& lhs_matcher, const Matcher& rhs_matcher); Matcher IsWord64Shl(const Matcher& lhs_matcher, const Matcher& rhs_matcher); Matcher IsWord64Sar(const Matcher& lhs_matcher, const Matcher& rhs_matcher); Matcher IsWord64Equal(const Matcher& lhs_matcher, const Matcher& rhs_matcher); Matcher IsInt32AddWithOverflow(const Matcher& lhs_matcher, const Matcher& rhs_matcher); Matcher IsUint32LessThanOrEqual(const Matcher& lhs_matcher, const Matcher& rhs_matcher); Matcher IsChangeFloat64ToInt32(const Matcher& input_matcher); Matcher IsChangeInt32ToFloat64(const Matcher& input_matcher); Matcher IsChangeInt32ToInt64(const Matcher& input_matcher); Matcher IsChangeUint32ToFloat64(const Matcher& input_matcher); Matcher IsChangeUint32ToUint64(const Matcher& input_matcher); Matcher IsTruncateFloat64ToInt32(const Matcher& input_matcher); Matcher IsTruncateInt64ToInt32(const Matcher& input_matcher); } // namespace compiler } // namespace internal } // namespace v8 #endif // V8_COMPILER_UNITTESTS_GRAPH_UNITTEST_H_