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

Unified Diff: src/global-handles.cc

Issue 2498583002: [heap] Minor MC: Add marking (Closed)
Patch Set: Move to concurrent uncomitting of marking deque Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/global-handles.h ('k') | src/heap/gc-idle-time-handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/global-handles.cc
diff --git a/src/global-handles.cc b/src/global-handles.cc
index 9ff16affe4f948114ee18d1558dfe259da6dc079..1acb9d60c8296daf60763e1ec6edf9d95bbaa248 100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -719,7 +719,7 @@ void GlobalHandles::MarkNewSpaceWeakUnmodifiedObjectsPending(
}
}
-
+template <GlobalHandles::IterationMode mode>
void GlobalHandles::IterateNewSpaceWeakUnmodifiedRoots(ObjectVisitor* v) {
for (int i = 0; i < new_space_nodes_.length(); ++i) {
Node* node = new_space_nodes_[i];
@@ -728,18 +728,35 @@ void GlobalHandles::IterateNewSpaceWeakUnmodifiedRoots(ObjectVisitor* v) {
node->IsWeakRetainer()) {
// Pending weak phantom handles die immediately. Everything else survives.
if (node->IsPendingPhantomResetHandle()) {
- node->ResetPhantomHandle();
- ++number_of_phantom_handle_resets_;
+ if (mode == IterationMode::HANDLE_PHANTOM_NODES ||
+ mode == IterationMode::HANDLE_PHANTOM_NODES_VISIT_OTHERS) {
+ node->ResetPhantomHandle();
+ ++number_of_phantom_handle_resets_;
+ }
} else if (node->IsPendingPhantomCallback()) {
- node->CollectPhantomCallbackData(isolate(),
- &pending_phantom_callbacks_);
+ if (mode == IterationMode::HANDLE_PHANTOM_NODES ||
+ mode == IterationMode::HANDLE_PHANTOM_NODES_VISIT_OTHERS) {
+ node->CollectPhantomCallbackData(isolate(),
+ &pending_phantom_callbacks_);
+ }
} else {
- v->VisitPointer(node->location());
+ if (mode == IterationMode::VISIT_OTHERS ||
+ mode == IterationMode::HANDLE_PHANTOM_NODES_VISIT_OTHERS) {
+ v->VisitPointer(node->location());
+ }
}
}
}
}
+template void GlobalHandles::IterateNewSpaceWeakUnmodifiedRoots<
+ GlobalHandles::HANDLE_PHANTOM_NODES>(ObjectVisitor* v);
+
+template void GlobalHandles::IterateNewSpaceWeakUnmodifiedRoots<
+ GlobalHandles::VISIT_OTHERS>(ObjectVisitor* v);
+
+template void GlobalHandles::IterateNewSpaceWeakUnmodifiedRoots<
+ GlobalHandles::HANDLE_PHANTOM_NODES_VISIT_OTHERS>(ObjectVisitor* v);
DISABLE_CFI_PERF
bool GlobalHandles::IterateObjectGroups(ObjectVisitor* v,
« no previous file with comments | « src/global-handles.h ('k') | src/heap/gc-idle-time-handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698