Index: src/compiler/simplified-operator.cc |
diff --git a/src/compiler/simplified-operator.cc b/src/compiler/simplified-operator.cc |
index d486eb876b975df2d99a6ec19485582aa545e36e..fc1d464323d1f9c499c7d32dd4a18535f9671136 100644 |
--- a/src/compiler/simplified-operator.cc |
+++ b/src/compiler/simplified-operator.cc |
@@ -4,8 +4,6 @@ |
#include "src/compiler/simplified-operator.h" |
-#include <ostream> // NOLINT(readability/streams) |
- |
#include "src/base/lazy-instance.h" |
#include "src/compiler/opcodes.h" |
#include "src/compiler/operator.h" |
@@ -29,7 +27,7 @@ std::ostream& operator<<(std::ostream& os, BaseTaggedness base_taggedness) { |
bool operator==(FieldAccess const& lhs, FieldAccess const& rhs) { |
return lhs.base_is_tagged == rhs.base_is_tagged && lhs.offset == rhs.offset && |
- lhs.type == rhs.type && lhs.machine_type == rhs.machine_type; |
+ lhs.machine_type == rhs.machine_type; |
} |
@@ -38,6 +36,12 @@ bool operator!=(FieldAccess const& lhs, FieldAccess const& rhs) { |
} |
+size_t hash_value(FieldAccess const& access) { |
+ return base::hash_combine(access.base_is_tagged, access.offset, |
+ access.machine_type); |
+} |
+ |
+ |
std::ostream& operator<<(std::ostream& os, FieldAccess const& access) { |
os << "[" << access.base_is_tagged << ", " << access.offset << ", "; |
#ifdef OBJECT_PRINT |
@@ -67,7 +71,7 @@ std::ostream& operator<<(std::ostream& os, BoundsCheckMode bounds_check_mode) { |
bool operator==(ElementAccess const& lhs, ElementAccess const& rhs) { |
return lhs.base_is_tagged == rhs.base_is_tagged && |
- lhs.header_size == rhs.header_size && lhs.type == rhs.type && |
+ lhs.header_size == rhs.header_size && |
lhs.machine_type == rhs.machine_type; |
} |
@@ -77,10 +81,16 @@ bool operator!=(ElementAccess const& lhs, ElementAccess const& rhs) { |
} |
+size_t hash_value(ElementAccess const& access) { |
+ return base::hash_combine(access.base_is_tagged, access.header_size, |
+ access.machine_type); |
+} |
+ |
+ |
std::ostream& operator<<(std::ostream& os, ElementAccess const& access) { |
- os << "[" << access.base_is_tagged << ", " << access.header_size << ", "; |
+ os << access.base_is_tagged << ", " << access.header_size << ", "; |
access.type->PrintTo(os); |
- os << ", " << access.machine_type << ", " << access.bounds_check << "]"; |
+ os << ", " << access.machine_type << ", " << access.bounds_check; |
return os; |
} |
@@ -101,40 +111,6 @@ const ElementAccess& ElementAccessOf(const Operator* op) { |
} |
-// Specialization for static parameters of type {FieldAccess}. |
-template <> |
-struct StaticParameterTraits<FieldAccess> { |
- static std::ostream& PrintTo(std::ostream& os, const FieldAccess& val) { |
- return os << val.offset; |
- } |
- static int HashCode(const FieldAccess& val) { |
- return (val.offset < 16) | (val.machine_type & 0xffff); |
- } |
- static bool Equals(const FieldAccess& lhs, const FieldAccess& rhs) { |
- return lhs.base_is_tagged == rhs.base_is_tagged && |
- lhs.offset == rhs.offset && lhs.machine_type == rhs.machine_type && |
- lhs.type->Is(rhs.type); |
- } |
-}; |
- |
- |
-// Specialization for static parameters of type {ElementAccess}. |
-template <> |
-struct StaticParameterTraits<ElementAccess> { |
- static std::ostream& PrintTo(std::ostream& os, const ElementAccess& access) { |
- return os << access; |
- } |
- static int HashCode(const ElementAccess& access) { |
- return (access.header_size < 16) | (access.machine_type & 0xffff); |
- } |
- static bool Equals(const ElementAccess& lhs, const ElementAccess& rhs) { |
- return lhs.base_is_tagged == rhs.base_is_tagged && |
- lhs.header_size == rhs.header_size && |
- lhs.machine_type == rhs.machine_type && lhs.type->Is(rhs.type); |
- } |
-}; |
- |
- |
#define PURE_OP_LIST(V) \ |
V(BooleanNot, Operator::kNoProperties, 1) \ |
V(BooleanToNumber, Operator::kNoProperties, 1) \ |