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 __ AssertNotSmi(object); | 4362 SmiCheck check_needed = |
| 4363 instr->hydrogen()->value()->IsHeapObject() |
| 4364 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
4363 | 4365 |
4364 ASSERT(!representation.IsSmi() || | 4366 ASSERT(!(representation.IsSmi() && |
4365 !instr->value()->IsConstantOperand() || | 4367 instr->value()->IsConstantOperand() && |
4366 IsSmi(LConstantOperand::cast(instr->value()))); | 4368 !IsSmi(LConstantOperand::cast(instr->value())))); |
4367 if (representation.IsDouble()) { | 4369 if (representation.IsHeapObject()) { |
| 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()) { |
4368 ASSERT(access.IsInobject()); | 4386 ASSERT(access.IsInobject()); |
4369 ASSERT(!instr->hydrogen()->has_transition()); | 4387 ASSERT(!instr->hydrogen()->has_transition()); |
4370 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4388 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4371 if (CpuFeatures::IsSupported(SSE2)) { | 4389 if (CpuFeatures::IsSupported(SSE2)) { |
4372 CpuFeatureScope scope(masm(), SSE2); | 4390 CpuFeatureScope scope(masm(), SSE2); |
4373 XMMRegister value = ToDoubleRegister(instr->value()); | 4391 XMMRegister value = ToDoubleRegister(instr->value()); |
4374 __ movsd(FieldOperand(object, offset), value); | 4392 __ movsd(FieldOperand(object, offset), value); |
4375 } else { | 4393 } else { |
4376 X87Register value = ToX87Register(instr->value()); | 4394 X87Register value = ToX87Register(instr->value()); |
4377 X87Mov(FieldOperand(object, offset), value); | 4395 X87Mov(FieldOperand(object, offset), value); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4430 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4448 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4431 Register value = ToRegister(instr->value()); | 4449 Register value = ToRegister(instr->value()); |
4432 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; | 4450 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; |
4433 // Update the write barrier for the object for in-object properties. | 4451 // Update the write barrier for the object for in-object properties. |
4434 __ RecordWriteField(write_register, | 4452 __ RecordWriteField(write_register, |
4435 offset, | 4453 offset, |
4436 value, | 4454 value, |
4437 temp, | 4455 temp, |
4438 GetSaveFPRegsMode(isolate()), | 4456 GetSaveFPRegsMode(isolate()), |
4439 EMIT_REMEMBERED_SET, | 4457 EMIT_REMEMBERED_SET, |
4440 instr->hydrogen()->SmiCheckForWriteBarrier()); | 4458 check_needed); |
4441 } | 4459 } |
4442 } | 4460 } |
4443 | 4461 |
4444 | 4462 |
4445 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4463 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4446 ASSERT(ToRegister(instr->context()).is(esi)); | 4464 ASSERT(ToRegister(instr->context()).is(esi)); |
4447 ASSERT(ToRegister(instr->object()).is(edx)); | 4465 ASSERT(ToRegister(instr->object()).is(edx)); |
4448 ASSERT(ToRegister(instr->value()).is(eax)); | 4466 ASSERT(ToRegister(instr->value()).is(eax)); |
4449 | 4467 |
4450 __ mov(ecx, instr->name()); | 4468 __ mov(ecx, instr->name()); |
(...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6406 __ bind(deferred->exit()); | 6424 __ bind(deferred->exit()); |
6407 __ bind(&done); | 6425 __ bind(&done); |
6408 } | 6426 } |
6409 | 6427 |
6410 | 6428 |
6411 #undef __ | 6429 #undef __ |
6412 | 6430 |
6413 } } // namespace v8::internal | 6431 } } // namespace v8::internal |
6414 | 6432 |
6415 #endif // V8_TARGET_ARCH_IA32 | 6433 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |