OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/ic/call-optimization.h" | 9 #include "src/ic/call-optimization.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 __ movsd(FieldOperand(storage_reg, HeapNumber::kValueOffset), xmm0); | 377 __ movsd(FieldOperand(storage_reg, HeapNumber::kValueOffset), xmm0); |
378 } | 378 } |
379 | 379 |
380 // Stub never generated for objects that require access checks. | 380 // Stub never generated for objects that require access checks. |
381 DCHECK(!transition->is_access_check_needed()); | 381 DCHECK(!transition->is_access_check_needed()); |
382 | 382 |
383 // Perform map transition for the receiver if necessary. | 383 // Perform map transition for the receiver if necessary. |
384 if (details.type() == FIELD && | 384 if (details.type() == FIELD && |
385 Map::cast(transition->GetBackPointer())->unused_property_fields() == 0) { | 385 Map::cast(transition->GetBackPointer())->unused_property_fields() == 0) { |
386 // The properties must be extended before we can store the value. | 386 // The properties must be extended before we can store the value. |
387 // We jump to a runtime call that extends the properties array. | 387 __ Move(ExtendStorageDescriptor::NameRegister(), name); |
388 __ PopReturnAddressTo(scratch1); | 388 __ Move(ExtendStorageDescriptor::MapRegister(), transition); |
389 __ Push(receiver_reg); | 389 |
390 __ Push(transition); | 390 ExtendStorageStub stub(isolate(), |
391 __ Push(value_reg); | 391 FieldIndex::ForDescriptor(*transition, descriptor), |
392 __ PushReturnAddressFrom(scratch1); | 392 representation); |
393 __ TailCallExternalReference( | 393 GenerateTailCall(masm(), stub.GetCode()); |
394 ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage), | |
395 isolate()), | |
396 3, 1); | |
397 return; | 394 return; |
398 } | 395 } |
399 | 396 |
400 // Update the map of the object. | 397 // Update the map of the object. |
401 __ Move(scratch1, transition); | 398 __ Move(scratch1, transition); |
402 __ movp(FieldOperand(receiver_reg, HeapObject::kMapOffset), scratch1); | 399 __ movp(FieldOperand(receiver_reg, HeapObject::kMapOffset), scratch1); |
403 | 400 |
404 // Update the write barrier for the map field. | 401 // Update the write barrier for the map field. |
405 __ RecordWriteField(receiver_reg, HeapObject::kMapOffset, scratch1, scratch2, | 402 __ RecordWriteField(receiver_reg, HeapObject::kMapOffset, scratch1, scratch2, |
406 kDontSaveFPRegs, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 403 kDontSaveFPRegs, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 // Return the generated code. | 823 // Return the generated code. |
827 return GetCode(kind(), Code::NORMAL, name); | 824 return GetCode(kind(), Code::NORMAL, name); |
828 } | 825 } |
829 | 826 |
830 | 827 |
831 #undef __ | 828 #undef __ |
832 } | 829 } |
833 } // namespace v8::internal | 830 } // namespace v8::internal |
834 | 831 |
835 #endif // V8_TARGET_ARCH_X64 | 832 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |