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

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

Issue 2673693003: [wrapper-tracing] Don't call into V8 during heap snapshot creation (Closed)
Patch Set: Created 3 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 groupChildren.insert(persistentForWrappable(node)); 188 groupChildren.insert(persistentForWrappable(node));
189 } 189 }
190 m_groups.push_back(std::make_pair(new RetainedDOMInfo(groupPair.first), 190 m_groups.push_back(std::make_pair(new RetainedDOMInfo(groupPair.first),
191 std::move(groupChildren))); 191 std::move(groupChildren)));
192 } 192 }
193 } 193 }
194 194
195 v8::HeapProfiler::RetainerEdges edges() { return std::move(m_edges); } 195 v8::HeapProfiler::RetainerEdges edges() { return std::move(m_edges); }
196 v8::HeapProfiler::RetainerGroups groups() { return std::move(m_groups); } 196 v8::HeapProfiler::RetainerGroups groups() { return std::move(m_groups); }
197 197
198 void markWrappersInAllWorlds(
199 const ScriptWrappable* traceable) const override {
haraken 2017/02/03 03:55:45 What happens if this is called on a worker thread?
Michael Lippautz 2017/02/03 04:49:36 Snapshots can only be created from the main thread
200 // Only mark the main thread wrapper as we cannot properly intercept
201 // DOMWrapperMap::markWrapper.
haraken 2017/02/03 03:55:45 Also explain that this means that we won't be able
Michael Lippautz 2017/02/03 04:49:36 Done.
202 traceable->markWrapper(this);
203 }
204
198 void markWrapper(const v8::PersistentBase<v8::Value>* value) const override { 205 void markWrapper(const v8::PersistentBase<v8::Value>* value) const override {
199 if (m_currentParent && m_currentParent != value) 206 if (m_currentParent && m_currentParent != value)
200 m_edges.push_back(std::make_pair(m_currentParent, value)); 207 m_edges.push_back(std::make_pair(m_currentParent, value));
201 m_foundV8Wrappers.insert(value); 208 m_foundV8Wrappers.insert(value);
202 } 209 }
203 210
204 void dispatchTraceWrappers(const TraceWrapperBase* traceable) const override { 211 void dispatchTraceWrappers(const TraceWrapperBase* traceable) const override {
205 if (!m_onlyTraceSingleLevel || !traceable->isScriptWrappable() || 212 if (!m_onlyTraceSingleLevel || !traceable->isScriptWrappable() ||
206 !reinterpret_cast<const ScriptWrappable*>(traceable) 213 !reinterpret_cast<const ScriptWrappable*>(traceable)
207 ->containsWrapper() || 214 ->containsWrapper() ||
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 double startTime = WTF::currentTimeMS(); 544 double startTime = WTF::currentTimeMS();
538 v8::HandleScope scope(isolate); 545 v8::HandleScope scope(isolate);
539 PendingActivityVisitor visitor(isolate, executionContext); 546 PendingActivityVisitor visitor(isolate, executionContext);
540 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor); 547 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor);
541 scanPendingActivityHistogram.count( 548 scanPendingActivityHistogram.count(
542 static_cast<int>(WTF::currentTimeMS() - startTime)); 549 static_cast<int>(WTF::currentTimeMS() - startTime));
543 return visitor.pendingActivityFound(); 550 return visitor.pendingActivityFound();
544 } 551 }
545 552
546 } // namespace blink 553 } // 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