OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 | 574 |
575 int index = transition->instance_descriptors()->GetFieldIndex( | 575 int index = transition->instance_descriptors()->GetFieldIndex( |
576 transition->LastAdded()); | 576 transition->LastAdded()); |
577 | 577 |
578 // Adjust for the number of properties stored in the object. Even in the | 578 // Adjust for the number of properties stored in the object. Even in the |
579 // face of a transition we can use the old map here because the size of the | 579 // face of a transition we can use the old map here because the size of the |
580 // object and the number of in-object properties is not going to change. | 580 // object and the number of in-object properties is not going to change. |
581 index -= object->map()->inobject_properties(); | 581 index -= object->map()->inobject_properties(); |
582 | 582 |
583 // TODO(verwaest): Share this code as a code stub. | 583 // TODO(verwaest): Share this code as a code stub. |
| 584 SmiCheck smi_check = representation.IsTagged() |
| 585 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK; |
584 if (index < 0) { | 586 if (index < 0) { |
585 // Set the property straight into the object. | 587 // Set the property straight into the object. |
586 int offset = object->map()->instance_size() + (index * kPointerSize); | 588 int offset = object->map()->instance_size() + (index * kPointerSize); |
587 if (FLAG_track_double_fields && representation.IsDouble()) { | 589 if (FLAG_track_double_fields && representation.IsDouble()) { |
588 __ str(storage_reg, FieldMemOperand(receiver_reg, offset)); | 590 __ str(storage_reg, FieldMemOperand(receiver_reg, offset)); |
589 } else { | 591 } else { |
590 __ str(value_reg, FieldMemOperand(receiver_reg, offset)); | 592 __ str(value_reg, FieldMemOperand(receiver_reg, offset)); |
591 } | 593 } |
592 | 594 |
593 if (!FLAG_track_fields || !representation.IsSmi()) { | 595 if (!FLAG_track_fields || !representation.IsSmi()) { |
594 // Skip updating write barrier if storing a smi. | 596 // Skip updating write barrier if storing a smi. |
595 __ JumpIfSmi(value_reg, &exit); | 597 __ JumpIfSmi(value_reg, &exit); |
596 | 598 |
597 // Update the write barrier for the array address. | 599 // Update the write barrier for the array address. |
598 // Pass the now unused name_reg as a scratch register. | 600 // Pass the now unused name_reg as a scratch register. |
599 if (!FLAG_track_double_fields || !representation.IsDouble()) { | 601 if (!FLAG_track_double_fields || !representation.IsDouble()) { |
600 __ mov(name_reg, value_reg); | 602 __ mov(name_reg, value_reg); |
601 } else { | 603 } else { |
602 ASSERT(storage_reg.is(name_reg)); | 604 ASSERT(storage_reg.is(name_reg)); |
603 } | 605 } |
604 __ RecordWriteField(receiver_reg, | 606 __ RecordWriteField(receiver_reg, |
605 offset, | 607 offset, |
606 name_reg, | 608 name_reg, |
607 scratch1, | 609 scratch1, |
608 kLRHasNotBeenSaved, | 610 kLRHasNotBeenSaved, |
609 kDontSaveFPRegs); | 611 kDontSaveFPRegs, |
| 612 EMIT_REMEMBERED_SET, |
| 613 smi_check); |
610 } | 614 } |
611 } else { | 615 } else { |
612 // Write to the properties array. | 616 // Write to the properties array. |
613 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 617 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
614 // Get the properties array | 618 // Get the properties array |
615 __ ldr(scratch1, | 619 __ ldr(scratch1, |
616 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); | 620 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); |
617 if (FLAG_track_double_fields && representation.IsDouble()) { | 621 if (FLAG_track_double_fields && representation.IsDouble()) { |
618 __ str(storage_reg, FieldMemOperand(scratch1, offset)); | 622 __ str(storage_reg, FieldMemOperand(scratch1, offset)); |
619 } else { | 623 } else { |
620 __ str(value_reg, FieldMemOperand(scratch1, offset)); | 624 __ str(value_reg, FieldMemOperand(scratch1, offset)); |
621 } | 625 } |
622 | 626 |
623 if (!FLAG_track_fields || !representation.IsSmi()) { | 627 if (!FLAG_track_fields || !representation.IsSmi()) { |
624 // Skip updating write barrier if storing a smi. | 628 // Skip updating write barrier if storing a smi. |
625 __ JumpIfSmi(value_reg, &exit); | 629 __ JumpIfSmi(value_reg, &exit); |
626 | 630 |
627 // Update the write barrier for the array address. | 631 // Update the write barrier for the array address. |
628 // Ok to clobber receiver_reg and name_reg, since we return. | 632 // Ok to clobber receiver_reg and name_reg, since we return. |
629 if (!FLAG_track_double_fields || !representation.IsDouble()) { | 633 if (!FLAG_track_double_fields || !representation.IsDouble()) { |
630 __ mov(name_reg, value_reg); | 634 __ mov(name_reg, value_reg); |
631 } else { | 635 } else { |
632 ASSERT(storage_reg.is(name_reg)); | 636 ASSERT(storage_reg.is(name_reg)); |
633 } | 637 } |
634 __ RecordWriteField(scratch1, | 638 __ RecordWriteField(scratch1, |
635 offset, | 639 offset, |
636 name_reg, | 640 name_reg, |
637 receiver_reg, | 641 receiver_reg, |
638 kLRHasNotBeenSaved, | 642 kLRHasNotBeenSaved, |
639 kDontSaveFPRegs); | 643 kDontSaveFPRegs, |
| 644 EMIT_REMEMBERED_SET, |
| 645 smi_check); |
640 } | 646 } |
641 } | 647 } |
642 | 648 |
643 // Return the value (register r0). | 649 // Return the value (register r0). |
644 ASSERT(value_reg.is(r0)); | 650 ASSERT(value_reg.is(r0)); |
645 __ bind(&exit); | 651 __ bind(&exit); |
646 __ Ret(); | 652 __ Ret(); |
647 } | 653 } |
648 | 654 |
649 | 655 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 | 722 |
717 __ bind(&do_store); | 723 __ bind(&do_store); |
718 __ vstr(d0, FieldMemOperand(scratch1, HeapNumber::kValueOffset)); | 724 __ vstr(d0, FieldMemOperand(scratch1, HeapNumber::kValueOffset)); |
719 // Return the value (register r0). | 725 // Return the value (register r0). |
720 ASSERT(value_reg.is(r0)); | 726 ASSERT(value_reg.is(r0)); |
721 __ Ret(); | 727 __ Ret(); |
722 return; | 728 return; |
723 } | 729 } |
724 | 730 |
725 // TODO(verwaest): Share this code as a code stub. | 731 // TODO(verwaest): Share this code as a code stub. |
| 732 SmiCheck smi_check = representation.IsTagged() |
| 733 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK; |
726 if (index < 0) { | 734 if (index < 0) { |
727 // Set the property straight into the object. | 735 // Set the property straight into the object. |
728 int offset = object->map()->instance_size() + (index * kPointerSize); | 736 int offset = object->map()->instance_size() + (index * kPointerSize); |
729 __ str(value_reg, FieldMemOperand(receiver_reg, offset)); | 737 __ str(value_reg, FieldMemOperand(receiver_reg, offset)); |
730 | 738 |
731 if (!FLAG_track_fields || !representation.IsSmi()) { | 739 if (!FLAG_track_fields || !representation.IsSmi()) { |
732 // Skip updating write barrier if storing a smi. | 740 // Skip updating write barrier if storing a smi. |
733 __ JumpIfSmi(value_reg, &exit); | 741 __ JumpIfSmi(value_reg, &exit); |
734 | 742 |
735 // Update the write barrier for the array address. | 743 // Update the write barrier for the array address. |
736 // Pass the now unused name_reg as a scratch register. | 744 // Pass the now unused name_reg as a scratch register. |
737 __ mov(name_reg, value_reg); | 745 __ mov(name_reg, value_reg); |
738 __ RecordWriteField(receiver_reg, | 746 __ RecordWriteField(receiver_reg, |
739 offset, | 747 offset, |
740 name_reg, | 748 name_reg, |
741 scratch1, | 749 scratch1, |
742 kLRHasNotBeenSaved, | 750 kLRHasNotBeenSaved, |
743 kDontSaveFPRegs); | 751 kDontSaveFPRegs, |
| 752 EMIT_REMEMBERED_SET, |
| 753 smi_check); |
744 } | 754 } |
745 } else { | 755 } else { |
746 // Write to the properties array. | 756 // Write to the properties array. |
747 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 757 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
748 // Get the properties array | 758 // Get the properties array |
749 __ ldr(scratch1, | 759 __ ldr(scratch1, |
750 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); | 760 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); |
751 __ str(value_reg, FieldMemOperand(scratch1, offset)); | 761 __ str(value_reg, FieldMemOperand(scratch1, offset)); |
752 | 762 |
753 if (!FLAG_track_fields || !representation.IsSmi()) { | 763 if (!FLAG_track_fields || !representation.IsSmi()) { |
754 // Skip updating write barrier if storing a smi. | 764 // Skip updating write barrier if storing a smi. |
755 __ JumpIfSmi(value_reg, &exit); | 765 __ JumpIfSmi(value_reg, &exit); |
756 | 766 |
757 // Update the write barrier for the array address. | 767 // Update the write barrier for the array address. |
758 // Ok to clobber receiver_reg and name_reg, since we return. | 768 // Ok to clobber receiver_reg and name_reg, since we return. |
759 __ mov(name_reg, value_reg); | 769 __ mov(name_reg, value_reg); |
760 __ RecordWriteField(scratch1, | 770 __ RecordWriteField(scratch1, |
761 offset, | 771 offset, |
762 name_reg, | 772 name_reg, |
763 receiver_reg, | 773 receiver_reg, |
764 kLRHasNotBeenSaved, | 774 kLRHasNotBeenSaved, |
765 kDontSaveFPRegs); | 775 kDontSaveFPRegs, |
| 776 EMIT_REMEMBERED_SET, |
| 777 smi_check); |
766 } | 778 } |
767 } | 779 } |
768 | 780 |
769 // Return the value (register r0). | 781 // Return the value (register r0). |
770 ASSERT(value_reg.is(r0)); | 782 ASSERT(value_reg.is(r0)); |
771 __ bind(&exit); | 783 __ bind(&exit); |
772 __ Ret(); | 784 __ Ret(); |
773 } | 785 } |
774 | 786 |
775 | 787 |
(...skipping 2995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3771 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); | 3783 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); |
3772 } | 3784 } |
3773 } | 3785 } |
3774 | 3786 |
3775 | 3787 |
3776 #undef __ | 3788 #undef __ |
3777 | 3789 |
3778 } } // namespace v8::internal | 3790 } } // namespace v8::internal |
3779 | 3791 |
3780 #endif // V8_TARGET_ARCH_ARM | 3792 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |