From 81f8e599112471ee802d7fd7b0b79b7330348be6 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 7 Sep 2015 15:47:18 +0200 Subject: Speed up QQmlEngine constructor Freezing the global object using a script is pretty slow, esp. given that the script needs to be compiled as well. Rather do it programmatically. The old code actually had a bug that would only cause the global object to be frozen, not it's children. The new code fixes this, but doesn't completely freeze the objects. Instead it makes all the existing properties of the global object and it's children readonly, but still allows extending existing objects with new properties. Change-Id: I0d7331cdc89a0ac717b8ed3b1a490b2a3742de02 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4internalclass_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/qml/jsruntime/qv4internalclass_p.h') diff --git a/src/qml/jsruntime/qv4internalclass_p.h b/src/qml/jsruntime/qv4internalclass_p.h index 80590fe72e..342870fcd6 100644 --- a/src/qml/jsruntime/qv4internalclass_p.h +++ b/src/qml/jsruntime/qv4internalclass_p.h @@ -233,6 +233,7 @@ struct InternalClass : public QQmlJS::Managed { InternalClass *sealed(); InternalClass *frozen(); + InternalClass *propertiesFrozen() const; void destroy(); -- cgit v1.2.3