aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4object_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-01-04 12:45:45 +0100
committerLars Knoll <lars.knoll@qt.io>2017-01-25 08:30:59 +0000
commita56809dcfda21363d3c96c39c6075d5d65e116a6 (patch)
tree8116594521219b1db693d7129f7d286d0458289a /src/qml/jsruntime/qv4object_p.h
parentd8c6bf2dc129522f779d2c4ffc698a97b7531f66 (diff)
Get rid of the inline member data in Object
Instead allocate a MemberData at the same time as the object if required. Turns out this is faster now, and significantly simplifies some of our internal logic to access member properties. In addition, we can properly setup the inline member size to use the full extent of the memory reserved by the memory manager. This avoid some needless reallocations of MemberData objects. Change-Id: I36daeeaf6df16f2268103662fc78d600b4058ef8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4object_p.h')
-rw-r--r--src/qml/jsruntime/qv4object_p.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h
index 6c679deb10..65820911db 100644
--- a/src/qml/jsruntime/qv4object_p.h
+++ b/src/qml/jsruntime/qv4object_p.h
@@ -69,11 +69,9 @@ struct Object : Base {
void init() { Base::init(); }
void destroy() { Base::destroy(); }
- const Value *propertyData(uint index) const { if (index < inlineMemberSize) return reinterpret_cast<const Value *>(this) + inlineMemberOffset + index; return memberData->data + index - inlineMemberSize; }
- Value *propertyData(uint index) { if (index < inlineMemberSize) return reinterpret_cast<Value *>(this) + inlineMemberOffset + index; return memberData->data + index - inlineMemberSize; }
+ const Value *propertyData(uint index) const { return memberData->data + index; }
+ Value *propertyData(uint index) { return memberData->data + index; }
- uint inlineMemberOffset;
- uint inlineMemberSize;
InternalClass *internalClass;
Pointer<Object> prototype;
Pointer<MemberData> memberData;