aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8/qjsvalue_p.h
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-03-22 22:30:14 +0100
committerQt by Nokia <qt-info@nokia.com>2012-05-29 09:00:57 +0200
commit6318f91dc0bf1ac428037c963b80b7a5d4e1ad30 (patch)
tree4b307f601d25d9f6c6aee65fbf754893c1fc6a79 /src/qml/qml/v8/qjsvalue_p.h
parent18eba786347c42e0c1c9a2a5f8331624f1779920 (diff)
Add internal API for accessing V8 handles of QJS types
Make it possible to use the V8 API directly. This might be necessary in cases where the QJS API is missing some functionality (e.g., controlling the V8 profiler), or for performance reasons (e.g., avoiding overhead of QJSValue indirection). The V8 API is clearly more extensive than the QJS API, and QJS will likely never reach feature parity with it (since that's outside the scope of QJS). By providing access to the underlying V8 types, users can still choose to use V8 directly in the (hopefully rare) cases where the public QJS API isn't sufficient. Two new functions are introduced: - qt_QJSEngineV8Context(QJSEngine *) returns a local handle to the engine's internal V8 context. - qt_QJSValueV8Value(const QJSValue &) returns a local handle to the QJSValue's internal V8 value. The caller is responsible for - ensuring that a V8 handle scope is in place; - entering/exiting the QJSEngine's V8 context. The documentation and tests show how that can be done. Also added a benchmark for QJSValue that can be used to measure the effect of using raw V8 API for some common operations. Change-Id: I680aeb2f67ffe5eeadd432a05c8084e43921a118 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/qml/qml/v8/qjsvalue_p.h')
-rw-r--r--src/qml/qml/v8/qjsvalue_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/qml/v8/qjsvalue_p.h b/src/qml/qml/v8/qjsvalue_p.h
index 31b30aad0d..1564b8c5f0 100644
--- a/src/qml/qml/v8/qjsvalue_p.h
+++ b/src/qml/qml/v8/qjsvalue_p.h
@@ -164,6 +164,7 @@ public:
inline operator v8::Handle<v8::Value>() const;
inline operator v8::Handle<v8::Object>() const;
+ inline v8::Handle<v8::Value> handle() const;
inline v8::Handle<v8::Value> asV8Value(QV8Engine *engine);
private:
QIntrusiveListNode m_node;