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

Unified Diff: test/unittests/compiler/node-test-utils.cc

Issue 1477783003: [Interpreter] Deprecate bytecode-graph-builder-unittest. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Additional clean up. Created 5 years, 1 month 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/unittests/compiler/node-test-utils.h ('k') | test/unittests/unittests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/node-test-utils.cc
diff --git a/test/unittests/compiler/node-test-utils.cc b/test/unittests/compiler/node-test-utils.cc
index 7103413b88c6186e5b73933ab15b73a121dd5dc9..4af04fa0298eca4cee70f215fa64f68c8d4eda3e 100644
--- a/test/unittests/compiler/node-test-utils.cc
+++ b/test/unittests/compiler/node-test-utils.cc
@@ -1427,437 +1427,6 @@ class IsParameterMatcher final : public NodeMatcher {
const Matcher<int> index_matcher_;
};
-
-class IsJSDeletePropertyMatcher final : public NodeMatcher {
- public:
- IsJSDeletePropertyMatcher(const Matcher<Node*>& object_value_matcher,
- const Matcher<Node*>& key_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher)
- : NodeMatcher(IrOpcode::kJSDeleteProperty),
- object_value_matcher_(object_value_matcher),
- key_matcher_(key_matcher),
- effect_matcher_(effect_matcher),
- control_matcher_(control_matcher) {}
-
- void DescribeTo(std::ostream* os) const final {
- NodeMatcher::DescribeTo(os);
- *os << " whose object (";
- object_value_matcher_.DescribeTo(os);
- *os << "), key (";
- key_matcher_.DescribeTo(os);
- *os << "), effect (";
- effect_matcher_.DescribeTo(os);
- *os << "), and control (";
- control_matcher_.DescribeTo(os);
- *os << ")";
- }
-
- bool MatchAndExplain(Node* node, MatchResultListener* listener) const final {
- return (NodeMatcher::MatchAndExplain(node, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
- "object", object_value_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1), "key",
- key_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
- effect_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetControlInput(node),
- "control", control_matcher_, listener));
- }
-
- private:
- const Matcher<Node*> object_value_matcher_;
- const Matcher<Node*> key_matcher_;
- const Matcher<Node*> effect_matcher_;
- const Matcher<Node*> control_matcher_;
-};
-
-
-class IsJSLoadGlobalMatcher final : public NodeMatcher {
- public:
- IsJSLoadGlobalMatcher(const Matcher<Handle<Name>>& name_matcher,
- const Matcher<TypeofMode> typeof_mode_matcher,
- const Matcher<Node*>& feedback_vector_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher)
- : NodeMatcher(IrOpcode::kJSLoadGlobal),
- name_matcher_(name_matcher),
- typeof_mode_matcher_(typeof_mode_matcher),
- feedback_vector_matcher_(feedback_vector_matcher),
- effect_matcher_(effect_matcher),
- control_matcher_(control_matcher) {}
-
- void DescribeTo(std::ostream* os) const final {
- NodeMatcher::DescribeTo(os);
- *os << " whose name (";
- name_matcher_.DescribeTo(os);
- *os << "), typeof mode (";
- typeof_mode_matcher_.DescribeTo(os);
- *os << "), feedback vector (";
- feedback_vector_matcher_.DescribeTo(os);
- *os << "), effect (";
- effect_matcher_.DescribeTo(os);
- *os << "), and control (";
- control_matcher_.DescribeTo(os);
- *os << ")";
- }
-
- bool MatchAndExplain(Node* node, MatchResultListener* listener) const final {
- return (NodeMatcher::MatchAndExplain(node, listener) &&
- PrintMatchAndExplain(OpParameter<LoadGlobalParameters>(node).name(),
- "name", name_matcher_, listener) &&
- PrintMatchAndExplain(
- OpParameter<LoadGlobalParameters>(node).typeof_mode(),
- "typeof mode", typeof_mode_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
- "feedback vector", feedback_vector_matcher_,
- listener) &&
- PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
- effect_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetControlInput(node),
- "control", control_matcher_, listener));
- }
-
- private:
- const Matcher<Handle<Name>> name_matcher_;
- const Matcher<TypeofMode> typeof_mode_matcher_;
- const Matcher<Node*> feedback_vector_matcher_;
- const Matcher<Node*> effect_matcher_;
- const Matcher<Node*> control_matcher_;
-};
-
-
-class IsJSStoreGlobalMatcher final : public NodeMatcher {
- public:
- IsJSStoreGlobalMatcher(const Matcher<Handle<Name>>& name_matcher,
- const Matcher<Node*>& value_matcher,
- const Matcher<Node*>& feedback_vector_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher)
- : NodeMatcher(IrOpcode::kJSStoreGlobal),
- name_matcher_(name_matcher),
- value_matcher_(value_matcher),
- feedback_vector_matcher_(feedback_vector_matcher),
- effect_matcher_(effect_matcher),
- control_matcher_(control_matcher) {}
-
- void DescribeTo(std::ostream* os) const final {
- NodeMatcher::DescribeTo(os);
- *os << " whose name (";
- name_matcher_.DescribeTo(os);
- *os << "), value (";
- value_matcher_.DescribeTo(os);
- *os << "), feedback vector (";
- feedback_vector_matcher_.DescribeTo(os);
- *os << "), effect (";
- effect_matcher_.DescribeTo(os);
- *os << "), and control (";
- control_matcher_.DescribeTo(os);
- *os << ")";
- }
-
- bool MatchAndExplain(Node* node, MatchResultListener* listener) const final {
- return (
- NodeMatcher::MatchAndExplain(node, listener) &&
- PrintMatchAndExplain(OpParameter<StoreGlobalParameters>(node).name(),
- "name", name_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "value",
- value_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1),
- "feedback vector", feedback_vector_matcher_,
- listener) &&
- PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
- effect_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetControlInput(node), "control",
- control_matcher_, listener));
- }
-
- private:
- const Matcher<Handle<Name>> name_matcher_;
- const Matcher<Node*> value_matcher_;
- const Matcher<Node*> feedback_vector_matcher_;
- const Matcher<Node*> effect_matcher_;
- const Matcher<Node*> control_matcher_;
-};
-
-
-class IsJSLoadNamedMatcher final : public NodeMatcher {
- public:
- IsJSLoadNamedMatcher(const Matcher<Handle<Name>>& name_matcher,
- const Matcher<Node*>& object_value_matcher,
- const Matcher<Node*>& feedback_vector_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher)
- : NodeMatcher(IrOpcode::kJSLoadNamed),
- name_matcher_(name_matcher),
- object_value_matcher_(object_value_matcher),
- feedback_vector_matcher_(feedback_vector_matcher),
- effect_matcher_(effect_matcher),
- control_matcher_(control_matcher) {}
-
- void DescribeTo(std::ostream* os) const final {
- NodeMatcher::DescribeTo(os);
- *os << " whose object (";
- object_value_matcher_.DescribeTo(os);
- *os << "), name (";
- name_matcher_.DescribeTo(os);
- *os << "), feedback vector (";
- feedback_vector_matcher_.DescribeTo(os);
- *os << "), effect (";
- effect_matcher_.DescribeTo(os);
- *os << "), and control (";
- control_matcher_.DescribeTo(os);
- *os << ")";
- }
-
- bool MatchAndExplain(Node* node, MatchResultListener* listener) const final {
- return (NodeMatcher::MatchAndExplain(node, listener) &&
- PrintMatchAndExplain(OpParameter<NamedAccess>(node).name(), "Name",
- name_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
- "object", object_value_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1),
- "feedback vector", feedback_vector_matcher_,
- listener) &&
- PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
- effect_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetControlInput(node),
- "control", control_matcher_, listener));
- }
-
- private:
- const Matcher<Handle<Name>> name_matcher_;
- const Matcher<Node*> object_value_matcher_;
- const Matcher<Node*> feedback_vector_matcher_;
- const Matcher<Node*> effect_matcher_;
- const Matcher<Node*> control_matcher_;
-};
-
-
-class IsJSLoadPropertyMatcher final : public NodeMatcher {
- public:
- IsJSLoadPropertyMatcher(const Matcher<Node*>& object_matcher,
- const Matcher<Node*>& key_matcher,
- const Matcher<Node*>& feedback_vector_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher)
- : NodeMatcher(IrOpcode::kJSLoadProperty),
- object_matcher_(object_matcher),
- key_matcher_(key_matcher),
- feedback_vector_matcher_(feedback_vector_matcher),
- effect_matcher_(effect_matcher),
- control_matcher_(control_matcher) {}
-
- void DescribeTo(std::ostream* os) const final {
- NodeMatcher::DescribeTo(os);
- *os << " whose object (";
- object_matcher_.DescribeTo(os);
- *os << "), key (";
- key_matcher_.DescribeTo(os);
- *os << "), feedback vector (";
- feedback_vector_matcher_.DescribeTo(os);
- *os << "), effect (";
- effect_matcher_.DescribeTo(os);
- *os << "), and control (";
- control_matcher_.DescribeTo(os);
- *os << ")";
- }
-
- bool MatchAndExplain(Node* node, MatchResultListener* listener) const final {
- return (NodeMatcher::MatchAndExplain(node, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
- "object", object_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1), "key",
- key_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 2),
- "feedback vector", feedback_vector_matcher_,
- listener) &&
- PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
- effect_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetControlInput(node),
- "control", control_matcher_, listener));
- }
-
- private:
- const Matcher<Node*> object_matcher_;
- const Matcher<Node*> key_matcher_;
- const Matcher<Node*> feedback_vector_matcher_;
- const Matcher<Node*> effect_matcher_;
- const Matcher<Node*> control_matcher_;
-};
-
-
-class IsJSStoreNamedMatcher final : public NodeMatcher {
- public:
- IsJSStoreNamedMatcher(const Matcher<Handle<Name>>& name_matcher,
- const Matcher<Node*>& object_matcher,
- const Matcher<Node*>& value_matcher,
- const Matcher<Node*>& feedback_vector_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher)
- : NodeMatcher(IrOpcode::kJSStoreNamed),
- name_matcher_(name_matcher),
- object_matcher_(object_matcher),
- value_matcher_(value_matcher),
- feedback_vector_matcher_(feedback_vector_matcher),
- effect_matcher_(effect_matcher),
- control_matcher_(control_matcher) {}
-
- void DescribeTo(std::ostream* os) const final {
- NodeMatcher::DescribeTo(os);
- *os << " whose object (";
- object_matcher_.DescribeTo(os);
- *os << "), name (";
- name_matcher_.DescribeTo(os);
- *os << "), value (";
- value_matcher_.DescribeTo(os);
- *os << "), feedback vector (";
- feedback_vector_matcher_.DescribeTo(os);
- *os << "), effect (";
- effect_matcher_.DescribeTo(os);
- *os << "), and control (";
- control_matcher_.DescribeTo(os);
- *os << ")";
- }
-
- bool MatchAndExplain(Node* node, MatchResultListener* listener) const final {
- return (NodeMatcher::MatchAndExplain(node, listener) &&
- PrintMatchAndExplain(OpParameter<NamedAccess>(node).name(), "Name",
- name_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
- "object", object_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1),
- "value", value_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 2),
- "feedback vector", feedback_vector_matcher_,
- listener) &&
- PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
- effect_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetControlInput(node),
- "control", control_matcher_, listener));
- }
-
- private:
- const Matcher<Handle<Name>> name_matcher_;
- const Matcher<Node*> object_matcher_;
- const Matcher<Node*> value_matcher_;
- const Matcher<Node*> feedback_vector_matcher_;
- const Matcher<Node*> effect_matcher_;
- const Matcher<Node*> control_matcher_;
-};
-
-
-class IsJSStorePropertyMatcher final : public NodeMatcher {
- public:
- IsJSStorePropertyMatcher(const Matcher<Node*>& object_matcher,
- const Matcher<Node*>& key_matcher,
- const Matcher<Node*>& value_matcher,
- const Matcher<Node*>& feedback_vector_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher)
- : NodeMatcher(IrOpcode::kJSStoreProperty),
- object_matcher_(object_matcher),
- key_matcher_(key_matcher),
- value_matcher_(value_matcher),
- feedback_vector_matcher_(feedback_vector_matcher),
- effect_matcher_(effect_matcher),
- control_matcher_(control_matcher) {}
-
- void DescribeTo(std::ostream* os) const final {
- NodeMatcher::DescribeTo(os);
- *os << " whose object (";
- object_matcher_.DescribeTo(os);
- *os << "), key (";
- key_matcher_.DescribeTo(os);
- *os << "), value (";
- value_matcher_.DescribeTo(os);
- *os << "), feedback vector (";
- feedback_vector_matcher_.DescribeTo(os);
- *os << "), effect (";
- effect_matcher_.DescribeTo(os);
- *os << "), and control (";
- }
-
- bool MatchAndExplain(Node* node, MatchResultListener* listener) const final {
- return (NodeMatcher::MatchAndExplain(node, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
- "object", object_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1), "key",
- key_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 2),
- "value", value_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetValueInput(node, 3),
- "feedback vector", feedback_vector_matcher_,
- listener) &&
- PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
- effect_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetControlInput(node),
- "control", control_matcher_, listener));
- }
-
- private:
- const Matcher<Node*> object_matcher_;
- const Matcher<Node*> key_matcher_;
- const Matcher<Node*> value_matcher_;
- const Matcher<Node*> feedback_vector_matcher_;
- const Matcher<Node*> effect_matcher_;
- const Matcher<Node*> control_matcher_;
-};
-
-
-class IsJSCallMatcher final : public NodeMatcher {
- public:
- IsJSCallMatcher(IrOpcode::Value op_code,
- const std::vector<Matcher<Node*>>& value_matchers,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher)
- : NodeMatcher(op_code),
- value_matchers_(value_matchers),
- effect_matcher_(effect_matcher),
- control_matcher_(control_matcher) {}
-
- void DescribeTo(std::ostream* os) const final {
- NodeMatcher::DescribeTo(os);
- for (size_t i = 0; i < value_matchers_.size(); ++i) {
- if (i == 0) {
- *os << " whose value0 (";
- } else {
- *os << "), value" << i << " (";
- }
- value_matchers_[i].DescribeTo(os);
- }
- *os << "), effect (";
- effect_matcher_.DescribeTo(os);
- *os << ") and control (";
- control_matcher_.DescribeTo(os);
- *os << ")";
- }
-
- bool MatchAndExplain(Node* node, MatchResultListener* listener) const final {
- if (!NodeMatcher::MatchAndExplain(node, listener)) {
- return false;
- }
- for (size_t i = 0; i < value_matchers_.size(); ++i) {
- std::ostringstream ost;
- ost << "value" << i;
- if (!PrintMatchAndExplain(
- NodeProperties::GetValueInput(node, static_cast<int>(i)),
- ost.str(), value_matchers_[i], listener)) {
- return false;
- }
- }
- return (PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
- effect_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetControlInput(node),
- "control", control_matcher_, listener));
- }
-
- private:
- const std::vector<Matcher<Node*>> value_matchers_;
- const Matcher<Node*> effect_matcher_;
- const Matcher<Node*> control_matcher_;
-};
-
} // namespace
@@ -2431,110 +2000,6 @@ Matcher<Node*> IsLoadFramePointer() {
}
-Matcher<Node*> IsJSDeleteProperty(const Matcher<Node*>& object_value_matcher,
- const Matcher<Node*>& key_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher) {
- return MakeMatcher(new IsJSDeletePropertyMatcher(
- object_value_matcher, key_matcher, effect_matcher, control_matcher));
-}
-
-
-Matcher<Node*> IsJSLoadNamed(const Handle<Name> name,
- const Matcher<Node*>& object_value_matcher,
- const Matcher<Node*>& feedback_vector_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher) {
- return MakeMatcher(new IsJSLoadNamedMatcher(name, object_value_matcher,
- feedback_vector_matcher,
- effect_matcher, control_matcher));
-}
-
-
-Matcher<Node*> IsJSLoadGlobal(const Handle<Name> name,
- const TypeofMode typeof_mode,
- const Matcher<Node*>& feedback_vector_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher) {
- return MakeMatcher(
- new IsJSLoadGlobalMatcher(name, typeof_mode, feedback_vector_matcher,
- effect_matcher, control_matcher));
-}
-
-
-Matcher<Node*> IsJSStoreGlobal(const Handle<Name> name,
- const Matcher<Node*>& value_matcher,
- const Matcher<Node*>& feedback_vector_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher) {
- return MakeMatcher(
- new IsJSStoreGlobalMatcher(name, value_matcher, feedback_vector_matcher,
- effect_matcher, control_matcher));
-}
-
-
-Matcher<Node*> IsJSCallConstruct(std::vector<Matcher<Node*>> value_matchers,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher) {
- return MakeMatcher(new IsJSCallMatcher(IrOpcode::kJSCallConstruct,
- value_matchers, effect_matcher,
- control_matcher));
-}
-
-
-Matcher<Node*> IsJSCallFunction(std::vector<Matcher<Node*>> value_matchers,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher) {
- return MakeMatcher(new IsJSCallMatcher(IrOpcode::kJSCallFunction,
- value_matchers, effect_matcher,
- control_matcher));
-}
-
-
-Matcher<Node*> IsJSLoadProperty(const Matcher<Node*>& object_matcher,
- const Matcher<Node*>& key_matcher,
- const Matcher<Node*>& feedback_vector_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher) {
- return MakeMatcher(new IsJSLoadPropertyMatcher(
- object_matcher, key_matcher, feedback_vector_matcher, effect_matcher,
- control_matcher));
-}
-
-
-Matcher<Node*> IsJSStoreNamed(const Handle<Name> name,
- const Matcher<Node*>& object_matcher,
- const Matcher<Node*>& value_matcher,
- const Matcher<Node*>& feedback_vector_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher) {
- return MakeMatcher(new IsJSStoreNamedMatcher(
- _, object_matcher, value_matcher, feedback_vector_matcher, effect_matcher,
- control_matcher));
-}
-
-
-Matcher<Node*> IsJSStoreProperty(const Matcher<Node*>& object_matcher,
- const Matcher<Node*>& key_matcher,
- const Matcher<Node*>& value_matcher,
- const Matcher<Node*>& feedback_vector_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher) {
- return MakeMatcher(new IsJSStorePropertyMatcher(
- object_matcher, key_matcher, value_matcher, feedback_vector_matcher,
- effect_matcher, control_matcher));
-}
-
-
-Matcher<Node*> IsJSCallRuntime(std::vector<Matcher<Node*>> value_matchers,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher) {
- return MakeMatcher(new IsJSCallMatcher(IrOpcode::kJSCallRuntime,
- value_matchers, effect_matcher,
- control_matcher));
-}
-
-
#define IS_BINOP_MATCHER(Name) \
Matcher<Node*> Is##Name(const Matcher<Node*>& lhs_matcher, \
const Matcher<Node*>& rhs_matcher) { \
« no previous file with comments | « test/unittests/compiler/node-test-utils.h ('k') | test/unittests/unittests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698