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

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

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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 bool should_hurry() { return should_hurry_; } 58 bool should_hurry() { return should_hurry_; }
59 59
60 inline bool IsStopped() { return state() == STOPPED; } 60 inline bool IsStopped() { return state() == STOPPED; }
61 61
62 INLINE(bool IsMarking()) { return state() >= MARKING; } 62 INLINE(bool IsMarking()) { return state() >= MARKING; }
63 63
64 inline bool IsMarkingIncomplete() { return state() == MARKING; } 64 inline bool IsMarkingIncomplete() { return state() == MARKING; }
65 65
66 inline bool IsComplete() { return state() == COMPLETE; }
67
66 bool WorthActivating(); 68 bool WorthActivating();
67 69
68 void Start(); 70 void Start();
69 71
70 void Stop(); 72 void Stop();
71 73
72 void PrepareForScavenge(); 74 void PrepareForScavenge();
73 75
74 void UpdateMarkingDequeAfterScavenge(); 76 void UpdateMarkingDequeAfterScavenge();
75 77
(...skipping 14 matching lines...) Expand all
90 // Start off by marking this many times more memory than has been allocated. 92 // Start off by marking this many times more memory than has been allocated.
91 static const intptr_t kInitialAllocationMarkingFactor = 1; 93 static const intptr_t kInitialAllocationMarkingFactor = 1;
92 // But if we are promoting a lot of data we need to mark faster to keep up 94 // But if we are promoting a lot of data we need to mark faster to keep up
93 // with the data that is entering the old space through promotion. 95 // with the data that is entering the old space through promotion.
94 static const intptr_t kFastMarking = 3; 96 static const intptr_t kFastMarking = 3;
95 // After this many steps we increase the marking/allocating factor. 97 // After this many steps we increase the marking/allocating factor.
96 static const intptr_t kAllocationMarkingFactorSpeedupInterval = 1024; 98 static const intptr_t kAllocationMarkingFactorSpeedupInterval = 1024;
97 // This is how much we increase the marking/allocating factor by. 99 // This is how much we increase the marking/allocating factor by.
98 static const intptr_t kAllocationMarkingFactorSpeedup = 2; 100 static const intptr_t kAllocationMarkingFactorSpeedup = 2;
99 static const intptr_t kMaxAllocationMarkingFactor = 1000; 101 static const intptr_t kMaxAllocationMarkingFactor = 1000;
102 // This is given to Step() function when it is called without any allocation.
103 static const intptr_t kStepFakeAllocatedBytes = kAllocatedThreshold * 3;
Erik Corry 2011/11/10 15:06:55 This is rather ugly. Instead of lying to the Step
ulan 2011/11/11 13:27:26 Removed this completely, because the size is now c
100 104
101 void OldSpaceStep(intptr_t allocated) { 105 void OldSpaceStep(intptr_t allocated) {
102 Step(allocated * kFastMarking / kInitialAllocationMarkingFactor); 106 Step(allocated * kFastMarking / kInitialAllocationMarkingFactor);
103 } 107 }
108
104 void Step(intptr_t allocated); 109 void Step(intptr_t allocated);
105 110
106 inline void RestartIfNotMarking() { 111 inline void RestartIfNotMarking() {
107 if (state_ == COMPLETE) { 112 if (state_ == COMPLETE) {
108 state_ = MARKING; 113 state_ = MARKING;
109 if (FLAG_trace_incremental_marking) { 114 if (FLAG_trace_incremental_marking) {
110 PrintF("[IncrementalMarking] Restarting (new grey objects)\n"); 115 PrintF("[IncrementalMarking] Restarting (new grey objects)\n");
111 } 116 }
112 } 117 }
113 } 118 }
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 intptr_t allocated_; 274 intptr_t allocated_;
270 275
271 int no_marking_scope_depth_; 276 int no_marking_scope_depth_;
272 277
273 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); 278 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking);
274 }; 279 };
275 280
276 } } // namespace v8::internal 281 } } // namespace v8::internal
277 282
278 #endif // V8_INCREMENTAL_MARKING_H_ 283 #endif // V8_INCREMENTAL_MARKING_H_
OLDNEW
« src/heap.cc ('K') | « src/heap.cc ('k') | src/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698