OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 4519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4530 __ CheckPageFlag(regs_.object(), | 4530 __ CheckPageFlag(regs_.object(), |
4531 regs_.scratch0(), | 4531 regs_.scratch0(), |
4532 1 << MemoryChunk::SCAN_ON_SCAVENGE, | 4532 1 << MemoryChunk::SCAN_ON_SCAVENGE, |
4533 not_zero, | 4533 not_zero, |
4534 &dont_need_remembered_set); | 4534 &dont_need_remembered_set); |
4535 | 4535 |
4536 // First notify the incremental marker if necessary, then update the | 4536 // First notify the incremental marker if necessary, then update the |
4537 // remembered set. | 4537 // remembered set. |
4538 CheckNeedsToInformIncrementalMarker( | 4538 CheckNeedsToInformIncrementalMarker( |
4539 masm, kUpdateRememberedSetOnNoNeedToInformIncrementalMarker, mode); | 4539 masm, kUpdateRememberedSetOnNoNeedToInformIncrementalMarker, mode); |
4540 InformIncrementalMarker(masm, mode); | 4540 InformIncrementalMarker(masm); |
4541 regs_.Restore(masm); | 4541 regs_.Restore(masm); |
4542 __ RememberedSetHelper(object_, | 4542 __ RememberedSetHelper(object_, |
4543 address_, | 4543 address_, |
4544 value_, | 4544 value_, |
4545 save_fp_regs_mode_, | 4545 save_fp_regs_mode_, |
4546 MacroAssembler::kReturnAtEnd); | 4546 MacroAssembler::kReturnAtEnd); |
4547 | 4547 |
4548 __ bind(&dont_need_remembered_set); | 4548 __ bind(&dont_need_remembered_set); |
4549 } | 4549 } |
4550 | 4550 |
4551 CheckNeedsToInformIncrementalMarker( | 4551 CheckNeedsToInformIncrementalMarker( |
4552 masm, kReturnOnNoNeedToInformIncrementalMarker, mode); | 4552 masm, kReturnOnNoNeedToInformIncrementalMarker, mode); |
4553 InformIncrementalMarker(masm, mode); | 4553 InformIncrementalMarker(masm); |
4554 regs_.Restore(masm); | 4554 regs_.Restore(masm); |
4555 __ ret(0); | 4555 __ ret(0); |
4556 } | 4556 } |
4557 | 4557 |
4558 | 4558 |
4559 void RecordWriteStub::InformIncrementalMarker(MacroAssembler* masm, Mode mode) { | 4559 void RecordWriteStub::InformIncrementalMarker(MacroAssembler* masm) { |
4560 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_); | 4560 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_); |
4561 Register address = | 4561 Register address = |
4562 arg_reg_1.is(regs_.address()) ? kScratchRegister : regs_.address(); | 4562 arg_reg_1.is(regs_.address()) ? kScratchRegister : regs_.address(); |
4563 ASSERT(!address.is(regs_.object())); | 4563 ASSERT(!address.is(regs_.object())); |
4564 ASSERT(!address.is(arg_reg_1)); | 4564 ASSERT(!address.is(arg_reg_1)); |
4565 __ Move(address, regs_.address()); | 4565 __ Move(address, regs_.address()); |
4566 __ Move(arg_reg_1, regs_.object()); | 4566 __ Move(arg_reg_1, regs_.object()); |
4567 // TODO(gc) Can we just set address arg2 in the beginning? | 4567 // TODO(gc) Can we just set address arg2 in the beginning? |
4568 __ Move(arg_reg_2, address); | 4568 __ Move(arg_reg_2, address); |
4569 __ LoadAddress(arg_reg_3, | 4569 __ LoadAddress(arg_reg_3, |
4570 ExternalReference::isolate_address(masm->isolate())); | 4570 ExternalReference::isolate_address(masm->isolate())); |
4571 int argument_count = 3; | 4571 int argument_count = 3; |
4572 | 4572 |
4573 AllowExternalCallThatCantCauseGC scope(masm); | 4573 AllowExternalCallThatCantCauseGC scope(masm); |
4574 __ PrepareCallCFunction(argument_count); | 4574 __ PrepareCallCFunction(argument_count); |
4575 if (mode == INCREMENTAL_COMPACTION) { | 4575 __ CallCFunction( |
4576 __ CallCFunction( | 4576 ExternalReference::incremental_marking_record_write_function( |
4577 ExternalReference::incremental_evacuation_record_write_function( | 4577 masm->isolate()), |
4578 masm->isolate()), | 4578 argument_count); |
4579 argument_count); | |
4580 } else { | |
4581 ASSERT(mode == INCREMENTAL); | |
4582 __ CallCFunction( | |
4583 ExternalReference::incremental_marking_record_write_function( | |
4584 masm->isolate()), | |
4585 argument_count); | |
4586 } | |
4587 regs_.RestoreCallerSaveRegisters(masm, save_fp_regs_mode_); | 4579 regs_.RestoreCallerSaveRegisters(masm, save_fp_regs_mode_); |
4588 } | 4580 } |
4589 | 4581 |
4590 | 4582 |
4591 void RecordWriteStub::CheckNeedsToInformIncrementalMarker( | 4583 void RecordWriteStub::CheckNeedsToInformIncrementalMarker( |
4592 MacroAssembler* masm, | 4584 MacroAssembler* masm, |
4593 OnNoNeedToInformIncrementalMarker on_no_need, | 4585 OnNoNeedToInformIncrementalMarker on_no_need, |
4594 Mode mode) { | 4586 Mode mode) { |
4595 Label on_black; | 4587 Label on_black; |
4596 Label need_incremental; | 4588 Label need_incremental; |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5329 return_value_operand, | 5321 return_value_operand, |
5330 NULL); | 5322 NULL); |
5331 } | 5323 } |
5332 | 5324 |
5333 | 5325 |
5334 #undef __ | 5326 #undef __ |
5335 | 5327 |
5336 } } // namespace v8::internal | 5328 } } // namespace v8::internal |
5337 | 5329 |
5338 #endif // V8_TARGET_ARCH_X64 | 5330 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |