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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 v8::Persistent<v8::Object>::Cast(*value).MarkActive(); | 136 v8::Persistent<v8::Object>::Cast(*value).MarkActive(); |
137 return; | 137 return; |
138 } | 138 } |
139 // FIXME: Remove the special handling for SVG elements. | 139 // FIXME: Remove the special handling for SVG elements. |
140 // We currently can't collect SVG Elements from minor gc, as we have | 140 // We currently can't collect SVG Elements from minor gc, as we have |
141 // strong references from SVG property tear-offs keeping context SVG element alive. | 141 // strong references from SVG property tear-offs keeping context SVG element alive. |
142 if (node->isSVGElement()) { | 142 if (node->isSVGElement()) { |
143 v8::Persistent<v8::Object>::Cast(*value).MarkActive(); | 143 v8::Persistent<v8::Object>::Cast(*value).MarkActive(); |
144 return; | 144 return; |
145 } | 145 } |
146 } else { | |
147 // If there are any references to this object mark it as active. | |
148 // Current MinorGC pass does not handle references. | |
149 if (type->visitDOMWrapperFunction) { | |
haraken
2015/11/24 12:59:08
Unfortunately this check is not correct. type->vis
mythria
2015/11/24 14:21:44
Thank you for your review. Reverted this change.
| |
150 v8::Persistent<v8::Object>::Cast(*value).MarkActive(); | |
mythria
2015/11/24 11:50:19
Would this check be sufficient to filter out all o
| |
151 return; | |
152 } | |
146 } | 153 } |
147 } | 154 } |
148 | 155 |
149 private: | 156 private: |
150 v8::Isolate* m_isolate; | 157 v8::Isolate* m_isolate; |
151 }; | 158 }; |
152 | 159 |
153 class MajorGCWrapperVisitor : public v8::PersistentHandleVisitor { | 160 class MajorGCWrapperVisitor : public v8::PersistentHandleVisitor { |
154 public: | 161 public: |
155 explicit MajorGCWrapperVisitor(v8::Isolate* isolate, bool constructRetainedO bjectInfos) | 162 explicit MajorGCWrapperVisitor(v8::Isolate* isolate, bool constructRetainedO bjectInfos) |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
439 Visitor* m_visitor; | 446 Visitor* m_visitor; |
440 }; | 447 }; |
441 | 448 |
442 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) | 449 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) |
443 { | 450 { |
444 DOMWrapperTracer tracer(visitor); | 451 DOMWrapperTracer tracer(visitor); |
445 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); | 452 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); |
446 } | 453 } |
447 | 454 |
448 } // namespace blink | 455 } // namespace blink |
OLD | NEW |