OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 } | 168 } |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 private: | 172 private: |
173 bool traverseTree(Node* rootNode, WillBeHeapVector<RawPtrWillBeMember<Node>,
initialNodeVectorSize>* partiallyDependentNodes) | 173 bool traverseTree(Node* rootNode, WillBeHeapVector<RawPtrWillBeMember<Node>,
initialNodeVectorSize>* partiallyDependentNodes) |
174 { | 174 { |
175 // To make each minor GC time bounded, we might need to give up | 175 // To make each minor GC time bounded, we might need to give up |
176 // traversing at some point for a large DOM tree. That being said, | 176 // traversing at some point for a large DOM tree. That being said, |
177 // I could not observe the need even in pathological test cases. | 177 // I could not observe the need even in pathological test cases. |
178 for (Node& node : NodeTraversal::from(rootNode)) { | 178 for (Node& node : NodeTraversal::startsAt(rootNode)) { |
179 if (node.containsWrapper()) { | 179 if (node.containsWrapper()) { |
180 if (!node.isV8CollectableDuringMinorGC()) { | 180 if (!node.isV8CollectableDuringMinorGC()) { |
181 // This node is not in the new space of V8. This indicates t
hat | 181 // This node is not in the new space of V8. This indicates t
hat |
182 // the minor GC cannot anyway judge reachability of this DOM
tree. | 182 // the minor GC cannot anyway judge reachability of this DOM
tree. |
183 // Thus we give up traversing the DOM tree. | 183 // Thus we give up traversing the DOM tree. |
184 return false; | 184 return false; |
185 } | 185 } |
186 node.clearV8CollectableDuringMinorGC(); | 186 node.clearV8CollectableDuringMinorGC(); |
187 partiallyDependentNodes->append(&node); | 187 partiallyDependentNodes->append(&node); |
188 } | 188 } |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 Visitor* m_visitor; | 495 Visitor* m_visitor; |
496 }; | 496 }; |
497 | 497 |
498 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) | 498 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) |
499 { | 499 { |
500 DOMWrapperTracer tracer(visitor); | 500 DOMWrapperTracer tracer(visitor); |
501 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); | 501 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); |
502 } | 502 } |
503 | 503 |
504 } // namespace blink | 504 } // namespace blink |
OLD | NEW |