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

Unified Diff: src/compiler/node-matchers.h

Issue 1779713009: Implement optional turbofan UnalignedLoad and UnalignedStore operators (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Unaligned access simulate using load/shift/or and store/shift/and Created 4 years, 8 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
Index: src/compiler/node-matchers.h
diff --git a/src/compiler/node-matchers.h b/src/compiler/node-matchers.h
index 37d0e1a561b5e0446c976581dea81f242a0b626a..8a98d24c6c9b2793aeeef2d65eb9e6630e727bb1 100644
--- a/src/compiler/node-matchers.h
+++ b/src/compiler/node-matchers.h
@@ -105,6 +105,32 @@ inline ValueMatcher<uint64_t, IrOpcode::kInt64Constant>::ValueMatcher(
}
}
+template <>
+inline ValueMatcher<
+ uint32_t, IrOpcode::kRelocatableInt32Constant>::ValueMatcher(Node* node)
+ : NodeMatcher(node),
+ value_(),
+ has_value_(opcode() == IrOpcode::kInt32Constant ||
+ opcode() == IrOpcode::kRelocatableInt32Constant) {
+ if (has_value_) {
+ value_ = static_cast<uint32_t>(OpParameter<int32_t>(node));
+ }
+}
+
+template <>
+inline ValueMatcher<
+ uint64_t, IrOpcode::kRelocatableInt64Constant>::ValueMatcher(Node* node)
+ : NodeMatcher(node), value_(), has_value_(false) {
+ if (opcode() == IrOpcode::kInt32Constant ||
+ opcode() == IrOpcode::kRelocatableInt32Constant) {
+ value_ = static_cast<uint32_t>(OpParameter<int32_t>(node));
+ has_value_ = true;
+ } else if (opcode() == IrOpcode::kInt64Constant ||
+ opcode() == IrOpcode::kRelocatableInt64Constant) {
+ value_ = static_cast<uint64_t>(OpParameter<int64_t>(node));
+ has_value_ = true;
+ }
+}
// A pattern matcher for integer constants.
template <typename T, IrOpcode::Value kOpcode>
@@ -132,14 +158,20 @@ struct IntMatcher final : public ValueMatcher<T, kOpcode> {
typedef IntMatcher<int32_t, IrOpcode::kInt32Constant> Int32Matcher;
typedef IntMatcher<uint32_t, IrOpcode::kInt32Constant> Uint32Matcher;
+typedef IntMatcher<uint32_t, IrOpcode::kRelocatableInt32Constant>
+ RelocatableInt32Matcher;
typedef IntMatcher<int64_t, IrOpcode::kInt64Constant> Int64Matcher;
typedef IntMatcher<uint64_t, IrOpcode::kInt64Constant> Uint64Matcher;
+typedef IntMatcher<uint64_t, IrOpcode::kRelocatableInt64Constant>
+ RelocatableInt64Matcher;
#if V8_HOST_ARCH_32_BIT
typedef Int32Matcher IntPtrMatcher;
typedef Uint32Matcher UintPtrMatcher;
+typedef RelocatableInt32Matcher PtrMatcher;
#else
typedef Int64Matcher IntPtrMatcher;
typedef Uint64Matcher UintPtrMatcher;
+typedef RelocatableInt64Matcher PtrMatcher;
#endif

Powered by Google App Engine
This is Rietveld 408576698