Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 7639015: ARM: Optimize stubs for incremental marking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Incorporated second review by Erik Corry. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/code-stubs-arm.h ('k') | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 eq,
6786 &need_incremental);
6787
6788 __ bind(&ensure_not_white);
6789 }
6790
6791 // We need extra registers for this, so we push the object and the address
6792 // register temporarily.
6793 __ Push(regs_.object(), regs_.address());
6794 __ EnsureNotWhite(regs_.scratch0(), // The value.
6795 regs_.scratch1(), // Scratch.
6796 regs_.object(), // Scratch.
6797 regs_.address(), // Scratch.
6798 &need_incremental_pop_scratch);
6799 __ Pop(regs_.object(), regs_.address());
6800
6801 regs_.Restore(masm);
6802 if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) {
6803 __ RememberedSetHelper(
6804 address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
6805 } else {
6806 __ Ret();
6807 }
6808
6809 __ bind(&need_incremental_pop_scratch);
6810 __ Pop(regs_.object(), regs_.address());
6811
6812 __ bind(&need_incremental);
6768 6813
6769 // Fall through when we need to inform the incremental marker. 6814 // Fall through when we need to inform the incremental marker.
6770 } 6815 }
6771 6816
6772 6817
6773 #undef __ 6818 #undef __
6774 6819
6775 } } // namespace v8::internal 6820 } } // namespace v8::internal
6776 6821
6777 #endif // V8_TARGET_ARCH_ARM 6822 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.h ('k') | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698