summaryrefslogtreecommitdiffstats
path: root/src/tools/mkv8snapshot/mkv8snapshot.pro
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2011-11-18 09:48:54 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-22 13:10:56 +0100
commit52ef2ee57fd75640aebdb7578aefb5303547dcc7 (patch)
treeb1a11efd8286cfb134f4b5dc8395febd177454cf /src/tools/mkv8snapshot/mkv8snapshot.pro
parentce829cbb857bb0b6f49de81b4e5cc9f26ac0b2d1 (diff)
Add V8 snapshot support
A V8 snapshot is a serialized representation of the JavaScript heap. Using a snapshot can vastly speed up V8 initialization. This commit introduces a new tool, mkv8snapshot. mkv8snapshot is automatically invoked as part of building QtV8, and generates a .cpp file which is compiled into the QtV8 library. Because mkv8snapshot itself needs to initialize the V8 environment the non-snapshot way (i.e., by evaluating thousands of lines of JavaScript), it needs to build all of V8. This means that V8 is effectively built twice when snapshots are enabled. When cross-compiling, only host=i386 and target=arm is supported, since that's the only relevant case for which V8 currently supports a simulator. mkv8snapshot is built and run as a host tool (using the simulator), and generates a snapshot that will be used on the target. Task-number: QTBUG-21152 Change-Id: I9270652f129505508f78db8b0a39fbf57dc8b86d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/tools/mkv8snapshot/mkv8snapshot.pro')
-rw-r--r--src/tools/mkv8snapshot/mkv8snapshot.pro30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/tools/mkv8snapshot/mkv8snapshot.pro b/src/tools/mkv8snapshot/mkv8snapshot.pro
new file mode 100644
index 0000000000..8e80ce2635
--- /dev/null
+++ b/src/tools/mkv8snapshot/mkv8snapshot.pro
@@ -0,0 +1,30 @@
+TEMPLATE = app
+TARGET = mkv8snapshot
+QT =
+CONFIG -= app_bundle
+CONFIG -= qt
+CONFIG += console
+
+DESTDIR = ../../../bin
+INCLUDEPATH += .
+DEPENDPATH += .
+LIBS =
+OBJECTS_DIR = .
+
+cross_compile {
+ equals(QT_ARCH, arm): V8_TARGET_ARCH = arm
+}
+
+include(../../v8/v8.pri)
+
+cross_compile {
+ equals(V8_TARGET_ARCH, arm): SOURCES += $$V8SRC/arm/simulator-arm.cc
+}
+
+SOURCES += \
+ $$V8SRC/snapshot-empty.cc \
+ $$V8SRC/mksnapshot.cc
+
+unix:LIBS += -lpthread
+
+# We don't need to install this tool, it's only used for building v8.