Chromium Code Reviews| 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, |