diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-05-03 08:45:28 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-05-08 06:42:11 +0000 |
commit | 99594f518a5fb657b75f68bba73537c4e9208e46 (patch) | |
tree | 3593f524105582aa6777ef406d4ce5696d378dbf /src/qml/jsruntime/qv4managed_p.h | |
parent | 720a88be5ba98a71a085ec5977d87ecb22c20008 (diff) |
Re-add some inline property storage
It turns out that not using any inline property storage
comes at a relatively high price in terms of memory
consumption, as we always need to also create a
memberData for any object.
This avoids the memberData creation in quite a few
cases, as we use the additional padding we have up
to the 32 byte boundary given by the memory manager
to store some property data.
This complicates property access somewhat. To avoid
performance regressions because of this, add specialized
QV4::Lookup functions that optimize for properties that
are inline or in the memberData struct.
Change seems to be performance neutral on v8-bench on
x86_64, but reduces peak memory usage when running the
benchmark by around 20%.
Change-Id: I0127d31a2d6038aaa540c4c4a1156f45ca3b7464
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'src/qml/jsruntime/qv4managed_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4managed_p.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index 5c764e7ff0..7e674c6ec7 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -129,6 +129,9 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {} #define DEFINE_MANAGED_VTABLE_INT(classname, parentVTable) \ { \ parentVTable, \ + (sizeof(classname::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), \ + (sizeof(classname::Data) + 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, \ classname::IsObject, \ |