| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_SPACES_H_ | 5 #ifndef V8_SPACES_H_ |
| 6 #define V8_SPACES_H_ | 6 #define V8_SPACES_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
| 10 #include "src/base/platform/mutex.h" | 10 #include "src/base/platform/mutex.h" |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 void set_parallel_sweeping(ParallelSweepingState state) { | 471 void set_parallel_sweeping(ParallelSweepingState state) { |
| 472 base::Release_Store(¶llel_sweeping_, state); | 472 base::Release_Store(¶llel_sweeping_, state); |
| 473 } | 473 } |
| 474 | 474 |
| 475 bool TryParallelSweeping() { | 475 bool TryParallelSweeping() { |
| 476 return base::Acquire_CompareAndSwap( | 476 return base::Acquire_CompareAndSwap( |
| 477 ¶llel_sweeping_, SWEEPING_PENDING, SWEEPING_IN_PROGRESS) == | 477 ¶llel_sweeping_, SWEEPING_PENDING, SWEEPING_IN_PROGRESS) == |
| 478 SWEEPING_PENDING; | 478 SWEEPING_PENDING; |
| 479 } | 479 } |
| 480 | 480 |
| 481 bool SweepingCompleted() { return parallel_sweeping() <= SWEEPING_FINALIZE; } |
| 482 |
| 481 // Manage live byte count (count of bytes known to be live, | 483 // Manage live byte count (count of bytes known to be live, |
| 482 // because they are marked black). | 484 // because they are marked black). |
| 483 void ResetLiveBytes() { | 485 void ResetLiveBytes() { |
| 484 if (FLAG_gc_verbose) { | 486 if (FLAG_gc_verbose) { |
| 485 PrintF("ResetLiveBytes:%p:%x->0\n", | 487 PrintF("ResetLiveBytes:%p:%x->0\n", |
| 486 static_cast<void*>(this), live_byte_count_); | 488 static_cast<void*>(this), live_byte_count_); |
| 487 } | 489 } |
| 488 live_byte_count_ = 0; | 490 live_byte_count_ = 0; |
| 489 } | 491 } |
| 490 void IncrementLiveBytes(int by) { | 492 void IncrementLiveBytes(int by) { |
| (...skipping 2534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3025 } | 3027 } |
| 3026 // Must be small, since an iteration is used for lookup. | 3028 // Must be small, since an iteration is used for lookup. |
| 3027 static const int kMaxComments = 64; | 3029 static const int kMaxComments = 64; |
| 3028 }; | 3030 }; |
| 3029 #endif | 3031 #endif |
| 3030 | 3032 |
| 3031 | 3033 |
| 3032 } } // namespace v8::internal | 3034 } } // namespace v8::internal |
| 3033 | 3035 |
| 3034 #endif // V8_SPACES_H_ | 3036 #endif // V8_SPACES_H_ |
| OLD | NEW |