| 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 | 390 |
| 391 RecordWriteStub::Mode mode = is_compacting_ ? | 391 RecordWriteStub::Mode mode = is_compacting_ ? |
| 392 RecordWriteStub::INCREMENTAL_COMPACTION : RecordWriteStub::INCREMENTAL; | 392 RecordWriteStub::INCREMENTAL_COMPACTION : RecordWriteStub::INCREMENTAL; |
| 393 | 393 |
| 394 PatchIncrementalMarkingRecordWriteStubs(heap_, mode); | 394 PatchIncrementalMarkingRecordWriteStubs(heap_, mode); |
| 395 | 395 |
| 396 EnsureMarkingDequeIsCommitted(); | 396 EnsureMarkingDequeIsCommitted(); |
| 397 | 397 |
| 398 // Initialize marking stack. | 398 // Initialize marking stack. |
| 399 Address addr = static_cast<Address>(marking_deque_memory_->address()); | 399 Address addr = static_cast<Address>(marking_deque_memory_->address()); |
| 400 int size = marking_deque_memory_->size(); | 400 size_t size = marking_deque_memory_->size(); |
| 401 if (FLAG_force_marking_deque_overflows) size = 64 * kPointerSize; | 401 if (FLAG_force_marking_deque_overflows) size = 64 * kPointerSize; |
| 402 marking_deque_.Initialize(addr, addr + size); | 402 marking_deque_.Initialize(addr, addr + size); |
| 403 | 403 |
| 404 // Clear markbits. | 404 // Clear markbits. |
| 405 ClearMarkbits(); | 405 ClearMarkbits(); |
| 406 | 406 |
| 407 #ifdef DEBUG | 407 #ifdef DEBUG |
| 408 VerifyMarkbitsAreClean(); | 408 VerifyMarkbitsAreClean(); |
| 409 #endif | 409 #endif |
| 410 | 410 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 425 heap_->new_space()->FromSpaceEnd()); | 425 heap_->new_space()->FromSpaceEnd()); |
| 426 while (it.has_next()) { | 426 while (it.has_next()) { |
| 427 Bitmap::Clear(it.next()); | 427 Bitmap::Clear(it.next()); |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 | 430 |
| 431 | 431 |
| 432 void IncrementalMarking::UpdateMarkingDequeAfterScavenge() { | 432 void IncrementalMarking::UpdateMarkingDequeAfterScavenge() { |
| 433 if (!IsMarking()) return; | 433 if (!IsMarking()) return; |
| 434 | 434 |
| 435 intptr_t current = marking_deque_.bottom(); | 435 int current = marking_deque_.bottom(); |
| 436 intptr_t mask = marking_deque_.mask(); | 436 int mask = marking_deque_.mask(); |
| 437 intptr_t limit = marking_deque_.top(); | 437 int limit = marking_deque_.top(); |
| 438 HeapObject** array = marking_deque_.array(); | 438 HeapObject** array = marking_deque_.array(); |
| 439 intptr_t new_top = current; | 439 int new_top = current; |
| 440 | 440 |
| 441 Map* filler_map = heap_->one_pointer_filler_map(); | 441 Map* filler_map = heap_->one_pointer_filler_map(); |
| 442 | 442 |
| 443 while (current != limit) { | 443 while (current != limit) { |
| 444 HeapObject* obj = array[current]; | 444 HeapObject* obj = array[current]; |
| 445 ASSERT(obj->IsHeapObject()); | 445 ASSERT(obj->IsHeapObject()); |
| 446 current = ((current + 1) & mask); | 446 current = ((current + 1) & mask); |
| 447 if (heap_->InNewSpace(obj)) { | 447 if (heap_->InNewSpace(obj)) { |
| 448 MapWord map_word = obj->map_word(); | 448 MapWord map_word = obj->map_word(); |
| 449 if (map_word.IsForwardingAddress()) { | 449 if (map_word.IsForwardingAddress()) { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 if (FLAG_trace_incremental_marking || FLAG_trace_gc) { | 622 if (FLAG_trace_incremental_marking || FLAG_trace_gc) { |
| 623 double end = OS::TimeCurrentMillis(); | 623 double end = OS::TimeCurrentMillis(); |
| 624 double delta = (end - start); | 624 double delta = (end - start); |
| 625 steps_took_ += delta; | 625 steps_took_ += delta; |
| 626 steps_took_since_last_gc_ += delta; | 626 steps_took_since_last_gc_ += delta; |
| 627 } | 627 } |
| 628 } | 628 } |
| 629 | 629 |
| 630 | 630 |
| 631 } } // namespace v8::internal | 631 } } // namespace v8::internal |
| OLD | NEW |