| 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 6249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6260 } | 6260 } |
| 6261 | 6261 |
| 6262 | 6262 |
| 6263 void RecordWriteStub::GenerateIncremental(MacroAssembler* masm) { | 6263 void RecordWriteStub::GenerateIncremental(MacroAssembler* masm) { |
| 6264 regs_.Save(masm); | 6264 regs_.Save(masm); |
| 6265 | 6265 |
| 6266 if (remembered_set_action_ == EMIT_REMEMBERED_SET) { | 6266 if (remembered_set_action_ == EMIT_REMEMBERED_SET) { |
| 6267 Label dont_need_remembered_set; | 6267 Label dont_need_remembered_set; |
| 6268 | 6268 |
| 6269 __ mov(regs_.scratch0(), Operand(regs_.address(), 0)); | 6269 __ mov(regs_.scratch0(), Operand(regs_.address(), 0)); |
| 6270 __ InNewSpace(regs_.scratch0(), | 6270 __ JumpIfNotInNewSpace(regs_.scratch0(), |
| 6271 regs_.scratch0(), | 6271 regs_.scratch0(), |
| 6272 zero, | 6272 &dont_need_remembered_set); |
| 6273 &dont_need_remembered_set); | |
| 6274 | 6273 |
| 6275 __ CheckPageFlag(regs_.object(), | 6274 __ CheckPageFlag(regs_.object(), |
| 6276 regs_.scratch0(), | 6275 regs_.scratch0(), |
| 6277 MemoryChunk::SCAN_ON_SCAVENGE, | 6276 MemoryChunk::SCAN_ON_SCAVENGE, |
| 6278 not_zero, | 6277 not_zero, |
| 6279 &dont_need_remembered_set); | 6278 &dont_need_remembered_set); |
| 6280 | 6279 |
| 6281 // First notify the incremental marker if necessary, then update the | 6280 // First notify the incremental marker if necessary, then update the |
| 6282 // remembered set. | 6281 // remembered set. |
| 6283 CheckNeedsToInformIncrementalMarker( | 6282 CheckNeedsToInformIncrementalMarker( |
| 6284 masm, kRememberedSetOnNoNeedToInformIncrementalMarker); | 6283 masm, kRememberedSetOnNoNeedToInformIncrementalMarker); |
| 6285 InformIncrementalMarker(masm); | 6284 InformIncrementalMarker(masm); |
| 6286 regs_.Restore(masm); | 6285 regs_.Restore(masm); |
| 6287 __ RememberedSetHelper( | 6286 __ RememberedSetHelper( |
| 6288 address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd); | 6287 address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd); |
| 6289 | 6288 |
| 6290 __ bind(&dont_need_remembered_set); | 6289 __ bind(&dont_need_remembered_set); |
| 6291 } | 6290 } |
| 6292 | 6291 |
| 6293 CheckNeedsToInformIncrementalMarker( | 6292 CheckNeedsToInformIncrementalMarker( |
| 6294 masm, kReturnOnNoNeedToInformIncrementalMarker); | 6293 masm, kReturnOnNoNeedToInformIncrementalMarker); |
| 6295 InformIncrementalMarker(masm); | 6294 InformIncrementalMarker(masm); |
| 6296 regs_.Restore(masm); | 6295 regs_.Restore(masm); |
| 6297 __ ret(0); | 6296 __ ret(0); |
| 6298 } | 6297 } |
| 6299 | 6298 |
| 6300 | 6299 |
| 6301 void RecordWriteStub::InformIncrementalMarker(MacroAssembler* masm) { | 6300 void RecordWriteStub::InformIncrementalMarker(MacroAssembler* masm) { |
| 6302 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_); | 6301 regs_.SaveCallerSaveRegisters(masm, save_fp_regs_mode_); |
| 6303 // TODO(gc) we are assuming that xmm registers are not modified by | |
| 6304 // the C function we are calling. | |
| 6305 int argument_count = 3; | 6302 int argument_count = 3; |
| 6306 __ PrepareCallCFunction(argument_count, regs_.scratch0()); | 6303 __ PrepareCallCFunction(argument_count, regs_.scratch0()); |
| 6307 __ mov(Operand(esp, 0 * kPointerSize), regs_.object()); | 6304 __ mov(Operand(esp, 0 * kPointerSize), regs_.object()); |
| 6308 __ mov(regs_.scratch0(), Operand(regs_.address(), 0)); | 6305 __ mov(regs_.scratch0(), Operand(regs_.address(), 0)); |
| 6309 __ mov(Operand(esp, 1 * kPointerSize), regs_.scratch0()); // Value. | 6306 __ mov(Operand(esp, 1 * kPointerSize), regs_.scratch0()); // Value. |
| 6310 __ mov(Operand(esp, 2 * kPointerSize), | 6307 __ mov(Operand(esp, 2 * kPointerSize), |
| 6311 Immediate(ExternalReference::isolate_address())); | 6308 Immediate(ExternalReference::isolate_address())); |
| 6312 // TODO(gc): Create a fast version of this C function that does not duplicate | 6309 // TODO(gc): Create a fast version of this C function that does not duplicate |
| 6313 // the checks done in the stub. | 6310 // the checks done in the stub. |
| 6314 __ CallCFunction( | 6311 __ CallCFunction( |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6368 | 6365 |
| 6369 // Fall through when we need to inform the incremental marker. | 6366 // Fall through when we need to inform the incremental marker. |
| 6370 } | 6367 } |
| 6371 | 6368 |
| 6372 | 6369 |
| 6373 #undef __ | 6370 #undef __ |
| 6374 | 6371 |
| 6375 } } // namespace v8::internal | 6372 } } // namespace v8::internal |
| 6376 | 6373 |
| 6377 #endif // V8_TARGET_ARCH_IA32 | 6374 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |