Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 6667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6678 if (remembered_set_action_ == EMIT_REMEMBERED_SET) { | 6678 if (remembered_set_action_ == EMIT_REMEMBERED_SET) { |
| 6679 Label dont_need_remembered_set; | 6679 Label dont_need_remembered_set; |
| 6680 | 6680 |
| 6681 __ ldr(regs_.scratch0(), MemOperand(regs_.address(), 0)); | 6681 __ ldr(regs_.scratch0(), MemOperand(regs_.address(), 0)); |
| 6682 __ JumpIfNotInNewSpace(regs_.scratch0(), | 6682 __ JumpIfNotInNewSpace(regs_.scratch0(), |
| 6683 regs_.scratch0(), | 6683 regs_.scratch0(), |
| 6684 &dont_need_remembered_set); | 6684 &dont_need_remembered_set); |
| 6685 | 6685 |
| 6686 __ CheckPageFlag(regs_.object(), | 6686 __ CheckPageFlag(regs_.object(), |
| 6687 regs_.scratch0(), | 6687 regs_.scratch0(), |
| 6688 MemoryChunk::SCAN_ON_SCAVENGE, | 6688 1 << MemoryChunk::SCAN_ON_SCAVENGE, |
| 6689 ne, | 6689 ne, |
| 6690 &dont_need_remembered_set); | 6690 &dont_need_remembered_set); |
| 6691 | 6691 |
| 6692 // First notify the incremental marker if necessary, then update the | 6692 // First notify the incremental marker if necessary, then update the |
| 6693 // remembered set. | 6693 // remembered set. |
| 6694 CheckNeedsToInformIncrementalMarker( | 6694 CheckNeedsToInformIncrementalMarker( |
| 6695 masm, kUpdateRememberedSetOnNoNeedToInformIncrementalMarker); | 6695 masm, kUpdateRememberedSetOnNoNeedToInformIncrementalMarker, mode); |
| 6696 InformIncrementalMarker(masm, mode); | 6696 InformIncrementalMarker(masm, mode); |
| 6697 regs_.Restore(masm); | 6697 regs_.Restore(masm); |
| 6698 __ RememberedSetHelper( | 6698 __ RememberedSetHelper( |
| 6699 address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd); | 6699 address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd); |
| 6700 | 6700 |
| 6701 __ bind(&dont_need_remembered_set); | 6701 __ bind(&dont_need_remembered_set); |
| 6702 } | 6702 } |
| 6703 | 6703 |
| 6704 CheckNeedsToInformIncrementalMarker( | 6704 CheckNeedsToInformIncrementalMarker( |
| 6705 masm, kReturnOnNoNeedToInformIncrementalMarker); | 6705 masm, kReturnOnNoNeedToInformIncrementalMarker, mode); |
| 6706 InformIncrementalMarker(masm, mode); | 6706 InformIncrementalMarker(masm, mode); |
| 6707 regs_.Restore(masm); | 6707 regs_.Restore(masm); |
| 6708 __ Ret(); | 6708 __ Ret(); |
| 6709 } | 6709 } |
| 6710 | 6710 |
| 6711 | 6711 |
| 6712 void RecordWriteStub::InformIncrementalMarker(MacroAssembler* masm, Mode mode) { | 6712 void RecordWriteStub::InformIncrementalMarker(MacroAssembler* masm, Mode mode) { |
| 6713 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_); | 6713 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_); |
| 6714 int argument_count = 3; | 6714 int argument_count = 3; |
| 6715 __ PrepareCallCFunction(argument_count, regs_.scratch0()); | 6715 __ PrepareCallCFunction(argument_count, regs_.scratch0()); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 6740 ExternalReference::incremental_marking_record_write_function( | 6740 ExternalReference::incremental_marking_record_write_function( |
| 6741 masm->isolate()), | 6741 masm->isolate()), |
| 6742 argument_count); | 6742 argument_count); |
| 6743 } | 6743 } |
| 6744 regs_.RestoreCallerSaveRegisters(masm, save_fp_regs_mode_); | 6744 regs_.RestoreCallerSaveRegisters(masm, save_fp_regs_mode_); |
| 6745 } | 6745 } |
| 6746 | 6746 |
| 6747 | 6747 |
| 6748 void RecordWriteStub::CheckNeedsToInformIncrementalMarker( | 6748 void RecordWriteStub::CheckNeedsToInformIncrementalMarker( |
| 6749 MacroAssembler* masm, | 6749 MacroAssembler* masm, |
| 6750 OnNoNeedToInformIncrementalMarker on_no_need) { | 6750 OnNoNeedToInformIncrementalMarker on_no_need, |
| 6751 Mode mode) { | |
| 6751 Label on_black; | 6752 Label on_black; |
| 6753 Label need_incremental; | |
| 6754 Label need_incremental_pop_scratch; | |
| 6752 | 6755 |
| 6753 // Let's look at the color of the object: If it is not black we don't have | 6756 // Let's look at the color of the object: If it is not black we don't have |
| 6754 // to inform the incremental marker. | 6757 // to inform the incremental marker. |
| 6755 __ JumpIfBlack(regs_.object(), regs_.scratch0(), regs_.scratch1(), &on_black); | 6758 __ JumpIfBlack(regs_.object(), regs_.scratch0(), regs_.scratch1(), &on_black); |
| 6756 | 6759 |
| 6757 regs_.Restore(masm); | 6760 regs_.Restore(masm); |
| 6758 if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) { | 6761 if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) { |
| 6759 __ RememberedSetHelper( | 6762 __ RememberedSetHelper( |
| 6760 address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd); | 6763 address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd); |
| 6761 } else { | 6764 } else { |
| 6762 __ Ret(); | 6765 __ Ret(); |
| 6763 } | 6766 } |
| 6764 | 6767 |
| 6765 __ bind(&on_black); | 6768 __ bind(&on_black); |
| 6766 | 6769 |
| 6767 // TODO(gc): Add call to EnsureNotWhite here. | 6770 // Get the value from the slot. |
| 6771 __ ldr(regs_.scratch0(), MemOperand(regs_.address(), 0)); | |
| 6772 | |
| 6773 if (mode == INCREMENTAL_COMPACTION) { | |
| 6774 Label ensure_not_white; | |
| 6775 | |
| 6776 __ CheckPageFlag(regs_.scratch0(), // Contains value. | |
| 6777 regs_.scratch1(), // Scratch. | |
| 6778 MemoryChunk::kEvacuationCandidateMask, | |
| 6779 eq, | |
| 6780 &ensure_not_white); | |
| 6781 | |
| 6782 __ CheckPageFlag(regs_.object(), | |
| 6783 regs_.scratch1(), // Scratch. | |
| 6784 MemoryChunk::kSkipEvacuationSlotsRecordingMask, | |
| 6785 ne, | |
|
Erik Corry
2011/08/16 09:29:23
Seems like you should make this 'eq', change the l
Michael Starzinger
2011/08/16 15:31:05
Done.
| |
| 6786 &ensure_not_white); | |
| 6787 | |
| 6788 __ b(&need_incremental); | |
| 6789 | |
| 6790 __ bind(&ensure_not_white); | |
| 6791 } | |
| 6792 | |
| 6793 // We need extra registers for this, so we push the object and the address | |
| 6794 // register temporarily. | |
| 6795 __ Push(regs_.object(), regs_.address()); | |
| 6796 __ EnsureNotWhite(regs_.scratch0(), // The value. | |
| 6797 regs_.scratch1(), // Scratch. | |
| 6798 regs_.object(), // Scratch. | |
| 6799 regs_.address(), // Scratch. | |
| 6800 &need_incremental_pop_scratch); | |
| 6801 __ Pop(regs_.object(), regs_.address()); | |
| 6802 | |
| 6803 regs_.Restore(masm); | |
| 6804 if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) { | |
| 6805 __ RememberedSetHelper( | |
| 6806 address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd); | |
| 6807 } else { | |
| 6808 __ Ret(); | |
| 6809 } | |
| 6810 | |
| 6811 __ bind(&need_incremental_pop_scratch); | |
| 6812 __ Pop(regs_.object(), regs_.address()); | |
| 6813 | |
| 6814 __ bind(&need_incremental); | |
| 6768 | 6815 |
| 6769 // Fall through when we need to inform the incremental marker. | 6816 // Fall through when we need to inform the incremental marker. |
| 6770 } | 6817 } |
| 6771 | 6818 |
| 6772 | 6819 |
| 6773 #undef __ | 6820 #undef __ |
| 6774 | 6821 |
| 6775 } } // namespace v8::internal | 6822 } } // namespace v8::internal |
| 6776 | 6823 |
| 6777 #endif // V8_TARGET_ARCH_ARM | 6824 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |