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

Unified Diff: src/compiler/operator.h

Issue 1314473007: [turbofan] Remove usage of Unique<T> from graph. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased and fixed. Created 5 years, 4 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/node-matchers.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/operator.h
diff --git a/src/compiler/operator.h b/src/compiler/operator.h
index 5b15b9728916dc76aaeea209e0cdefcdf6e511f4..0cd0aaf1c2ce1e8389ad2b8512d60830e3935812 100644
--- a/src/compiler/operator.h
+++ b/src/compiler/operator.h
@@ -9,6 +9,7 @@
#include "src/base/flags.h"
#include "src/base/functional.h"
+#include "src/handles.h"
#include "src/zone.h"
namespace v8 {
@@ -155,7 +156,8 @@ class Operator1 : public Operator {
bool Equals(const Operator* other) const final {
if (opcode() != other->opcode()) return false;
- const Operator1<T>* that = reinterpret_cast<const Operator1<T>*>(other);
+ const Operator1<T, Pred, Hash>* that =
+ reinterpret_cast<const Operator1<T, Pred, Hash>*>(other);
return this->pred_(this->parameter(), that->parameter());
}
size_t HashCode() const final {
@@ -185,7 +187,8 @@ inline T const& OpParameter(const Operator* op) {
}
// NOTE: We have to be careful to use the right equal/hash functions below, for
-// float/double we always use the ones operating on the bit level.
+// float/double we always use the ones operating on the bit level, for Handle<>
+// we always use the ones operating on the location level.
template <>
inline float const& OpParameter(const Operator* op) {
return reinterpret_cast<const Operator1<float, base::bit_equal_to<float>,
@@ -200,6 +203,20 @@ inline double const& OpParameter(const Operator* op) {
->parameter();
}
+template <>
+inline Handle<HeapObject> const& OpParameter(const Operator* op) {
+ return reinterpret_cast<
+ const Operator1<Handle<HeapObject>, Handle<HeapObject>::equal_to,
+ Handle<HeapObject>::hash>*>(op)->parameter();
+}
+
+template <>
+inline Handle<String> const& OpParameter(const Operator* op) {
+ return reinterpret_cast<const Operator1<
+ Handle<String>, Handle<String>::equal_to, Handle<String>::hash>*>(op)
+ ->parameter();
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/node-matchers.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698