| 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 | 564 |
| 565 int index = transition->instance_descriptors()->GetFieldIndex( | 565 int index = transition->instance_descriptors()->GetFieldIndex( |
| 566 transition->LastAdded()); | 566 transition->LastAdded()); |
| 567 | 567 |
| 568 // Adjust for the number of properties stored in the object. Even in the | 568 // Adjust for the number of properties stored in the object. Even in the |
| 569 // face of a transition we can use the old map here because the size of the | 569 // face of a transition we can use the old map here because the size of the |
| 570 // object and the number of in-object properties is not going to change. | 570 // object and the number of in-object properties is not going to change. |
| 571 index -= object->map()->inobject_properties(); | 571 index -= object->map()->inobject_properties(); |
| 572 | 572 |
| 573 // TODO(verwaest): Share this code as a code stub. | 573 // TODO(verwaest): Share this code as a code stub. |
| 574 SmiCheck smi_check = representation.IsTagged() |
| 575 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK; |
| 574 if (index < 0) { | 576 if (index < 0) { |
| 575 // Set the property straight into the object. | 577 // Set the property straight into the object. |
| 576 int offset = object->map()->instance_size() + (index * kPointerSize); | 578 int offset = object->map()->instance_size() + (index * kPointerSize); |
| 577 if (FLAG_track_double_fields && representation.IsDouble()) { | 579 if (FLAG_track_double_fields && representation.IsDouble()) { |
| 578 __ sw(storage_reg, FieldMemOperand(receiver_reg, offset)); | 580 __ sw(storage_reg, FieldMemOperand(receiver_reg, offset)); |
| 579 } else { | 581 } else { |
| 580 __ sw(value_reg, FieldMemOperand(receiver_reg, offset)); | 582 __ sw(value_reg, FieldMemOperand(receiver_reg, offset)); |
| 581 } | 583 } |
| 582 | 584 |
| 583 if (!FLAG_track_fields || !representation.IsSmi()) { | 585 if (!FLAG_track_fields || !representation.IsSmi()) { |
| 584 // Skip updating write barrier if storing a smi. | 586 // Skip updating write barrier if storing a smi. |
| 585 __ JumpIfSmi(value_reg, &exit); | 587 __ JumpIfSmi(value_reg, &exit); |
| 586 | 588 |
| 587 // Update the write barrier for the array address. | 589 // Update the write barrier for the array address. |
| 588 // Pass the now unused name_reg as a scratch register. | 590 // Pass the now unused name_reg as a scratch register. |
| 589 if (!FLAG_track_double_fields || !representation.IsDouble()) { | 591 if (!FLAG_track_double_fields || !representation.IsDouble()) { |
| 590 __ mov(name_reg, value_reg); | 592 __ mov(name_reg, value_reg); |
| 591 } else { | 593 } else { |
| 592 ASSERT(storage_reg.is(name_reg)); | 594 ASSERT(storage_reg.is(name_reg)); |
| 593 } | 595 } |
| 594 __ RecordWriteField(receiver_reg, | 596 __ RecordWriteField(receiver_reg, |
| 595 offset, | 597 offset, |
| 596 name_reg, | 598 name_reg, |
| 597 scratch1, | 599 scratch1, |
| 598 kRAHasNotBeenSaved, | 600 kRAHasNotBeenSaved, |
| 599 kDontSaveFPRegs); | 601 kDontSaveFPRegs, |
| 602 EMIT_REMEMBERED_SET, |
| 603 smi_check); |
| 600 } | 604 } |
| 601 } else { | 605 } else { |
| 602 // Write to the properties array. | 606 // Write to the properties array. |
| 603 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 607 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
| 604 // Get the properties array | 608 // Get the properties array |
| 605 __ lw(scratch1, | 609 __ lw(scratch1, |
| 606 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); | 610 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); |
| 607 if (FLAG_track_double_fields && representation.IsDouble()) { | 611 if (FLAG_track_double_fields && representation.IsDouble()) { |
| 608 __ sw(storage_reg, FieldMemOperand(scratch1, offset)); | 612 __ sw(storage_reg, FieldMemOperand(scratch1, offset)); |
| 609 } else { | 613 } else { |
| 610 __ sw(value_reg, FieldMemOperand(scratch1, offset)); | 614 __ sw(value_reg, FieldMemOperand(scratch1, offset)); |
| 611 } | 615 } |
| 612 | 616 |
| 613 if (!FLAG_track_fields || !representation.IsSmi()) { | 617 if (!FLAG_track_fields || !representation.IsSmi()) { |
| 614 // Skip updating write barrier if storing a smi. | 618 // Skip updating write barrier if storing a smi. |
| 615 __ JumpIfSmi(value_reg, &exit); | 619 __ JumpIfSmi(value_reg, &exit); |
| 616 | 620 |
| 617 // Update the write barrier for the array address. | 621 // Update the write barrier for the array address. |
| 618 // Ok to clobber receiver_reg and name_reg, since we return. | 622 // Ok to clobber receiver_reg and name_reg, since we return. |
| 619 if (!FLAG_track_double_fields || !representation.IsDouble()) { | 623 if (!FLAG_track_double_fields || !representation.IsDouble()) { |
| 620 __ mov(name_reg, value_reg); | 624 __ mov(name_reg, value_reg); |
| 621 } else { | 625 } else { |
| 622 ASSERT(storage_reg.is(name_reg)); | 626 ASSERT(storage_reg.is(name_reg)); |
| 623 } | 627 } |
| 624 __ RecordWriteField(scratch1, | 628 __ RecordWriteField(scratch1, |
| 625 offset, | 629 offset, |
| 626 name_reg, | 630 name_reg, |
| 627 receiver_reg, | 631 receiver_reg, |
| 628 kRAHasNotBeenSaved, | 632 kRAHasNotBeenSaved, |
| 629 kDontSaveFPRegs); | 633 kDontSaveFPRegs, |
| 634 EMIT_REMEMBERED_SET, |
| 635 smi_check); |
| 630 } | 636 } |
| 631 } | 637 } |
| 632 | 638 |
| 633 // Return the value (register v0). | 639 // Return the value (register v0). |
| 634 ASSERT(value_reg.is(a0)); | 640 ASSERT(value_reg.is(a0)); |
| 635 __ bind(&exit); | 641 __ bind(&exit); |
| 636 __ mov(v0, a0); | 642 __ mov(v0, a0); |
| 637 __ Ret(); | 643 __ Ret(); |
| 638 } | 644 } |
| 639 | 645 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 __ bind(&do_store); | 714 __ bind(&do_store); |
| 709 __ sdc1(f4, FieldMemOperand(scratch1, HeapNumber::kValueOffset)); | 715 __ sdc1(f4, FieldMemOperand(scratch1, HeapNumber::kValueOffset)); |
| 710 // Return the value (register v0). | 716 // Return the value (register v0). |
| 711 ASSERT(value_reg.is(a0)); | 717 ASSERT(value_reg.is(a0)); |
| 712 __ mov(v0, a0); | 718 __ mov(v0, a0); |
| 713 __ Ret(); | 719 __ Ret(); |
| 714 return; | 720 return; |
| 715 } | 721 } |
| 716 | 722 |
| 717 // TODO(verwaest): Share this code as a code stub. | 723 // TODO(verwaest): Share this code as a code stub. |
| 724 SmiCheck smi_check = representation.IsTagged() |
| 725 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK; |
| 718 if (index < 0) { | 726 if (index < 0) { |
| 719 // Set the property straight into the object. | 727 // Set the property straight into the object. |
| 720 int offset = object->map()->instance_size() + (index * kPointerSize); | 728 int offset = object->map()->instance_size() + (index * kPointerSize); |
| 721 __ sw(value_reg, FieldMemOperand(receiver_reg, offset)); | 729 __ sw(value_reg, FieldMemOperand(receiver_reg, offset)); |
| 722 | 730 |
| 723 if (!FLAG_track_fields || !representation.IsSmi()) { | 731 if (!FLAG_track_fields || !representation.IsSmi()) { |
| 724 // Skip updating write barrier if storing a smi. | 732 // Skip updating write barrier if storing a smi. |
| 725 __ JumpIfSmi(value_reg, &exit); | 733 __ JumpIfSmi(value_reg, &exit); |
| 726 | 734 |
| 727 // Update the write barrier for the array address. | 735 // Update the write barrier for the array address. |
| 728 // Pass the now unused name_reg as a scratch register. | 736 // Pass the now unused name_reg as a scratch register. |
| 729 __ mov(name_reg, value_reg); | 737 __ mov(name_reg, value_reg); |
| 730 __ RecordWriteField(receiver_reg, | 738 __ RecordWriteField(receiver_reg, |
| 731 offset, | 739 offset, |
| 732 name_reg, | 740 name_reg, |
| 733 scratch1, | 741 scratch1, |
| 734 kRAHasNotBeenSaved, | 742 kRAHasNotBeenSaved, |
| 735 kDontSaveFPRegs); | 743 kDontSaveFPRegs, |
| 744 EMIT_REMEMBERED_SET, |
| 745 smi_check); |
| 736 } | 746 } |
| 737 } else { | 747 } else { |
| 738 // Write to the properties array. | 748 // Write to the properties array. |
| 739 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 749 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
| 740 // Get the properties array. | 750 // Get the properties array. |
| 741 __ lw(scratch1, | 751 __ lw(scratch1, |
| 742 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); | 752 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); |
| 743 __ sw(value_reg, FieldMemOperand(scratch1, offset)); | 753 __ sw(value_reg, FieldMemOperand(scratch1, offset)); |
| 744 | 754 |
| 745 if (!FLAG_track_fields || !representation.IsSmi()) { | 755 if (!FLAG_track_fields || !representation.IsSmi()) { |
| 746 // Skip updating write barrier if storing a smi. | 756 // Skip updating write barrier if storing a smi. |
| 747 __ JumpIfSmi(value_reg, &exit); | 757 __ JumpIfSmi(value_reg, &exit); |
| 748 | 758 |
| 749 // Update the write barrier for the array address. | 759 // Update the write barrier for the array address. |
| 750 // Ok to clobber receiver_reg and name_reg, since we return. | 760 // Ok to clobber receiver_reg and name_reg, since we return. |
| 751 __ mov(name_reg, value_reg); | 761 __ mov(name_reg, value_reg); |
| 752 __ RecordWriteField(scratch1, | 762 __ RecordWriteField(scratch1, |
| 753 offset, | 763 offset, |
| 754 name_reg, | 764 name_reg, |
| 755 receiver_reg, | 765 receiver_reg, |
| 756 kRAHasNotBeenSaved, | 766 kRAHasNotBeenSaved, |
| 757 kDontSaveFPRegs); | 767 kDontSaveFPRegs, |
| 768 EMIT_REMEMBERED_SET, |
| 769 smi_check); |
| 758 } | 770 } |
| 759 } | 771 } |
| 760 | 772 |
| 761 // Return the value (register v0). | 773 // Return the value (register v0). |
| 762 ASSERT(value_reg.is(a0)); | 774 ASSERT(value_reg.is(a0)); |
| 763 __ bind(&exit); | 775 __ bind(&exit); |
| 764 __ mov(v0, a0); | 776 __ mov(v0, a0); |
| 765 __ Ret(); | 777 __ Ret(); |
| 766 } | 778 } |
| 767 | 779 |
| (...skipping 3117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3885 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); | 3897 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); |
| 3886 } | 3898 } |
| 3887 } | 3899 } |
| 3888 | 3900 |
| 3889 | 3901 |
| 3890 #undef __ | 3902 #undef __ |
| 3891 | 3903 |
| 3892 } } // namespace v8::internal | 3904 } } // namespace v8::internal |
| 3893 | 3905 |
| 3894 #endif // V8_TARGET_ARCH_MIPS | 3906 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |