| 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 6875 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  6886  |  6886  | 
|  6887   // The first two instructions are generated with labels so as to get the |  6887   // The first two instructions are generated with labels so as to get the | 
|  6888   // offset fixed up correctly by the bind(Label*) call.  We patch it back and |  6888   // offset fixed up correctly by the bind(Label*) call.  We patch it back and | 
|  6889   // forth between a compare instructions (a nop in this position) and the |  6889   // forth between a compare instructions (a nop in this position) and the | 
|  6890   // real branch when we start and stop incremental heap marking. |  6890   // real branch when we start and stop incremental heap marking. | 
|  6891   // See RecordWriteStub::Patch for details. |  6891   // See RecordWriteStub::Patch for details. | 
|  6892   __ b(&skip_to_incremental_noncompacting); |  6892   __ b(&skip_to_incremental_noncompacting); | 
|  6893   __ b(&skip_to_incremental_compacting); |  6893   __ b(&skip_to_incremental_compacting); | 
|  6894  |  6894  | 
|  6895   if (remembered_set_action_ == EMIT_REMEMBERED_SET) { |  6895   if (remembered_set_action_ == EMIT_REMEMBERED_SET) { | 
|  6896     __ RememberedSetHelper( |  6896     __ RememberedSetHelper(object_, | 
|  6897         address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd); |  6897                            address_, | 
 |  6898                            value_, | 
 |  6899                            save_fp_regs_mode_, | 
 |  6900                            MacroAssembler::kReturnAtEnd); | 
|  6898   } |  6901   } | 
|  6899   __ Ret(); |  6902   __ Ret(); | 
|  6900  |  6903  | 
|  6901   __ bind(&skip_to_incremental_noncompacting); |  6904   __ bind(&skip_to_incremental_noncompacting); | 
|  6902   GenerateIncremental(masm, INCREMENTAL); |  6905   GenerateIncremental(masm, INCREMENTAL); | 
|  6903  |  6906  | 
|  6904   __ bind(&skip_to_incremental_compacting); |  6907   __ bind(&skip_to_incremental_compacting); | 
|  6905   GenerateIncremental(masm, INCREMENTAL_COMPACTION); |  6908   GenerateIncremental(masm, INCREMENTAL_COMPACTION); | 
|  6906  |  6909  | 
|  6907   // Initial mode of the stub is expected to be STORE_BUFFER_ONLY. |  6910   // Initial mode of the stub is expected to be STORE_BUFFER_ONLY. | 
|  6908   // Will be checked in IncrementalMarking::ActivateGeneratedStub. |  6911   // Will be checked in IncrementalMarking::ActivateGeneratedStub. | 
|  6909   ASSERT(Assembler::GetBranchOffset(masm->instr_at(0)) < (1 << 12)); |  6912   ASSERT(Assembler::GetBranchOffset(masm->instr_at(0)) < (1 << 12)); | 
|  6910   ASSERT(Assembler::GetBranchOffset(masm->instr_at(4)) < (1 << 12)); |  6913   ASSERT(Assembler::GetBranchOffset(masm->instr_at(4)) < (1 << 12)); | 
|  6911   PatchBranchIntoNop(masm, 0); |  6914   PatchBranchIntoNop(masm, 0); | 
|  6912   PatchBranchIntoNop(masm, Assembler::kInstrSize); |  6915   PatchBranchIntoNop(masm, Assembler::kInstrSize); | 
|  6913 } |  6916 } | 
|  6914  |  6917  | 
|  6915  |  6918  | 
|  6916 void RecordWriteStub::GenerateIncremental(MacroAssembler* masm, Mode mode) { |  6919 void RecordWriteStub::GenerateIncremental(MacroAssembler* masm, Mode mode) { | 
|  6917   regs_.Save(masm); |  6920   regs_.Save(masm); | 
|  6918  |  6921  | 
|  6919   if (remembered_set_action_ == EMIT_REMEMBERED_SET) { |  6922   if (remembered_set_action_ == EMIT_REMEMBERED_SET) { | 
|  6920     Label dont_need_remembered_set; |  6923     Label dont_need_remembered_set; | 
|  6921  |  6924  | 
|  6922     __ ldr(regs_.scratch0(), MemOperand(regs_.address(), 0)); |  6925     __ ldr(regs_.scratch0(), MemOperand(regs_.address(), 0)); | 
|  6923     __ JumpIfNotInNewSpace(regs_.scratch0(), |  6926     __ JumpIfNotInNewSpace(regs_.scratch0(),  // Value. | 
|  6924                            regs_.scratch0(), |  6927                            regs_.scratch0(), | 
|  6925                            &dont_need_remembered_set); |  6928                            &dont_need_remembered_set); | 
|  6926  |  6929  | 
|  6927     __ CheckPageFlag(regs_.object(), |  6930     __ CheckPageFlag(regs_.object(), | 
|  6928                      regs_.scratch0(), |  6931                      regs_.scratch0(), | 
|  6929                      1 << MemoryChunk::SCAN_ON_SCAVENGE, |  6932                      1 << MemoryChunk::SCAN_ON_SCAVENGE, | 
|  6930                      ne, |  6933                      ne, | 
|  6931                      &dont_need_remembered_set); |  6934                      &dont_need_remembered_set); | 
|  6932  |  6935  | 
|  6933     // First notify the incremental marker if necessary, then update the |  6936     // First notify the incremental marker if necessary, then update the | 
|  6934     // remembered set. |  6937     // remembered set. | 
|  6935     CheckNeedsToInformIncrementalMarker( |  6938     CheckNeedsToInformIncrementalMarker( | 
|  6936         masm, kUpdateRememberedSetOnNoNeedToInformIncrementalMarker, mode); |  6939         masm, kUpdateRememberedSetOnNoNeedToInformIncrementalMarker, mode); | 
|  6937     InformIncrementalMarker(masm, mode); |  6940     InformIncrementalMarker(masm, mode); | 
|  6938     regs_.Restore(masm); |  6941     regs_.Restore(masm); | 
|  6939     __ RememberedSetHelper( |  6942     __ RememberedSetHelper(object_, | 
|  6940         address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd); |  6943                            address_, | 
 |  6944                            value_, | 
 |  6945                            save_fp_regs_mode_, | 
 |  6946                            MacroAssembler::kReturnAtEnd); | 
|  6941  |  6947  | 
|  6942     __ bind(&dont_need_remembered_set); |  6948     __ bind(&dont_need_remembered_set); | 
|  6943   } |  6949   } | 
|  6944  |  6950  | 
|  6945   CheckNeedsToInformIncrementalMarker( |  6951   CheckNeedsToInformIncrementalMarker( | 
|  6946       masm, kReturnOnNoNeedToInformIncrementalMarker, mode); |  6952       masm, kReturnOnNoNeedToInformIncrementalMarker, mode); | 
|  6947   InformIncrementalMarker(masm, mode); |  6953   InformIncrementalMarker(masm, mode); | 
|  6948   regs_.Restore(masm); |  6954   regs_.Restore(masm); | 
|  6949   __ Ret(); |  6955   __ Ret(); | 
|  6950 } |  6956 } | 
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  6992   Label on_black; |  6998   Label on_black; | 
|  6993   Label need_incremental; |  6999   Label need_incremental; | 
|  6994   Label need_incremental_pop_scratch; |  7000   Label need_incremental_pop_scratch; | 
|  6995  |  7001  | 
|  6996   // Let's look at the color of the object:  If it is not black we don't have |  7002   // Let's look at the color of the object:  If it is not black we don't have | 
|  6997   // to inform the incremental marker. |  7003   // to inform the incremental marker. | 
|  6998   __ JumpIfBlack(regs_.object(), regs_.scratch0(), regs_.scratch1(), &on_black); |  7004   __ JumpIfBlack(regs_.object(), regs_.scratch0(), regs_.scratch1(), &on_black); | 
|  6999  |  7005  | 
|  7000   regs_.Restore(masm); |  7006   regs_.Restore(masm); | 
|  7001   if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) { |  7007   if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) { | 
|  7002     __ RememberedSetHelper( |  7008     __ RememberedSetHelper(object_, | 
|  7003         address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd); |  7009                            address_, | 
 |  7010                            value_, | 
 |  7011                            save_fp_regs_mode_, | 
 |  7012                            MacroAssembler::kReturnAtEnd); | 
|  7004   } else { |  7013   } else { | 
|  7005     __ Ret(); |  7014     __ Ret(); | 
|  7006   } |  7015   } | 
|  7007  |  7016  | 
|  7008   __ bind(&on_black); |  7017   __ bind(&on_black); | 
|  7009  |  7018  | 
|  7010   // Get the value from the slot. |  7019   // Get the value from the slot. | 
|  7011   __ ldr(regs_.scratch0(), MemOperand(regs_.address(), 0)); |  7020   __ ldr(regs_.scratch0(), MemOperand(regs_.address(), 0)); | 
|  7012  |  7021  | 
|  7013   if (mode == INCREMENTAL_COMPACTION) { |  7022   if (mode == INCREMENTAL_COMPACTION) { | 
| (...skipping 19 matching lines...) Expand all  Loading... | 
|  7033   __ Push(regs_.object(), regs_.address()); |  7042   __ Push(regs_.object(), regs_.address()); | 
|  7034   __ EnsureNotWhite(regs_.scratch0(),  // The value. |  7043   __ EnsureNotWhite(regs_.scratch0(),  // The value. | 
|  7035                     regs_.scratch1(),  // Scratch. |  7044                     regs_.scratch1(),  // Scratch. | 
|  7036                     regs_.object(),  // Scratch. |  7045                     regs_.object(),  // Scratch. | 
|  7037                     regs_.address(),  // Scratch. |  7046                     regs_.address(),  // Scratch. | 
|  7038                     &need_incremental_pop_scratch); |  7047                     &need_incremental_pop_scratch); | 
|  7039   __ Pop(regs_.object(), regs_.address()); |  7048   __ Pop(regs_.object(), regs_.address()); | 
|  7040  |  7049  | 
|  7041   regs_.Restore(masm); |  7050   regs_.Restore(masm); | 
|  7042   if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) { |  7051   if (on_no_need == kUpdateRememberedSetOnNoNeedToInformIncrementalMarker) { | 
|  7043     __ RememberedSetHelper( |  7052     __ RememberedSetHelper(object_, | 
|  7044         address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd); |  7053                            address_, | 
 |  7054                            value_, | 
 |  7055                            save_fp_regs_mode_, | 
 |  7056                            MacroAssembler::kReturnAtEnd); | 
|  7045   } else { |  7057   } else { | 
|  7046     __ Ret(); |  7058     __ Ret(); | 
|  7047   } |  7059   } | 
|  7048  |  7060  | 
|  7049   __ bind(&need_incremental_pop_scratch); |  7061   __ bind(&need_incremental_pop_scratch); | 
|  7050   __ Pop(regs_.object(), regs_.address()); |  7062   __ Pop(regs_.object(), regs_.address()); | 
|  7051  |  7063  | 
|  7052   __ bind(&need_incremental); |  7064   __ bind(&need_incremental); | 
|  7053  |  7065  | 
|  7054   // Fall through when we need to inform the incremental marker. |  7066   // Fall through when we need to inform the incremental marker. | 
|  7055 } |  7067 } | 
|  7056  |  7068  | 
|  7057  |  7069  | 
|  7058 #undef __ |  7070 #undef __ | 
|  7059  |  7071  | 
|  7060 } }  // namespace v8::internal |  7072 } }  // namespace v8::internal | 
|  7061  |  7073  | 
|  7062 #endif  // V8_TARGET_ARCH_ARM |  7074 #endif  // V8_TARGET_ARCH_ARM | 
| OLD | NEW |