| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 8 | 8 |
| 9 #include "ia32/lithium-codegen-ia32.h" | 9 #include "ia32/lithium-codegen-ia32.h" |
| 10 #include "ic.h" | 10 #include "ic.h" |
| (...skipping 4341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4352 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 4352 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
| 4353 __ mov(operand, Immediate(ToInteger32(operand_value))); | 4353 __ mov(operand, Immediate(ToInteger32(operand_value))); |
| 4354 } else { | 4354 } else { |
| 4355 Register value = ToRegister(instr->value()); | 4355 Register value = ToRegister(instr->value()); |
| 4356 __ Store(value, operand, representation); | 4356 __ Store(value, operand, representation); |
| 4357 } | 4357 } |
| 4358 return; | 4358 return; |
| 4359 } | 4359 } |
| 4360 | 4360 |
| 4361 Register object = ToRegister(instr->object()); | 4361 Register object = ToRegister(instr->object()); |
| 4362 SmiCheck check_needed = | 4362 __ AssertNotSmi(object); |
| 4363 instr->hydrogen()->value()->IsHeapObject() | |
| 4364 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | |
| 4365 | 4363 |
| 4366 ASSERT(!(representation.IsSmi() && | 4364 ASSERT(!representation.IsSmi() || |
| 4367 instr->value()->IsConstantOperand() && | 4365 !instr->value()->IsConstantOperand() || |
| 4368 !IsSmi(LConstantOperand::cast(instr->value())))); | 4366 IsSmi(LConstantOperand::cast(instr->value()))); |
| 4369 if (representation.IsHeapObject()) { | 4367 if (representation.IsDouble()) { |
| 4370 if (instr->value()->IsConstantOperand()) { | |
| 4371 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | |
| 4372 if (chunk_->LookupConstant(operand_value)->HasSmiValue()) { | |
| 4373 DeoptimizeIf(no_condition, instr->environment()); | |
| 4374 } | |
| 4375 } else { | |
| 4376 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | |
| 4377 Register value = ToRegister(instr->value()); | |
| 4378 __ test(value, Immediate(kSmiTagMask)); | |
| 4379 DeoptimizeIf(zero, instr->environment()); | |
| 4380 | |
| 4381 // We know now that value is not a smi, so we can omit the check below. | |
| 4382 check_needed = OMIT_SMI_CHECK; | |
| 4383 } | |
| 4384 } | |
| 4385 } else if (representation.IsDouble()) { | |
| 4386 ASSERT(access.IsInobject()); | 4368 ASSERT(access.IsInobject()); |
| 4387 ASSERT(!instr->hydrogen()->has_transition()); | 4369 ASSERT(!instr->hydrogen()->has_transition()); |
| 4388 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4370 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
| 4389 if (CpuFeatures::IsSupported(SSE2)) { | 4371 if (CpuFeatures::IsSupported(SSE2)) { |
| 4390 CpuFeatureScope scope(masm(), SSE2); | 4372 CpuFeatureScope scope(masm(), SSE2); |
| 4391 XMMRegister value = ToDoubleRegister(instr->value()); | 4373 XMMRegister value = ToDoubleRegister(instr->value()); |
| 4392 __ movsd(FieldOperand(object, offset), value); | 4374 __ movsd(FieldOperand(object, offset), value); |
| 4393 } else { | 4375 } else { |
| 4394 X87Register value = ToX87Register(instr->value()); | 4376 X87Register value = ToX87Register(instr->value()); |
| 4395 X87Mov(FieldOperand(object, offset), value); | 4377 X87Mov(FieldOperand(object, offset), value); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4448 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4430 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 4449 Register value = ToRegister(instr->value()); | 4431 Register value = ToRegister(instr->value()); |
| 4450 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; | 4432 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; |
| 4451 // Update the write barrier for the object for in-object properties. | 4433 // Update the write barrier for the object for in-object properties. |
| 4452 __ RecordWriteField(write_register, | 4434 __ RecordWriteField(write_register, |
| 4453 offset, | 4435 offset, |
| 4454 value, | 4436 value, |
| 4455 temp, | 4437 temp, |
| 4456 GetSaveFPRegsMode(isolate()), | 4438 GetSaveFPRegsMode(isolate()), |
| 4457 EMIT_REMEMBERED_SET, | 4439 EMIT_REMEMBERED_SET, |
| 4458 check_needed); | 4440 instr->hydrogen()->SmiCheckForWriteBarrier()); |
| 4459 } | 4441 } |
| 4460 } | 4442 } |
| 4461 | 4443 |
| 4462 | 4444 |
| 4463 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4445 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
| 4464 ASSERT(ToRegister(instr->context()).is(esi)); | 4446 ASSERT(ToRegister(instr->context()).is(esi)); |
| 4465 ASSERT(ToRegister(instr->object()).is(edx)); | 4447 ASSERT(ToRegister(instr->object()).is(edx)); |
| 4466 ASSERT(ToRegister(instr->value()).is(eax)); | 4448 ASSERT(ToRegister(instr->value()).is(eax)); |
| 4467 | 4449 |
| 4468 __ mov(ecx, instr->name()); | 4450 __ mov(ecx, instr->name()); |
| (...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6424 __ bind(deferred->exit()); | 6406 __ bind(deferred->exit()); |
| 6425 __ bind(&done); | 6407 __ bind(&done); |
| 6426 } | 6408 } |
| 6427 | 6409 |
| 6428 | 6410 |
| 6429 #undef __ | 6411 #undef __ |
| 6430 | 6412 |
| 6431 } } // namespace v8::internal | 6413 } } // namespace v8::internal |
| 6432 | 6414 |
| 6433 #endif // V8_TARGET_ARCH_IA32 | 6415 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |