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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // stored in partiallyDependentNodes and are expected to exist in the ne
w space of V8. | 232 // stored in partiallyDependentNodes and are expected to exist in the ne
w space of V8. |
233 // We report those wrappers to V8 as an object group. | 233 // We report those wrappers to V8 as an object group. |
234 if (!partiallyDependentNodes.size()) | 234 if (!partiallyDependentNodes.size()) |
235 return; | 235 return; |
236 Node* groupRoot = partiallyDependentNodes[0]; | 236 Node* groupRoot = partiallyDependentNodes[0]; |
237 for (size_t i = 0; i < partiallyDependentNodes.size(); i++) { | 237 for (size_t i = 0; i < partiallyDependentNodes.size(); i++) { |
238 partiallyDependentNodes[i]->markAsDependentGroup(groupRoot, isolate)
; | 238 partiallyDependentNodes[i]->markAsDependentGroup(groupRoot, isolate)
; |
239 } | 239 } |
240 } | 240 } |
241 | 241 |
242 WillBePersistentHeapVector<RawPtrWillBeMember<Node> > m_nodesInNewSpace; | 242 WillBePersistentHeapVector<RawPtrWillBeMember<Node>> m_nodesInNewSpace; |
243 v8::Isolate* m_isolate; | 243 v8::Isolate* m_isolate; |
244 }; | 244 }; |
245 | 245 |
246 class MajorGCWrapperVisitor : public v8::PersistentHandleVisitor { | 246 class MajorGCWrapperVisitor : public v8::PersistentHandleVisitor { |
247 public: | 247 public: |
248 explicit MajorGCWrapperVisitor(v8::Isolate* isolate, bool constructRetainedO
bjectInfos) | 248 explicit MajorGCWrapperVisitor(v8::Isolate* isolate, bool constructRetainedO
bjectInfos) |
249 : m_isolate(isolate) | 249 : m_isolate(isolate) |
250 , m_domObjectsWithPendingActivity(0) | 250 , m_domObjectsWithPendingActivity(0) |
251 , m_liveRootGroupIdSet(false) | 251 , m_liveRootGroupIdSet(false) |
252 , m_constructRetainedObjectInfos(constructRetainedObjectInfos) | 252 , m_constructRetainedObjectInfos(constructRetainedObjectInfos) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 v8::UniqueId id(*idPointer); | 317 v8::UniqueId id(*idPointer); |
318 if (!m_liveRootGroupIdSet) { | 318 if (!m_liveRootGroupIdSet) { |
319 m_isolate->SetObjectGroupId(liveRoot, id); | 319 m_isolate->SetObjectGroupId(liveRoot, id); |
320 m_liveRootGroupIdSet = true; | 320 m_liveRootGroupIdSet = true; |
321 ++m_domObjectsWithPendingActivity; | 321 ++m_domObjectsWithPendingActivity; |
322 } | 322 } |
323 return id; | 323 return id; |
324 } | 324 } |
325 | 325 |
326 v8::Isolate* m_isolate; | 326 v8::Isolate* m_isolate; |
327 WillBePersistentHeapVector<RawPtrWillBeMember<Node> > m_groupsWhichNeedRetai
nerInfo; | 327 WillBePersistentHeapVector<RawPtrWillBeMember<Node>> m_groupsWhichNeedRetain
erInfo; |
328 int m_domObjectsWithPendingActivity; | 328 int m_domObjectsWithPendingActivity; |
329 bool m_liveRootGroupIdSet; | 329 bool m_liveRootGroupIdSet; |
330 bool m_constructRetainedObjectInfos; | 330 bool m_constructRetainedObjectInfos; |
331 }; | 331 }; |
332 | 332 |
333 static unsigned long long usedHeapSize(v8::Isolate* isolate) | 333 static unsigned long long usedHeapSize(v8::Isolate* isolate) |
334 { | 334 { |
335 v8::HeapStatistics heapStatistics; | 335 v8::HeapStatistics heapStatistics; |
336 isolate->GetHeapStatistics(&heapStatistics); | 336 isolate->GetHeapStatistics(&heapStatistics); |
337 return heapStatistics.used_heap_size(); | 337 return heapStatistics.used_heap_size(); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 Visitor* m_visitor; | 507 Visitor* m_visitor; |
508 }; | 508 }; |
509 | 509 |
510 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) | 510 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) |
511 { | 511 { |
512 DOMWrapperTracer tracer(visitor); | 512 DOMWrapperTracer tracer(visitor); |
513 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); | 513 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); |
514 } | 514 } |
515 | 515 |
516 } // namespace blink | 516 } // namespace blink |
OLD | NEW |