aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/debugger/qv8debugservice.cpp
diff options
context:
space:
mode:
authorGlenn Watson <glenn.watson@nokia.com>2011-10-27 13:13:23 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-01 03:58:20 +0100
commit64b8ce5f60d0595fcc511ca860066f2d946db8f3 (patch)
tree1746abd288e6108ad3b39df4b1579bf4af85836a /src/declarative/debugger/qv8debugservice.cpp
parente431d97a03a7131ff327ff2cc7d12c6bad1f9fe7 (diff)
Force V8 debugger load on startup instead of on demand.
The V8 debugger code can take several hundred milliseconds to start. This is by default loaded and unloaded on demand, for example whenever a script is compiled. This has a significant effect on the timing reported by the QML profiler in Qt Creator. This change forces the debugger context to be loaded when the v8 context is created, so that this cost is paid once on startup and no longer affects the QML profiling times. Task-number: QTBUG-22170 Change-Id: I5533b53908b3c53e18b0eb870ed6166d109429df Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/declarative/debugger/qv8debugservice.cpp')
-rw-r--r--src/declarative/debugger/qv8debugservice.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/declarative/debugger/qv8debugservice.cpp b/src/declarative/debugger/qv8debugservice.cpp
index 49091529a0..e36c4bd001 100644
--- a/src/declarative/debugger/qv8debugservice.cpp
+++ b/src/declarative/debugger/qv8debugservice.cpp
@@ -124,6 +124,13 @@ QV8DebugService::QV8DebugService(QObject *parent)
{
Q_D(QV8DebugService);
v8::Debug::SetMessageHandler2(DebugMessageHandler);
+
+ // This call forces the debugger context to be loaded and made resident.
+ // Without this the debugger is loaded/unloaded whenever required, which
+ // has a very significant effect on the timing reported in the QML
+ // profiler in Qt Creator.
+ v8::Debug::GetDebugContext();
+
if (status() == Enabled) {
// ,block mode, client attached
while (!d->initialized) {