Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: src/incremental-marking.cc

Issue 12527011: Integrate concurrent sweeping with incremental marking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 bool success = marking_deque_memory_->Uncommit( 555 bool success = marking_deque_memory_->Uncommit(
556 reinterpret_cast<Address>(marking_deque_memory_->address()), 556 reinterpret_cast<Address>(marking_deque_memory_->address()),
557 marking_deque_memory_->size()); 557 marking_deque_memory_->size());
558 CHECK(success); 558 CHECK(success);
559 marking_deque_memory_committed_ = false; 559 marking_deque_memory_committed_ = false;
560 } 560 }
561 } 561 }
562 562
563 563
564 void IncrementalMarking::Start() { 564 void IncrementalMarking::Start() {
565 ASSERT(!heap_->mark_compact_collector()->IsConcurrentSweepingInProgress());
566 if (FLAG_trace_incremental_marking) { 565 if (FLAG_trace_incremental_marking) {
567 PrintF("[IncrementalMarking] Start\n"); 566 PrintF("[IncrementalMarking] Start\n");
568 } 567 }
569 ASSERT(FLAG_incremental_marking); 568 ASSERT(FLAG_incremental_marking);
570 ASSERT(state_ == STOPPED); 569 ASSERT(state_ == STOPPED);
571 570
572 ResetStepCounters(); 571 ResetStepCounters();
573 572
574 if (heap_->IsSweepingComplete()) { 573 if (heap_->IsSweepingComplete()) {
575 StartMarking(ALLOW_COMPACTION); 574 StartMarking(ALLOW_COMPACTION);
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 bytes_scanned_ += bytes_to_process; 893 bytes_scanned_ += bytes_to_process;
895 894
896 double start = 0; 895 double start = 0;
897 896
898 if (FLAG_trace_incremental_marking || FLAG_trace_gc || 897 if (FLAG_trace_incremental_marking || FLAG_trace_gc ||
899 FLAG_print_cumulative_gc_stat) { 898 FLAG_print_cumulative_gc_stat) {
900 start = OS::TimeCurrentMillis(); 899 start = OS::TimeCurrentMillis();
901 } 900 }
902 901
903 if (state_ == SWEEPING) { 902 if (state_ == SWEEPING) {
904 if (heap_->AdvanceSweepers(static_cast<int>(bytes_to_process))) { 903 if (heap_->EnsureSweepersProgressed(static_cast<int>(bytes_to_process))) {
905 bytes_scanned_ = 0; 904 bytes_scanned_ = 0;
906 StartMarking(PREVENT_COMPACTION); 905 StartMarking(PREVENT_COMPACTION);
907 } 906 }
908 } else if (state_ == MARKING) { 907 } else if (state_ == MARKING) {
909 ProcessMarkingDeque(bytes_to_process); 908 ProcessMarkingDeque(bytes_to_process);
910 if (marking_deque_.IsEmpty()) MarkingComplete(action); 909 if (marking_deque_.IsEmpty()) MarkingComplete(action);
911 } 910 }
912 911
913 steps_count_++; 912 steps_count_++;
914 steps_count_since_last_gc_++; 913 steps_count_since_last_gc_++;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 bytes_scanned_ = 0; 1002 bytes_scanned_ = 0;
1004 write_barriers_invoked_since_last_step_ = 0; 1003 write_barriers_invoked_since_last_step_ = 0;
1005 } 1004 }
1006 1005
1007 1006
1008 int64_t IncrementalMarking::SpaceLeftInOldSpace() { 1007 int64_t IncrementalMarking::SpaceLeftInOldSpace() {
1009 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); 1008 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects();
1010 } 1009 }
1011 1010
1012 } } // namespace v8::internal 1011 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698