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

Unified Diff: Source/bindings/v8/V8RecursionScope.cpp

Issue 466243002: Support merged Dart-JS callstacks (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/dartium
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/v8/V8RecursionScope.cpp
diff --git a/Source/bindings/v8/V8RecursionScope.cpp b/Source/bindings/v8/V8RecursionScope.cpp
index ab09a3b70d3bd1ec6c8d96bd238075d32a0784e5..9d0489248a5c952f315f18f0709d68ee9a75c661 100644
--- a/Source/bindings/v8/V8RecursionScope.cpp
+++ b/Source/bindings/v8/V8RecursionScope.cpp
@@ -32,6 +32,8 @@
#include "bindings/v8/V8RecursionScope.h"
#include "core/dom/Microtask.h"
+#include "core/inspector/InspectorInstrumentation.h"
+#include "core/inspector/ScriptCallStack.h"
#include "modules/indexeddb/IDBPendingTransactionMonitor.h"
namespace WebCore {
@@ -45,4 +47,17 @@ void V8RecursionScope::didLeaveScriptContext()
IDBPendingTransactionMonitor::from(*m_executionContext).deactivateNewTransactions();
}
+void V8RecursionScope::trackStackDepth(V8PerIsolateData* isolateData)
+{
+ StackTraceTimestampTracker* tracker = isolateData->stackTraceTimestampTracker();
+ // FIXMEDART: implement a more efficient way to measure the current V8
+ // stack trace depth than calling v8::StackTrace::CurrentStackTrace.
+ // The current implementation will not slow down V8 when the
+ // devtools are closed but could have a significant performance impact
+ // when the devtools are open for code that dispatches a lot of synchronous
+ // messages or relies heavily on Dart-JS interop.
+ tracker->incrementRecursionLevel(InspectorInstrumentation::hasFrontends() && tracker->recursionLevel() > 0 ?
+ v8::StackTrace::CurrentStackTrace(m_isolate, ScriptCallStack::maxCallStackSizeToCapture)->GetFrameCount() : 0);
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698