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

Unified Diff: src/global-handles.cc

Issue 2498583002: [heap] Minor MC: Add marking (Closed)
Patch Set: Fix uncommitting of markingdeque 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
Index: src/global-handles.cc
diff --git a/src/global-handles.cc b/src/global-handles.cc
index 9ff16affe4f948114ee18d1558dfe259da6dc079..c23ae2501054671955cc19f6a6075cc92b4076ed 100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -719,7 +719,7 @@ void GlobalHandles::MarkNewSpaceWeakUnmodifiedObjectsPending(
}
}
-
+template <GlobalHandles::IterationMode mode>
ulan 2016/11/15 19:57:21 mode is unused in this function.
Michael Lippautz 2016/11/16 10:25:26 Done. Worked by accident because none of our tests
void GlobalHandles::IterateNewSpaceWeakUnmodifiedRoots(ObjectVisitor* v) {
for (int i = 0; i < new_space_nodes_.length(); ++i) {
Node* node = new_space_nodes_[i];
@@ -740,6 +740,30 @@ void GlobalHandles::IterateNewSpaceWeakUnmodifiedRoots(ObjectVisitor* v) {
}
}
+template void GlobalHandles::IterateNewSpaceWeakUnmodifiedRoots<
+ GlobalHandles::HANDLE_PHANTOM_NODES>(ObjectVisitor* v);
+
+template void GlobalHandles::IterateNewSpaceWeakUnmodifiedRoots<
+ GlobalHandles::DONT_HANDLE_PHANTOM_NODES>(ObjectVisitor* v);
+
+void GlobalHandles::ResetNewSpaceHandlesForTesting() {
ulan 2016/11/15 19:57:21 Would it be more robust to remember the state befo
Michael Lippautz 2016/11/16 10:25:26 Yes! Done.
+ for (int i = 0; i < new_space_nodes_.length(); ++i) {
+ Node* node = new_space_nodes_[i];
+ DCHECK(node->is_in_new_space_list());
+
+ if (node->IsWeak()) {
+ // Undo: IdentifyWeakUnmodifiedObjects.
+ if (node->is_active()) {
+ node->set_active(false);
+ }
+ // Undo: MarkNewSpaceWeakUnmodifiedObjectsPending.
+ if ((node->is_independent() || !node->is_active()) &&
+ node->state() == Node::PENDING) {
+ node->set_state(Node::WEAK);
+ }
+ }
+ }
+}
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') | src/heap/mark-compact.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698