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

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

Issue 8519002: Start incremental marking on idle notification. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month 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
OLDNEW
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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 state_ = COMPLETE; 737 state_ = COMPLETE;
738 // We will set the stack guard to request a GC now. This will mean the rest 738 // We will set the stack guard to request a GC now. This will mean the rest
739 // of the GC gets performed as soon as possible (we can't do a GC here in a 739 // of the GC gets performed as soon as possible (we can't do a GC here in a
740 // record-write context). If a few things get allocated between now and then 740 // record-write context). If a few things get allocated between now and then
741 // that shouldn't make us do a scavenge and keep being incremental, so we set 741 // that shouldn't make us do a scavenge and keep being incremental, so we set
742 // the should-hurry flag to indicate that there can't be much work left to do. 742 // the should-hurry flag to indicate that there can't be much work left to do.
743 set_should_hurry(true); 743 set_should_hurry(true);
744 if (FLAG_trace_incremental_marking) { 744 if (FLAG_trace_incremental_marking) {
745 PrintF("[IncrementalMarking] Complete (normal).\n"); 745 PrintF("[IncrementalMarking] Complete (normal).\n");
746 } 746 }
747 heap_->isolate()->stack_guard()->RequestGC(); 747 if (!heap_->idle_notification_will_schedule_next_gc()) {
748 heap_->isolate()->stack_guard()->RequestGC();
749 }
748 } 750 }
749 751
750 752
751 void IncrementalMarking::Step(intptr_t allocated_bytes) { 753 void IncrementalMarking::Step(intptr_t allocated_bytes) {
752 if (heap_->gc_state() != Heap::NOT_IN_GC || 754 if (heap_->gc_state() != Heap::NOT_IN_GC ||
753 !FLAG_incremental_marking || 755 !FLAG_incremental_marking ||
754 !FLAG_incremental_marking_steps || 756 !FLAG_incremental_marking_steps ||
755 (state_ != SWEEPING && state_ != MARKING)) { 757 (state_ != SWEEPING && state_ != MARKING)) {
756 return; 758 return;
757 } 759 }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 allocation_marking_factor_ = kInitialAllocationMarkingFactor; 913 allocation_marking_factor_ = kInitialAllocationMarkingFactor;
912 bytes_scanned_ = 0; 914 bytes_scanned_ = 0;
913 } 915 }
914 916
915 917
916 int64_t IncrementalMarking::SpaceLeftInOldSpace() { 918 int64_t IncrementalMarking::SpaceLeftInOldSpace() {
917 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize(); 919 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize();
918 } 920 }
919 921
920 } } // namespace v8::internal 922 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698