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

Unified Diff: src/compiler/js-operator.h

Issue 1418993002: [turbofan] Unify NamedAccess and PropertyAccess operator parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | « src/compiler/js-native-context-specialization.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-operator.h
diff --git a/src/compiler/js-operator.h b/src/compiler/js-operator.h
index 172b584b43f509d2b7a8b438fdd574a2bf4b3128..e700c7218be4df240f5b1d19c78d700129921a3c 100644
--- a/src/compiler/js-operator.h
+++ b/src/compiler/js-operator.h
@@ -228,33 +228,32 @@ std::ostream& operator<<(std::ostream&, DynamicContextAccess const&);
DynamicContextAccess const& DynamicContextAccessOf(Operator const*);
-// Defines the property being loaded from an object by a named load. This is
-// used as a parameter by JSLoadNamed operators.
-class LoadNamedParameters final {
+// Defines the property of an object for a named access. This is
+// used as a parameter by the JSLoadNamed and JSStoreNamed operators.
+class NamedAccess final {
public:
- LoadNamedParameters(const Handle<Name>& name, const VectorSlotPair& feedback,
- LanguageMode language_mode)
+ NamedAccess(LanguageMode language_mode, Handle<Name> name,
+ VectorSlotPair const& feedback)
: name_(name), feedback_(feedback), language_mode_(language_mode) {}
- const Handle<Name>& name() const { return name_; }
+ Handle<Name> name() const { return name_; }
LanguageMode language_mode() const { return language_mode_; }
-
- const VectorSlotPair& feedback() const { return feedback_; }
+ VectorSlotPair const& feedback() const { return feedback_; }
private:
- const Handle<Name> name_;
- const VectorSlotPair feedback_;
- const LanguageMode language_mode_;
+ Handle<Name> const name_;
+ VectorSlotPair const feedback_;
+ LanguageMode const language_mode_;
};
-bool operator==(LoadNamedParameters const&, LoadNamedParameters const&);
-bool operator!=(LoadNamedParameters const&, LoadNamedParameters const&);
+bool operator==(NamedAccess const&, NamedAccess const&);
+bool operator!=(NamedAccess const&, NamedAccess const&);
-size_t hash_value(LoadNamedParameters const&);
+size_t hash_value(NamedAccess const&);
-std::ostream& operator<<(std::ostream&, LoadNamedParameters const&);
+std::ostream& operator<<(std::ostream&, NamedAccess const&);
-const LoadNamedParameters& LoadNamedParametersOf(const Operator* op);
+const NamedAccess& NamedAccessOf(const Operator* op);
// Defines the property being loaded from an object by a named load. This is
@@ -326,85 +325,29 @@ std::ostream& operator<<(std::ostream&, StoreGlobalParameters const&);
const StoreGlobalParameters& StoreGlobalParametersOf(const Operator* op);
-// Defines the property being loaded from an object. This is
-// used as a parameter by JSLoadProperty operators.
-class LoadPropertyParameters final {
+// Defines the property of an object for a keyed access. This is used
+// as a parameter by the JSLoadProperty and JSStoreProperty operators.
+class PropertyAccess final {
public:
- explicit LoadPropertyParameters(const VectorSlotPair& feedback,
- LanguageMode language_mode)
+ PropertyAccess(LanguageMode language_mode, VectorSlotPair const& feedback)
: feedback_(feedback), language_mode_(language_mode) {}
- const VectorSlotPair& feedback() const { return feedback_; }
-
- LanguageMode language_mode() const { return language_mode_; }
-
- private:
- const VectorSlotPair feedback_;
- const LanguageMode language_mode_;
-};
-
-bool operator==(LoadPropertyParameters const&, LoadPropertyParameters const&);
-bool operator!=(LoadPropertyParameters const&, LoadPropertyParameters const&);
-
-size_t hash_value(LoadPropertyParameters const&);
-
-std::ostream& operator<<(std::ostream&, LoadPropertyParameters const&);
-
-const LoadPropertyParameters& LoadPropertyParametersOf(const Operator* op);
-
-
-// Defines the property being stored to an object by a named store. This is
-// used as a parameter by JSStoreNamed operator.
-class StoreNamedParameters final {
- public:
- StoreNamedParameters(LanguageMode language_mode,
- const VectorSlotPair& feedback, const Handle<Name>& name)
- : language_mode_(language_mode), name_(name), feedback_(feedback) {}
-
LanguageMode language_mode() const { return language_mode_; }
- const VectorSlotPair& feedback() const { return feedback_; }
- const Handle<Name>& name() const { return name_; }
-
- private:
- const LanguageMode language_mode_;
- const Handle<Name> name_;
- const VectorSlotPair feedback_;
-};
-
-bool operator==(StoreNamedParameters const&, StoreNamedParameters const&);
-bool operator!=(StoreNamedParameters const&, StoreNamedParameters const&);
-
-size_t hash_value(StoreNamedParameters const&);
-
-std::ostream& operator<<(std::ostream&, StoreNamedParameters const&);
-
-const StoreNamedParameters& StoreNamedParametersOf(const Operator* op);
-
-
-// Defines the property being stored to an object. This is used as a parameter
-// by JSStoreProperty operators.
-class StorePropertyParameters final {
- public:
- StorePropertyParameters(LanguageMode language_mode,
- const VectorSlotPair& feedback)
- : language_mode_(language_mode), feedback_(feedback) {}
-
- LanguageMode language_mode() const { return language_mode_; }
- const VectorSlotPair& feedback() const { return feedback_; }
+ VectorSlotPair const& feedback() const { return feedback_; }
private:
- const LanguageMode language_mode_;
- const VectorSlotPair feedback_;
+ VectorSlotPair const feedback_;
+ LanguageMode const language_mode_;
};
-bool operator==(StorePropertyParameters const&, StorePropertyParameters const&);
-bool operator!=(StorePropertyParameters const&, StorePropertyParameters const&);
+bool operator==(PropertyAccess const&, PropertyAccess const&);
+bool operator!=(PropertyAccess const&, PropertyAccess const&);
-size_t hash_value(StorePropertyParameters const&);
+size_t hash_value(PropertyAccess const&);
-std::ostream& operator<<(std::ostream&, StorePropertyParameters const&);
+std::ostream& operator<<(std::ostream&, PropertyAccess const&);
-const StorePropertyParameters& StorePropertyParametersOf(const Operator* op);
+PropertyAccess const& PropertyAccessOf(const Operator* op);
// Defines specifics about arguments object or rest parameter creation. This is
@@ -513,17 +456,15 @@ class JSOperatorBuilder final : public ZoneObject {
const Operator* CallConstruct(int arguments);
- const Operator* LoadProperty(const VectorSlotPair& feedback,
- LanguageMode language_mode);
- const Operator* LoadNamed(const Handle<Name>& name,
- const VectorSlotPair& feedback,
- LanguageMode language_mode);
+ const Operator* LoadProperty(LanguageMode language_mode,
+ VectorSlotPair const& feedback);
+ const Operator* LoadNamed(LanguageMode language_mode, Handle<Name> name,
+ VectorSlotPair const& feedback);
const Operator* StoreProperty(LanguageMode language_mode,
- const VectorSlotPair& feedback);
- const Operator* StoreNamed(LanguageMode language_mode,
- const Handle<Name>& name,
- const VectorSlotPair& feedback);
+ VectorSlotPair const& feedback);
+ const Operator* StoreNamed(LanguageMode language_mode, Handle<Name> name,
+ VectorSlotPair const& feedback);
const Operator* DeleteProperty(LanguageMode language_mode);
« no previous file with comments | « src/compiler/js-native-context-specialization.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698