| 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_GLOBAL_HANDLES_H_ | 5 #ifndef V8_GLOBAL_HANDLES_H_ |
| 6 #define V8_GLOBAL_HANDLES_H_ | 6 #define V8_GLOBAL_HANDLES_H_ |
| 7 | 7 |
| 8 #include "include/v8.h" | 8 #include "include/v8.h" |
| 9 #include "include/v8-profiler.h" | 9 #include "include/v8-profiler.h" |
| 10 | 10 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 // Returns the current number of weak handles to global objects. | 156 // Returns the current number of weak handles to global objects. |
| 157 // These handles are also included in NumberOfWeakHandles(). | 157 // These handles are also included in NumberOfWeakHandles(). |
| 158 int NumberOfGlobalObjectWeakHandles(); | 158 int NumberOfGlobalObjectWeakHandles(); |
| 159 | 159 |
| 160 // Returns the current number of handles to global objects. | 160 // Returns the current number of handles to global objects. |
| 161 int global_handles_count() const { | 161 int global_handles_count() const { |
| 162 return number_of_global_handles_; | 162 return number_of_global_handles_; |
| 163 } | 163 } |
| 164 | 164 |
| 165 // Collect up data for the weak handle callbacks after GC has completed, but | |
| 166 // before memory is reclaimed. | |
| 167 void CollectAllPhantomCallbackData(); | |
| 168 | |
| 169 // Collect up data for the weak handle callbacks referenced by young | |
| 170 // generation after GC has completed, but before memory is reclaimed. | |
| 171 void CollectYoungPhantomCallbackData(); | |
| 172 | |
| 173 // Clear the weakness of a global handle. | 165 // Clear the weakness of a global handle. |
| 174 static void* ClearWeakness(Object** location); | 166 static void* ClearWeakness(Object** location); |
| 175 | 167 |
| 176 // Clear the weakness of a global handle. | 168 // Clear the weakness of a global handle. |
| 177 static void MarkIndependent(Object** location); | 169 static void MarkIndependent(Object** location); |
| 178 | 170 |
| 179 // Mark the reference to this object externaly unreachable. | 171 // Mark the reference to this object externaly unreachable. |
| 180 static void MarkPartiallyDependent(Object** location); | 172 static void MarkPartiallyDependent(Object** location); |
| 181 | 173 |
| 182 static bool IsIndependent(Object** location); | 174 static bool IsIndependent(Object** location); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 List<int> new_space_indices_; | 429 List<int> new_space_indices_; |
| 438 int singleton_handles_[NUMBER_OF_SINGLETON_HANDLES]; | 430 int singleton_handles_[NUMBER_OF_SINGLETON_HANDLES]; |
| 439 | 431 |
| 440 DISALLOW_COPY_AND_ASSIGN(EternalHandles); | 432 DISALLOW_COPY_AND_ASSIGN(EternalHandles); |
| 441 }; | 433 }; |
| 442 | 434 |
| 443 | 435 |
| 444 } } // namespace v8::internal | 436 } } // namespace v8::internal |
| 445 | 437 |
| 446 #endif // V8_GLOBAL_HANDLES_H_ | 438 #endif // V8_GLOBAL_HANDLES_H_ |
| OLD | NEW |