| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 static const intptr_t kInitialMarkingSpeed = 1; | 103 static const intptr_t kInitialMarkingSpeed = 1; |
| 104 // But if we are promoting a lot of data we need to mark faster to keep up | 104 // But if we are promoting a lot of data we need to mark faster to keep up |
| 105 // with the data that is entering the old space through promotion. | 105 // with the data that is entering the old space through promotion. |
| 106 static const intptr_t kFastMarking = 3; | 106 static const intptr_t kFastMarking = 3; |
| 107 // After this many steps we increase the marking/allocating factor. | 107 // After this many steps we increase the marking/allocating factor. |
| 108 static const intptr_t kMarkingSpeedAccellerationInterval = 1024; | 108 static const intptr_t kMarkingSpeedAccellerationInterval = 1024; |
| 109 // This is how much we increase the marking/allocating factor by. | 109 // This is how much we increase the marking/allocating factor by. |
| 110 static const intptr_t kMarkingSpeedAccelleration = 2; | 110 static const intptr_t kMarkingSpeedAccelleration = 2; |
| 111 static const intptr_t kMaxMarkingSpeed = 1000; | 111 static const intptr_t kMaxMarkingSpeed = 1000; |
| 112 | 112 |
| 113 void OldSpaceStep(intptr_t allocated) { | 113 void OldSpaceStep(intptr_t allocated); |
| 114 Step(allocated * kFastMarking / kInitialMarkingSpeed, | |
| 115 GC_VIA_STACK_GUARD); | |
| 116 } | |
| 117 | 114 |
| 118 void Step(intptr_t allocated, CompletionAction action); | 115 void Step(intptr_t allocated, CompletionAction action); |
| 119 | 116 |
| 120 inline void RestartIfNotMarking() { | 117 inline void RestartIfNotMarking() { |
| 121 if (state_ == COMPLETE) { | 118 if (state_ == COMPLETE) { |
| 122 state_ = MARKING; | 119 state_ = MARKING; |
| 123 if (FLAG_trace_incremental_marking) { | 120 if (FLAG_trace_incremental_marking) { |
| 124 PrintF("[IncrementalMarking] Restarting (new grey objects)\n"); | 121 PrintF("[IncrementalMarking] Restarting (new grey objects)\n"); |
| 125 } | 122 } |
| 126 } | 123 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 intptr_t write_barriers_invoked_since_last_step_; | 273 intptr_t write_barriers_invoked_since_last_step_; |
| 277 | 274 |
| 278 int no_marking_scope_depth_; | 275 int no_marking_scope_depth_; |
| 279 | 276 |
| 280 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 277 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
| 281 }; | 278 }; |
| 282 | 279 |
| 283 } } // namespace v8::internal | 280 } } // namespace v8::internal |
| 284 | 281 |
| 285 #endif // V8_INCREMENTAL_MARKING_H_ | 282 #endif // V8_INCREMENTAL_MARKING_H_ |
| OLD | NEW |