OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 allocation_timeout_ = Max(6, FLAG_gc_interval); | 492 allocation_timeout_ = Max(6, FLAG_gc_interval); |
493 #endif | 493 #endif |
494 | 494 |
495 if (collector == SCAVENGER && !incremental_marking()->IsStopped()) { | 495 if (collector == SCAVENGER && !incremental_marking()->IsStopped()) { |
496 if (FLAG_trace_incremental_marking) { | 496 if (FLAG_trace_incremental_marking) { |
497 PrintF("[IncrementalMarking] Scavenge during marking.\n"); | 497 PrintF("[IncrementalMarking] Scavenge during marking.\n"); |
498 } | 498 } |
499 } | 499 } |
500 | 500 |
501 if (collector == MARK_COMPACTOR && | 501 if (collector == MARK_COMPACTOR && |
502 !mark_compact_collector()->PreciseSweepingRequired() && | 502 !mark_compact_collector()->abort_incremental_marking_ && |
503 !incremental_marking()->IsStopped() && | 503 !incremental_marking()->IsStopped() && |
504 !incremental_marking()->should_hurry() && | 504 !incremental_marking()->should_hurry() && |
505 FLAG_incremental_marking_steps) { | 505 FLAG_incremental_marking_steps) { |
506 if (FLAG_trace_incremental_marking) { | 506 if (FLAG_trace_incremental_marking) { |
507 PrintF("[IncrementalMarking] Delaying MarkSweep.\n"); | 507 PrintF("[IncrementalMarking] Delaying MarkSweep.\n"); |
508 } | 508 } |
509 collector = SCAVENGER; | 509 collector = SCAVENGER; |
510 collector_reason = "incremental marking delaying mark-sweep"; | 510 collector_reason = "incremental marking delaying mark-sweep"; |
511 } | 511 } |
512 | 512 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 SymbolTableVerifier verifier; | 575 SymbolTableVerifier verifier; |
576 HEAP->symbol_table()->IterateElements(&verifier); | 576 HEAP->symbol_table()->IterateElements(&verifier); |
577 #endif // DEBUG | 577 #endif // DEBUG |
578 } | 578 } |
579 | 579 |
580 | 580 |
581 static bool AbortIncrementalMarkingAndCollectGarbage( | 581 static bool AbortIncrementalMarkingAndCollectGarbage( |
582 Heap* heap, | 582 Heap* heap, |
583 AllocationSpace space, | 583 AllocationSpace space, |
584 const char* gc_reason = NULL) { | 584 const char* gc_reason = NULL) { |
585 heap->mark_compact_collector()->SetFlags(Heap::kMakeHeapIterableMask); | 585 heap->mark_compact_collector()->SetFlags(Heap::kAbortIncrementalMarkingMask); |
586 bool result = heap->CollectGarbage(space, gc_reason); | 586 bool result = heap->CollectGarbage(space, gc_reason); |
587 heap->mark_compact_collector()->SetFlags(Heap::kNoGCFlags); | 587 heap->mark_compact_collector()->SetFlags(Heap::kNoGCFlags); |
588 return result; | 588 return result; |
589 } | 589 } |
590 | 590 |
591 | 591 |
592 void Heap::ReserveSpace( | 592 void Heap::ReserveSpace( |
593 int new_space_size, | 593 int new_space_size, |
594 int pointer_space_size, | 594 int pointer_space_size, |
595 int data_space_size, | 595 int data_space_size, |
(...skipping 6356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6952 isolate_->heap()->store_buffer()->Compact(); | 6952 isolate_->heap()->store_buffer()->Compact(); |
6953 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); | 6953 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); |
6954 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { | 6954 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { |
6955 next = chunk->next_chunk(); | 6955 next = chunk->next_chunk(); |
6956 isolate_->memory_allocator()->Free(chunk); | 6956 isolate_->memory_allocator()->Free(chunk); |
6957 } | 6957 } |
6958 chunks_queued_for_free_ = NULL; | 6958 chunks_queued_for_free_ = NULL; |
6959 } | 6959 } |
6960 | 6960 |
6961 } } // namespace v8::internal | 6961 } } // namespace v8::internal |
OLD | NEW |