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

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

Issue 795353008: Fix x64 regression during ia32 lea port (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup Created 6 years 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 | « no previous file | test/unittests/compiler/node-matchers-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/node-matchers.h
diff --git a/src/compiler/node-matchers.h b/src/compiler/node-matchers.h
index a59b8b3349f592a6a50a3fbf0e36a7fcd3b64a35..7cbd1c5e65bf445383c53572ce75e8b308663d26 100644
--- a/src/compiler/node-matchers.h
+++ b/src/compiler/node-matchers.h
@@ -39,10 +39,9 @@ struct NodeMatcher {
// A pattern matcher for abitrary value constants.
-template <typename T, IrOpcode::Value kMatchOpcode>
+template <typename T, IrOpcode::Value kOpcode>
struct ValueMatcher : public NodeMatcher {
typedef T ValueType;
- static const IrOpcode::Value kOpcode = kMatchOpcode;
explicit ValueMatcher(Node* node)
: NodeMatcher(node), value_(), has_value_(opcode() == kOpcode) {
@@ -71,6 +70,33 @@ struct ValueMatcher : public NodeMatcher {
};
+template <>
+inline ValueMatcher<int64_t, IrOpcode::kInt64Constant>::ValueMatcher(Node* node)
+ : NodeMatcher(node), value_(), has_value_(false) {
+ if (opcode() == IrOpcode::kInt32Constant) {
+ value_ = OpParameter<int32_t>(node);
+ has_value_ = true;
+ } else if (opcode() == IrOpcode::kInt64Constant) {
+ value_ = OpParameter<int64_t>(node);
+ has_value_ = true;
+ }
+}
+
+
+template <>
+inline ValueMatcher<uint64_t, IrOpcode::kInt64Constant>::ValueMatcher(
+ Node* node)
+ : NodeMatcher(node), value_(), has_value_(false) {
+ if (opcode() == IrOpcode::kInt32Constant) {
+ value_ = OpParameter<uint32_t>(node);
+ has_value_ = true;
+ } else if (opcode() == IrOpcode::kInt64Constant) {
+ value_ = OpParameter<uint64_t>(node);
+ has_value_ = true;
+ }
+}
+
+
// A pattern matcher for integer constants.
template <typename T, IrOpcode::Value kOpcode>
struct IntMatcher FINAL : public ValueMatcher<T, kOpcode> {
« no previous file with comments | « no previous file | test/unittests/compiler/node-matchers-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698