| 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> {
|
|
|