Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 80e004de556e161c08dc068dde90ceae79f4ace2..84aa7905726108276b57a717c8d10806d48d782a 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -4508,20 +4508,6 @@ void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { |
} |
-void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) { |
- LOperand* input = instr->value(); |
- LOperand* output = instr->result(); |
- ASSERT(output->IsRegister()); |
- if (!instr->hydrogen()->value()->HasRange() || |
- !instr->hydrogen()->value()->range()->IsInSmiRange()) { |
- __ SmiTag(ToRegister(output), ToRegister(input), SetCC); |
- DeoptimizeIf(vs, instr->environment()); |
- } else { |
- __ SmiTag(ToRegister(output), ToRegister(input)); |
- } |
-} |
- |
- |
void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
LOperand* input = instr->value(); |
LOperand* output = instr->result(); |
@@ -4532,18 +4518,6 @@ void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
} |
-void LCodeGen::DoUint32ToSmi(LUint32ToSmi* instr) { |
- LOperand* input = instr->value(); |
- LOperand* output = instr->result(); |
- if (!instr->hydrogen()->value()->HasRange() || |
- !instr->hydrogen()->value()->range()->IsInSmiRange()) { |
- __ tst(ToRegister(input), Operand(0xc0000000)); |
- DeoptimizeIf(ne, instr->environment()); |
- } |
- __ SmiTag(ToRegister(output), ToRegister(input)); |
-} |
- |
- |
void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
class DeferredNumberTagI V8_FINAL : public LDeferredCode { |
public: |
@@ -4723,8 +4697,21 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
void LCodeGen::DoSmiTag(LSmiTag* instr) { |
- ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); |
- __ SmiTag(ToRegister(instr->result()), ToRegister(instr->value())); |
+ HChange* hchange = instr->hydrogen(); |
+ Register input = ToRegister(instr->value()); |
+ Register output = ToRegister(instr->result()); |
+ if (hchange->CheckFlag(HValue::kCanOverflow) && |
+ hchange->value()->CheckFlag(HValue::kUint32)) { |
+ __ tst(input, Operand(0xc0000000)); |
+ DeoptimizeIf(ne, instr->environment()); |
+ } |
+ if (hchange->CheckFlag(HValue::kCanOverflow) && |
+ !hchange->value()->CheckFlag(HValue::kUint32)) { |
+ __ SmiTag(output, input, SetCC); |
+ DeoptimizeIf(vs, instr->environment()); |
+ } else { |
+ __ SmiTag(output, input); |
+ } |
} |