Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index 8613048f09f3d3f53bb34c4bc6b6a6cda4cb1be2..f41a18e7b1656c4d7d30c4720885e81539473e7b 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -738,15 +738,20 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, |
right = UseFixed(right_value, ecx); |
} |
- // Shift operations can only deoptimize if we do a logical shift by 0 and |
- // the result cannot be truncated to int32. |
- bool may_deopt = (op == Token::SHR && constant_value == 0); |
bool does_deopt = false; |
- if (may_deopt) { |
- for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { |
- if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) { |
- does_deopt = true; |
- break; |
+ if (FLAG_opt_safe_uint32_operations) { |
+ does_deopt = !instr->CheckFlag(HInstruction::kUint32); |
+ } else { |
+ // Shift operations can only deoptimize if we do a logical shift by 0 and |
+ // the result cannot be truncated to int32. |
+ bool may_deopt = (op == Token::SHR && constant_value == 0 && |
+ !instr->CheckFlag(HInstruction::kUint32)); |
+ if (may_deopt) { |
+ for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { |
+ if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) { |
+ does_deopt = true; |
+ break; |
+ } |
} |
} |
} |
@@ -906,7 +911,9 @@ LEnvironment* LChunkBuilder::CreateEnvironment( |
} else { |
op = UseAny(value); |
} |
- result->AddValue(op, value->representation()); |
+ result->AddValue(op, |
+ value->representation(), |
+ value->CheckFlag(HInstruction::kUint32)); |
} |
if (hydrogen_env->frame_type() == JS_FUNCTION) { |
@@ -1698,14 +1705,24 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) { |
LOperand* value = UseRegister(val); |
if (val->HasRange() && val->range()->IsInSmiRange()) { |
return DefineSameAsFirst(new(zone()) LSmiTag(value)); |
+ } else if (val->CheckFlag(HInstruction::kUint32)) { |
+ LOperand* temp = FixedTemp(xmm1); |
+ LNumberTagU* result = new(zone()) LNumberTagU(value, temp); |
+ return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
} else { |
LNumberTagI* result = new(zone()) LNumberTagI(value); |
return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
} |
} else { |
ASSERT(to.IsDouble()); |
- return DefineAsRegister( |
- new(zone()) LInteger32ToDouble(Use(instr->value()))); |
+ if (instr->value()->CheckFlag(HInstruction::kUint32)) { |
+ LOperand* temp = FixedTemp(xmm1); |
+ return DefineAsRegister( |
+ new(zone()) LUint32ToDouble(UseRegister(instr->value()), temp)); |
+ } else { |
+ return DefineAsRegister( |
+ new(zone()) LInteger32ToDouble(Use(instr->value()))); |
+ } |
} |
} |
UNREACHABLE(); |