Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index a198739a4244b420a404fe0483308898ecc2e3bd..a1f3f4ec2a226572f145feb4ebfc7c236d44310f 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -4060,13 +4060,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
SetSourcePosition(expr->position()); |
// Call stub for +1/-1. |
+ __ movq(rdx, rax); |
+ __ Move(rax, Smi::FromInt(1)); |
BinaryOpStub stub(expr->binary_op(), NO_OVERWRITE); |
- if (expr->op() == Token::INC) { |
- __ Move(rdx, Smi::FromInt(1)); |
- } else { |
- __ movq(rdx, rax); |
- __ Move(rax, Smi::FromInt(1)); |
- } |
CallIC(stub.GetCode(), RelocInfo::CODE_TARGET, expr->CountBinOpFeedbackId()); |
patch_site.EmitPatchInfo(); |
__ bind(&done); |
@@ -4285,29 +4281,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
default: { |
VisitForAccumulatorValue(expr->right()); |
- Condition cc = no_condition; |
- switch (op) { |
- case Token::EQ_STRICT: |
- case Token::EQ: |
- cc = equal; |
- break; |
- case Token::LT: |
- cc = less; |
- break; |
- case Token::GT: |
- cc = greater; |
- break; |
- case Token::LTE: |
- cc = less_equal; |
- break; |
- case Token::GTE: |
- cc = greater_equal; |
- break; |
- case Token::IN: |
- case Token::INSTANCEOF: |
- default: |
- UNREACHABLE(); |
- } |
+ Condition cc = CompareIC::ComputeCondition(op); |
__ pop(rdx); |
bool inline_smi_code = ShouldInlineSmiCase(op); |