| 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 6240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6251 } else { | 6251 } else { |
| 6252 __ ret(0); | 6252 __ ret(0); |
| 6253 } | 6253 } |
| 6254 | 6254 |
| 6255 __ bind(&skip_to_incremental_noncompacting); | 6255 __ bind(&skip_to_incremental_noncompacting); |
| 6256 GenerateIncremental(masm, INCREMENTAL); | 6256 GenerateIncremental(masm, INCREMENTAL); |
| 6257 | 6257 |
| 6258 __ bind(&skip_to_incremental_compacting); | 6258 __ bind(&skip_to_incremental_compacting); |
| 6259 GenerateIncremental(masm, INCREMENTAL_COMPACTION); | 6259 GenerateIncremental(masm, INCREMENTAL_COMPACTION); |
| 6260 | 6260 |
| 6261 if (!masm->isolate()->heap()->incremental_marking()->IsMarking()) { | 6261 // TODO(gc) ensure that GC can't happen after stub was generated by before |
| 6262 // it was added to a stub cache. |
| 6263 IncrementalMarking* marking = masm->isolate()->heap()->incremental_marking(); |
| 6264 if (!marking->IsMarking() || marking->IsCompacting()) { |
| 6262 ASSERT(masm->byte_at(0) == kTwoByteJumpInstruction); | 6265 ASSERT(masm->byte_at(0) == kTwoByteJumpInstruction); |
| 6263 masm->set_byte_at(0, kTwoByteNopInstruction); | 6266 masm->set_byte_at(0, kTwoByteNopInstruction); |
| 6264 } | 6267 } |
| 6265 | 6268 |
| 6266 if (!masm->isolate()->heap()->incremental_marking()->IsMarking()) { | 6269 if (!marking->IsMarking()) { |
| 6267 ASSERT(masm->byte_at(2) == kFiveByteJumpInstruction); | 6270 ASSERT(masm->byte_at(2) == kFiveByteJumpInstruction); |
| 6268 masm->set_byte_at(2, kFiveByteNopInstruction); | 6271 masm->set_byte_at(2, kFiveByteNopInstruction); |
| 6269 } | 6272 } |
| 6270 } | 6273 } |
| 6271 | 6274 |
| 6272 | 6275 |
| 6273 void RecordWriteStub::GenerateIncremental(MacroAssembler* masm, Mode mode) { | 6276 void RecordWriteStub::GenerateIncremental(MacroAssembler* masm, Mode mode) { |
| 6274 regs_.Save(masm); | 6277 regs_.Save(masm); |
| 6275 | 6278 |
| 6276 if (remembered_set_action_ == EMIT_REMEMBERED_SET) { | 6279 if (remembered_set_action_ == EMIT_REMEMBERED_SET) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 6304 CheckNeedsToInformIncrementalMarker( | 6307 CheckNeedsToInformIncrementalMarker( |
| 6305 masm, | 6308 masm, |
| 6306 kReturnOnNoNeedToInformIncrementalMarker, | 6309 kReturnOnNoNeedToInformIncrementalMarker, |
| 6307 mode); | 6310 mode); |
| 6308 InformIncrementalMarker(masm, mode); | 6311 InformIncrementalMarker(masm, mode); |
| 6309 regs_.Restore(masm); | 6312 regs_.Restore(masm); |
| 6310 __ ret(0); | 6313 __ ret(0); |
| 6311 } | 6314 } |
| 6312 | 6315 |
| 6313 | 6316 |
| 6314 void RecordWriteStub::InformIncrementalMarker( | 6317 void RecordWriteStub::InformIncrementalMarker(MacroAssembler* masm, Mode mode) { |
| 6315 MacroAssembler* masm, | |
| 6316 RecordWriteStub::Mode mode) { | |
| 6317 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_); | 6318 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_); |
| 6318 int argument_count = 3; | 6319 int argument_count = 3; |
| 6319 __ PrepareCallCFunction(argument_count, regs_.scratch0()); | 6320 __ PrepareCallCFunction(argument_count, regs_.scratch0()); |
| 6320 __ mov(Operand(esp, 0 * kPointerSize), regs_.object()); | 6321 __ mov(Operand(esp, 0 * kPointerSize), regs_.object()); |
| 6321 if (mode == INCREMENTAL_COMPACTION) { | 6322 if (mode == INCREMENTAL_COMPACTION) { |
| 6322 __ mov(Operand(esp, 1 * kPointerSize), regs_.address()); // Slot. | 6323 __ mov(Operand(esp, 1 * kPointerSize), regs_.address()); // Slot. |
| 6323 } else { | 6324 } else { |
| 6324 ASSERT(mode == INCREMENTAL); | 6325 ASSERT(mode == INCREMENTAL); |
| 6325 __ mov(regs_.scratch0(), Operand(regs_.address(), 0)); | 6326 __ mov(regs_.scratch0(), Operand(regs_.address(), 0)); |
| 6326 __ mov(Operand(esp, 1 * kPointerSize), regs_.scratch0()); // Value. | 6327 __ mov(Operand(esp, 1 * kPointerSize), regs_.scratch0()); // Value. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 6341 ExternalReference::incremental_marking_record_write_function( | 6342 ExternalReference::incremental_marking_record_write_function( |
| 6342 masm->isolate()), | 6343 masm->isolate()), |
| 6343 argument_count); | 6344 argument_count); |
| 6344 } | 6345 } |
| 6345 regs_.RestoreCallerSaveRegisters(masm, save_fp_regs_mode_); | 6346 regs_.RestoreCallerSaveRegisters(masm, save_fp_regs_mode_); |
| 6346 } | 6347 } |
| 6347 | 6348 |
| 6348 | 6349 |
| 6349 void RecordWriteStub::CheckNeedsToInformIncrementalMarker( | 6350 void RecordWriteStub::CheckNeedsToInformIncrementalMarker( |
| 6350 MacroAssembler* masm, | 6351 MacroAssembler* masm, |
| 6351 RecordWriteStub::OnNoNeedToInformIncrementalMarker on_no_need, | 6352 OnNoNeedToInformIncrementalMarker on_no_need, |
| 6352 RecordWriteStub::Mode mode) { | 6353 Mode mode) { |
| 6353 Label object_is_black, need_incremental, need_incremental_pop_object; | 6354 Label object_is_black, need_incremental, need_incremental_pop_object; |
| 6354 | 6355 |
| 6355 // Let's look at the color of the object: If it is not black we don't have | 6356 // Let's look at the color of the object: If it is not black we don't have |
| 6356 // to inform the incremental marker. | 6357 // to inform the incremental marker. |
| 6357 __ JumpIfBlack(regs_.object(), | 6358 __ JumpIfBlack(regs_.object(), |
| 6358 regs_.scratch0(), | 6359 regs_.scratch0(), |
| 6359 regs_.scratch1(), | 6360 regs_.scratch1(), |
| 6360 &object_is_black, | 6361 &object_is_black, |
| 6361 Label::kNear); | 6362 Label::kNear); |
| 6362 | 6363 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6420 | 6421 |
| 6421 // Fall through when we need to inform the incremental marker. | 6422 // Fall through when we need to inform the incremental marker. |
| 6422 } | 6423 } |
| 6423 | 6424 |
| 6424 | 6425 |
| 6425 #undef __ | 6426 #undef __ |
| 6426 | 6427 |
| 6427 } } // namespace v8::internal | 6428 } } // namespace v8::internal |
| 6428 | 6429 |
| 6429 #endif // V8_TARGET_ARCH_IA32 | 6430 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |