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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp

Issue 1724263004: V8 minor GC should not ignore hasPendingActivity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // MinorGC does not collect objects because it may be expensive to 116 // MinorGC does not collect objects because it may be expensive to
117 // update references during minorGC 117 // update references during minorGC
118 if (classId == WrapperTypeInfo::ObjectClassId) { 118 if (classId == WrapperTypeInfo::ObjectClassId) {
119 v8::Persistent<v8::Object>::Cast(*value).MarkActive(); 119 v8::Persistent<v8::Object>::Cast(*value).MarkActive();
120 return; 120 return;
121 } 121 }
122 122
123 v8::Local<v8::Object> wrapper = v8::Local<v8::Object>::New(m_isolate, v8 ::Persistent<v8::Object>::Cast(*value)); 123 v8::Local<v8::Object> wrapper = v8::Local<v8::Object>::New(m_isolate, v8 ::Persistent<v8::Object>::Cast(*value));
124 ASSERT(V8DOMWrapper::hasInternalFieldsSet(wrapper)); 124 ASSERT(V8DOMWrapper::hasInternalFieldsSet(wrapper));
125 const WrapperTypeInfo* type = toWrapperTypeInfo(wrapper); 125 const WrapperTypeInfo* type = toWrapperTypeInfo(wrapper);
126 if (type != npObjectTypeInfo() && toScriptWrappable(wrapper)->hasPending Activity()) 126 if (type != npObjectTypeInfo() && toScriptWrappable(wrapper)->hasPending Activity()) {
127 v8::Persistent<v8::Object>::Cast(*value).MarkActive();
127 return; 128 return;
129 }
128 130
129 if (classId == WrapperTypeInfo::NodeClassId) { 131 if (classId == WrapperTypeInfo::NodeClassId) {
130 ASSERT(V8Node::hasInstance(wrapper, m_isolate)); 132 ASSERT(V8Node::hasInstance(wrapper, m_isolate));
131 Node* node = V8Node::toImpl(wrapper); 133 Node* node = V8Node::toImpl(wrapper);
132 if (node->hasEventListeners()) { 134 if (node->hasEventListeners()) {
133 v8::Persistent<v8::Object>::Cast(*value).MarkActive(); 135 v8::Persistent<v8::Object>::Cast(*value).MarkActive();
134 return; 136 return;
135 } 137 }
136 // FIXME: Remove the special handling for image elements. 138 // FIXME: Remove the special handling for image elements.
137 // The same special handling is in V8GCController::opaqueRootForGC() . 139 // The same special handling is in V8GCController::opaqueRootForGC() .
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 487
486 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scanPendingActivityHis togram, new CustomCountHistogram("Blink.ScanPendingActivityDuration", 1, 1000, 5 0)); 488 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scanPendingActivityHis togram, new CustomCountHistogram("Blink.ScanPendingActivityDuration", 1, 1000, 5 0));
487 double startTime = WTF::currentTimeMS(); 489 double startTime = WTF::currentTimeMS();
488 PendingActivityVisitor visitor(executionContext); 490 PendingActivityVisitor visitor(executionContext);
489 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor); 491 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor);
490 scanPendingActivityHistogram.count(static_cast<int>(WTF::currentTimeMS() - s tartTime)); 492 scanPendingActivityHistogram.count(static_cast<int>(WTF::currentTimeMS() - s tartTime));
491 return visitor.pendingActivityFound(); 493 return visitor.pendingActivityFound();
492 } 494 }
493 495
494 } // namespace blink 496 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698