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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 __ fstp_d(FieldOperand(storage_reg, HeapNumber::kValueOffset)); | 385 __ fstp_d(FieldOperand(storage_reg, HeapNumber::kValueOffset)); |
386 } | 386 } |
387 | 387 |
388 // Stub never generated for objects that require access checks. | 388 // Stub never generated for objects that require access checks. |
389 DCHECK(!transition->is_access_check_needed()); | 389 DCHECK(!transition->is_access_check_needed()); |
390 | 390 |
391 // Perform map transition for the receiver if necessary. | 391 // Perform map transition for the receiver if necessary. |
392 if (details.type() == FIELD && | 392 if (details.type() == FIELD && |
393 Map::cast(transition->GetBackPointer())->unused_property_fields() == 0) { | 393 Map::cast(transition->GetBackPointer())->unused_property_fields() == 0) { |
394 // The properties must be extended before we can store the value. | 394 // The properties must be extended before we can store the value. |
395 // We jump to a runtime call that extends the properties array. | 395 __ mov(ExtendStorageDescriptor::MapRegister(), Immediate(transition)); |
396 __ pop(scratch1); // Return address. | 396 |
397 __ push(receiver_reg); | 397 ExtendStorageStub stub(isolate(), |
398 __ push(Immediate(transition)); | 398 FieldIndex::ForDescriptor(*transition, descriptor), |
399 __ push(value_reg); | 399 representation); |
400 __ push(scratch1); | 400 GenerateTailCall(masm(), stub.GetCode()); |
401 __ TailCallExternalReference( | |
402 ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage), | |
403 isolate()), | |
404 3, 1); | |
405 return; | 401 return; |
406 } | 402 } |
407 | 403 |
408 // Update the map of the object. | 404 // Update the map of the object. |
409 __ mov(scratch1, Immediate(transition)); | 405 __ mov(scratch1, Immediate(transition)); |
410 __ mov(FieldOperand(receiver_reg, HeapObject::kMapOffset), scratch1); | 406 __ mov(FieldOperand(receiver_reg, HeapObject::kMapOffset), scratch1); |
411 | 407 |
412 // Update the write barrier for the map field. | 408 // Update the write barrier for the map field. |
413 __ RecordWriteField(receiver_reg, HeapObject::kMapOffset, scratch1, scratch2, | 409 __ RecordWriteField(receiver_reg, HeapObject::kMapOffset, scratch1, scratch2, |
414 kDontSaveFPRegs, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 410 kDontSaveFPRegs, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 // Return the generated code. | 842 // Return the generated code. |
847 return GetCode(kind(), Code::NORMAL, name); | 843 return GetCode(kind(), Code::NORMAL, name); |
848 } | 844 } |
849 | 845 |
850 | 846 |
851 #undef __ | 847 #undef __ |
852 } | 848 } |
853 } // namespace v8::internal | 849 } // namespace v8::internal |
854 | 850 |
855 #endif // V8_TARGET_ARCH_X87 | 851 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |