From 996e54602a05649e3a84a505b439742809172d6f Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 7 Nov 2017 12:10:39 +0100 Subject: Allow tuning the amount of inline properties per object type Different JS objects need different amount of properties by default. Tune the amount of inline properties we pre-allocate by what's usually needed for the object. Change-Id: I2703d123939f9b7e3a06531361cbb6a3a3c04944 Reviewed-by: Erik Verbruggen --- src/qml/jsruntime/qv4managed_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qml/jsruntime/qv4managed_p.h') diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index ea10f6f6d1..f81dcf9479 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -132,7 +132,7 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {} { \ parentVTable, \ (sizeof(classname::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), \ - (sizeof(classname::Data) + (std::is_same::value ? 2*sizeof(QV4::Value) : 0) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) \ + (sizeof(classname::Data) + (classname::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) \ - (sizeof(classname::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), \ classname::IsExecutionContext, \ classname::IsString, \ @@ -174,6 +174,7 @@ private: Q_DISABLE_COPY(Managed) public: + enum { NInlineProperties = 0 }; enum Type { Type_Invalid, -- cgit v1.2.3