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_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "lithium-allocator-inl.h" | 9 #include "lithium-allocator-inl.h" |
10 #include "x64/lithium-x64.h" | 10 #include "x64/lithium-x64.h" |
(...skipping 2293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2304 val = UseRegisterAtStart(instr->value()); | 2304 val = UseRegisterAtStart(instr->value()); |
2305 } else { | 2305 } else { |
2306 val = UseRegister(instr->value()); | 2306 val = UseRegister(instr->value()); |
2307 } | 2307 } |
2308 | 2308 |
2309 // We only need a scratch register if we have a write barrier or we | 2309 // We only need a scratch register if we have a write barrier or we |
2310 // have a store into the properties array (not in-object-property). | 2310 // have a store into the properties array (not in-object-property). |
2311 LOperand* temp = (!is_in_object || needs_write_barrier || | 2311 LOperand* temp = (!is_in_object || needs_write_barrier || |
2312 needs_write_barrier_for_map) ? TempRegister() : NULL; | 2312 needs_write_barrier_for_map) ? TempRegister() : NULL; |
2313 | 2313 |
2314 return new(zone()) LStoreNamedField(obj, val, temp); | 2314 LInstruction* result = new(zone()) LStoreNamedField(obj, val, temp); |
| 2315 if (!instr->access().IsExternalMemory() && |
| 2316 instr->field_representation().IsHeapObject() && |
| 2317 (val->IsConstantOperand() |
| 2318 ? HConstant::cast(instr->value())->HasSmiValue() |
| 2319 : !instr->value()->type().IsHeapObject())) { |
| 2320 result = AssignEnvironment(result); |
| 2321 } |
| 2322 return result; |
2315 } | 2323 } |
2316 | 2324 |
2317 | 2325 |
2318 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 2326 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
2319 LOperand* context = UseFixed(instr->context(), rsi); | 2327 LOperand* context = UseFixed(instr->context(), rsi); |
2320 LOperand* object = UseFixed(instr->object(), rdx); | 2328 LOperand* object = UseFixed(instr->object(), rdx); |
2321 LOperand* value = UseFixed(instr->value(), rax); | 2329 LOperand* value = UseFixed(instr->value(), rax); |
2322 | 2330 |
2323 LStoreNamedGeneric* result = | 2331 LStoreNamedGeneric* result = |
2324 new(zone()) LStoreNamedGeneric(context, object, value); | 2332 new(zone()) LStoreNamedGeneric(context, object, value); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2577 LOperand* index = UseTempRegister(instr->index()); | 2585 LOperand* index = UseTempRegister(instr->index()); |
2578 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2586 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2579 LInstruction* result = DefineSameAsFirst(load); | 2587 LInstruction* result = DefineSameAsFirst(load); |
2580 return AssignPointerMap(result); | 2588 return AssignPointerMap(result); |
2581 } | 2589 } |
2582 | 2590 |
2583 | 2591 |
2584 } } // namespace v8::internal | 2592 } } // namespace v8::internal |
2585 | 2593 |
2586 #endif // V8_TARGET_ARCH_X64 | 2594 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |