Index: src/compiler/arm/instruction-selector-arm.cc |
diff --git a/src/compiler/arm/instruction-selector-arm.cc b/src/compiler/arm/instruction-selector-arm.cc |
index bdfb7838b99244d70a7754dfbeca21ce5cae72f1..cde0fe78afa5db6deb116b40f06eb8e3d14e7efe 100644 |
--- a/src/compiler/arm/instruction-selector-arm.cc |
+++ b/src/compiler/arm/instruction-selector-arm.cc |
@@ -24,15 +24,9 @@ class ArmOperandGenerator FINAL : public OperandGenerator { |
} |
bool CanBeImmediate(Node* node, InstructionCode opcode) { |
- int32_t value; |
- switch (node->opcode()) { |
- case IrOpcode::kInt32Constant: |
- case IrOpcode::kNumberConstant: |
- value = ValueOf<int32_t>(node->op()); |
- break; |
- default: |
- return false; |
- } |
+ Int32Matcher m(node); |
+ if (!m.HasValue()) return false; |
+ int32_t value = m.Value(); |
switch (ArchOpcodeField::decode(opcode)) { |
case kArmAnd: |
case kArmMov: |