Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 3ddad068bfdfc0454442a87e3fd964269d5e6298..d022a82f4df540d5078dcdebc184eb3bba1566fd 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -685,13 +685,6 @@ double LCodeGen::ToDouble(LConstantOperand* op) const { |
} |
-ExternalReference LCodeGen::ToExternalReference(LConstantOperand* op) const { |
- HConstant* constant = chunk_->LookupConstant(op); |
- ASSERT(constant->HasExternalReferenceValue()); |
- return constant->ExternalReferenceValue(); |
-} |
- |
- |
bool LCodeGen::IsInteger32(LConstantOperand* op) const { |
return chunk_->LookupLiteralRepresentation(op).IsSmiOrInteger32(); |
} |
@@ -1769,14 +1762,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) { |
break; |
case Token::SHL: |
if (shift_count != 0) { |
- if (instr->hydrogen_value()->representation().IsSmi() && |
- instr->can_deopt()) { |
- __ shl(ToRegister(left), shift_count - 1); |
- __ SmiTag(ToRegister(left)); |
- DeoptimizeIf(overflow, instr->environment()); |
- } else { |
- __ shl(ToRegister(left), shift_count); |
- } |
+ __ shl(ToRegister(left), shift_count); |
} |
break; |
default: |
@@ -1860,11 +1846,6 @@ void LCodeGen::DoConstantD(LConstantD* instr) { |
} |
-void LCodeGen::DoConstantE(LConstantE* instr) { |
- __ lea(ToRegister(instr->result()), Operand::StaticVariable(instr->value())); |
-} |
- |
- |
void LCodeGen::DoConstantT(LConstantT* instr) { |
Register reg = ToRegister(instr->result()); |
Handle<Object> handle = instr->value(); |
@@ -3061,19 +3042,6 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
HObjectAccess access = instr->hydrogen()->access(); |
int offset = access.offset(); |
- |
- if (access.IsExternalMemory()) { |
- Register result = ToRegister(instr->result()); |
- if (instr->object()->IsConstantOperand()) { |
- ExternalReference external_reference = ToExternalReference( |
- LConstantOperand::cast(instr->object())); |
- __ mov(result, MemOperand::StaticVariable(external_reference)); |
- } else { |
- __ mov(result, MemOperand(ToRegister(instr->object()), offset)); |
- } |
- return; |
- } |
- |
Register object = ToRegister(instr->object()); |
if (FLAG_track_double_fields && |
instr->hydrogen()->representation().IsDouble()) { |
@@ -4353,25 +4321,10 @@ void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { |
void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
Representation representation = instr->representation(); |
+ Register object = ToRegister(instr->object()); |
HObjectAccess access = instr->hydrogen()->access(); |
int offset = access.offset(); |
- if (access.IsExternalMemory()) { |
- MemOperand operand = instr->object()->IsConstantOperand() |
- ? MemOperand::StaticVariable( |
- ToExternalReference(LConstantOperand::cast(instr->object()))) |
- : MemOperand(ToRegister(instr->object()), offset); |
- if (instr->value()->IsConstantOperand()) { |
- LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
- __ mov(operand, Immediate(ToInteger32(operand_value))); |
- } else { |
- Register value = ToRegister(instr->value()); |
- __ mov(operand, value); |
- } |
- return; |
- } |
- |
- Register object = ToRegister(instr->object()); |
Handle<Map> transition = instr->transition(); |
if (FLAG_track_fields && representation.IsSmi()) { |
@@ -4436,7 +4389,8 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
Register write_register = object; |
if (!access.IsInobject()) { |
write_register = ToRegister(instr->temp()); |
- __ mov(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); |
+ __ mov(write_register, |
+ FieldOperand(object, JSObject::kPropertiesOffset)); |
} |
if (instr->value()->IsConstantOperand()) { |
@@ -4754,7 +4708,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
__ RecordWriteForMap(object_reg, to_map, new_map_reg, |
ToRegister(instr->temp()), |
kDontSaveFPRegs); |
- } else { |
+ } else if (FLAG_compiled_transitions) { |
PushSafepointRegistersScope scope(this); |
if (!object_reg.is(eax)) { |
__ push(object_reg); |
@@ -4768,6 +4722,28 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
__ CallStub(&stub); |
RecordSafepointWithRegisters( |
instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
+ } else if (IsFastSmiElementsKind(from_kind) && |
+ IsFastDoubleElementsKind(to_kind)) { |
+ Register new_map_reg = ToRegister(instr->new_map_temp()); |
+ __ mov(new_map_reg, to_map); |
+ Register fixed_object_reg = ToRegister(instr->temp()); |
+ ASSERT(fixed_object_reg.is(edx)); |
+ ASSERT(new_map_reg.is(ebx)); |
+ __ mov(fixed_object_reg, object_reg); |
+ CallCode(isolate()->builtins()->TransitionElementsSmiToDouble(), |
+ RelocInfo::CODE_TARGET, instr); |
+ } else if (IsFastDoubleElementsKind(from_kind) && |
+ IsFastObjectElementsKind(to_kind)) { |
+ Register new_map_reg = ToRegister(instr->new_map_temp()); |
+ __ mov(new_map_reg, to_map); |
+ Register fixed_object_reg = ToRegister(instr->temp()); |
+ ASSERT(fixed_object_reg.is(edx)); |
+ ASSERT(new_map_reg.is(ebx)); |
+ __ mov(fixed_object_reg, object_reg); |
+ CallCode(isolate()->builtins()->TransitionElementsDoubleToObject(), |
+ RelocInfo::CODE_TARGET, instr); |
+ } else { |
+ UNREACHABLE(); |
} |
__ bind(¬_applicable); |
} |