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 "lithium-allocator-inl.h" | 9 #include "lithium-allocator-inl.h" |
10 #include "ia32/lithium-ia32.h" | 10 #include "ia32/lithium-ia32.h" |
(...skipping 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2412 } | 2412 } |
2413 | 2413 |
2414 // We only need a scratch register if we have a write barrier or we | 2414 // We only need a scratch register if we have a write barrier or we |
2415 // have a store into the properties array (not in-object-property). | 2415 // have a store into the properties array (not in-object-property). |
2416 LOperand* temp = (!is_in_object || needs_write_barrier || | 2416 LOperand* temp = (!is_in_object || needs_write_barrier || |
2417 needs_write_barrier_for_map) ? TempRegister() : NULL; | 2417 needs_write_barrier_for_map) ? TempRegister() : NULL; |
2418 | 2418 |
2419 // We need a temporary register for write barrier of the map field. | 2419 // We need a temporary register for write barrier of the map field. |
2420 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; | 2420 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; |
2421 | 2421 |
2422 return new(zone()) LStoreNamedField(obj, val, temp, temp_map); | 2422 LInstruction* result = |
| 2423 new(zone()) LStoreNamedField(obj, val, temp, temp_map); |
| 2424 if (!instr->access().IsExternalMemory() && |
| 2425 instr->field_representation().IsHeapObject() && |
| 2426 (val->IsConstantOperand() |
| 2427 ? HConstant::cast(instr->value())->HasSmiValue() |
| 2428 : !instr->value()->type().IsHeapObject())) { |
| 2429 result = AssignEnvironment(result); |
| 2430 } |
| 2431 return result; |
2423 } | 2432 } |
2424 | 2433 |
2425 | 2434 |
2426 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 2435 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
2427 LOperand* context = UseFixed(instr->context(), esi); | 2436 LOperand* context = UseFixed(instr->context(), esi); |
2428 LOperand* object = UseFixed(instr->object(), edx); | 2437 LOperand* object = UseFixed(instr->object(), edx); |
2429 LOperand* value = UseFixed(instr->value(), eax); | 2438 LOperand* value = UseFixed(instr->value(), eax); |
2430 | 2439 |
2431 LStoreNamedGeneric* result = | 2440 LStoreNamedGeneric* result = |
2432 new(zone()) LStoreNamedGeneric(context, object, value); | 2441 new(zone()) LStoreNamedGeneric(context, object, value); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2688 LOperand* index = UseTempRegister(instr->index()); | 2697 LOperand* index = UseTempRegister(instr->index()); |
2689 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2698 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2690 LInstruction* result = DefineSameAsFirst(load); | 2699 LInstruction* result = DefineSameAsFirst(load); |
2691 return AssignPointerMap(result); | 2700 return AssignPointerMap(result); |
2692 } | 2701 } |
2693 | 2702 |
2694 | 2703 |
2695 } } // namespace v8::internal | 2704 } } // namespace v8::internal |
2696 | 2705 |
2697 #endif // V8_TARGET_ARCH_IA32 | 2706 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |