Index: src/a64/lithium-codegen-a64.cc |
diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc |
index e250f5a908e8f69825bdefbeddcecf9631e400e2..f2906e3eb56aa6ac91d89321656e93b1be1e0f50 100644 |
--- a/src/a64/lithium-codegen-a64.cc |
+++ b/src/a64/lithium-codegen-a64.cc |
@@ -3095,17 +3095,6 @@ void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { |
} |
-void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) { |
- // A64 smis can represent all Integer32 values, so this cannot deoptimize. |
- ASSERT(!instr->hydrogen()->value()->HasRange() || |
- instr->hydrogen()->value()->range()->IsInSmiRange()); |
- |
- Register value = ToRegister32(instr->value()); |
- Register result = ToRegister(instr->result()); |
- __ SmiTag(result, value.X()); |
-} |
- |
- |
void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
ASSERT(ToRegister(instr->context()).is(cp)); |
// The function is required to be in x1. |
@@ -4704,8 +4693,14 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* 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)) { |
+ DeoptimizeIfNegative(input.W(), instr->environment()); |
+ } |
+ __ SmiTag(output, input); |
} |
@@ -5737,21 +5732,6 @@ void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
} |
-void LCodeGen::DoUint32ToSmi(LUint32ToSmi* instr) { |
- Register value = ToRegister(instr->value()); |
- Register result = ToRegister(instr->result()); |
- |
- if (!instr->hydrogen()->value()->HasRange() || |
- !instr->hydrogen()->value()->range()->IsInSmiRange() || |
- instr->hydrogen()->value()->range()->upper() == kMaxInt) { |
- // The Range class can't express upper bounds in the (kMaxInt, kMaxUint32] |
- // interval, so we treat kMaxInt as a sentinel for this entire interval. |
- DeoptimizeIfNegative(value.W(), instr->environment()); |
- } |
- __ SmiTag(result, value); |
-} |
- |
- |
void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) { |
Register object = ToRegister(instr->value()); |
Register map = ToRegister(instr->map()); |