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

Side by Side Diff: src/global-handles.h

Issue 1209403005: Let the second pass phantom callbacks run in a separate task on the foreground thread. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Run second pass callbacks synchronously when GC is forced. Created 5 years, 5 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
« no previous file with comments | « src/d8.cc ('k') | src/global-handles.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 static bool IsIndependent(Object** location); 174 static bool IsIndependent(Object** location);
175 175
176 // Tells whether global handle is near death. 176 // Tells whether global handle is near death.
177 static bool IsNearDeath(Object** location); 177 static bool IsNearDeath(Object** location);
178 178
179 // Tells whether global handle is weak. 179 // Tells whether global handle is weak.
180 static bool IsWeak(Object** location); 180 static bool IsWeak(Object** location);
181 181
182 // Process pending weak handles. 182 // Process pending weak handles.
183 // Returns the number of freed nodes. 183 // Returns the number of freed nodes.
184 int PostGarbageCollectionProcessing(GarbageCollector collector); 184 int PostGarbageCollectionProcessing(
185 GarbageCollector collector, const v8::GCCallbackFlags gc_callback_flags);
185 186
186 // Iterates over all strong handles. 187 // Iterates over all strong handles.
187 void IterateStrongRoots(ObjectVisitor* v); 188 void IterateStrongRoots(ObjectVisitor* v);
188 189
189 // Iterates over all handles. 190 // Iterates over all handles.
190 void IterateAllRoots(ObjectVisitor* v); 191 void IterateAllRoots(ObjectVisitor* v);
191 192
192 // Iterates over all handles that have embedder-assigned class ID. 193 // Iterates over all handles that have embedder-assigned class ID.
193 void IterateAllRootsWithClassIds(ObjectVisitor* v); 194 void IterateAllRootsWithClassIds(ObjectVisitor* v);
194 195
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 281
281 // Migrates data from the internal representation (object_group_connections_, 282 // Migrates data from the internal representation (object_group_connections_,
282 // retainer_infos_ and implicit_ref_connections_) to the public and more 283 // retainer_infos_ and implicit_ref_connections_) to the public and more
283 // efficient representation (object_groups_ and implicit_ref_groups_). 284 // efficient representation (object_groups_ and implicit_ref_groups_).
284 void ComputeObjectGroupsAndImplicitReferences(); 285 void ComputeObjectGroupsAndImplicitReferences();
285 286
286 // v8::internal::List is inefficient even for small number of elements, if we 287 // v8::internal::List is inefficient even for small number of elements, if we
287 // don't assign any initial capacity. 288 // don't assign any initial capacity.
288 static const int kObjectGroupConnectionsCapacity = 20; 289 static const int kObjectGroupConnectionsCapacity = 20;
289 290
291 class PendingPhantomCallback;
292
290 // Helpers for PostGarbageCollectionProcessing. 293 // Helpers for PostGarbageCollectionProcessing.
294 static void InvokeSecondPassPhantomCallbacks(
295 List<PendingPhantomCallback>* callbacks, Isolate* isolate);
291 int PostScavengeProcessing(int initial_post_gc_processing_count); 296 int PostScavengeProcessing(int initial_post_gc_processing_count);
292 int PostMarkSweepProcessing(int initial_post_gc_processing_count); 297 int PostMarkSweepProcessing(int initial_post_gc_processing_count);
293 int DispatchPendingPhantomCallbacks(); 298 int DispatchPendingPhantomCallbacks(bool synchronous_second_pass);
294 void UpdateListOfNewSpaceNodes(); 299 void UpdateListOfNewSpaceNodes();
295 300
296 // Internal node structures. 301 // Internal node structures.
297 class Node; 302 class Node;
298 class NodeBlock; 303 class NodeBlock;
299 class NodeIterator; 304 class NodeIterator;
300 class PendingPhantomCallback; 305 class PendingPhantomCallbacksSecondPassTask;
301 306
302 Isolate* isolate_; 307 Isolate* isolate_;
303 308
304 // Field always containing the number of handles to global objects. 309 // Field always containing the number of handles to global objects.
305 int number_of_global_handles_; 310 int number_of_global_handles_;
306 311
307 // List of all allocated node blocks. 312 // List of all allocated node blocks.
308 NodeBlock* first_block_; 313 NodeBlock* first_block_;
309 314
310 // List of node blocks with used nodes. 315 // List of node blocks with used nodes.
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 List<int> new_space_indices_; 434 List<int> new_space_indices_;
430 int singleton_handles_[NUMBER_OF_SINGLETON_HANDLES]; 435 int singleton_handles_[NUMBER_OF_SINGLETON_HANDLES];
431 436
432 DISALLOW_COPY_AND_ASSIGN(EternalHandles); 437 DISALLOW_COPY_AND_ASSIGN(EternalHandles);
433 }; 438 };
434 439
435 440
436 } } // namespace v8::internal 441 } } // namespace v8::internal
437 442
438 #endif // V8_GLOBAL_HANDLES_H_ 443 #endif // V8_GLOBAL_HANDLES_H_
OLDNEW
« no previous file with comments | « src/d8.cc ('k') | src/global-handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698