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

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

Issue 8084002: Start incremental marking on idle notification. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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
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 = 1000000000; 101 static const intptr_t kMaxAllocationMarkingFactor = 1000000000;
102 // This is given to Step() function when it is called without any allocation.
103 static const intptr_t kStepFakeAllocatedBytes = kAllocatedThreshold * 3;
104
100 105
101 void OldSpaceStep(intptr_t allocated) { 106 void OldSpaceStep(intptr_t allocated) {
102 Step(allocated * kFastMarking / kInitialAllocationMarkingFactor); 107 Step(allocated * kFastMarking / kInitialAllocationMarkingFactor);
103 } 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) {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 bool should_hurry_; 250 bool should_hurry_;
246 int allocation_marking_factor_; 251 int allocation_marking_factor_;
247 intptr_t allocated_; 252 intptr_t allocated_;
248 253
249 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); 254 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking);
250 }; 255 };
251 256
252 } } // namespace v8::internal 257 } } // namespace v8::internal
253 258
254 #endif // V8_INCREMENTAL_MARKING_H_ 259 #endif // V8_INCREMENTAL_MARKING_H_
OLDNEW
« src/heap.cc ('K') | « src/heap.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698