diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-11-04 14:57:59 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-11-14 21:45:50 +0000 |
commit | 5c0481c1934ef4b39437eef06ddfa15170473bcb (patch) | |
tree | 4f5418b31e53417a94f01c2ba0e9b83e4509c54e /src/qml/jsruntime/qv4object_p.h | |
parent | 002fdc48d43e4fd67921e0cd46c28d28aee06848 (diff) |
Simplify inline getters
Precalculate the offset inside the object.
Change-Id: I61faf463677fe9602fe235a39dcf9e16c5d013cd
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4object_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4object_p.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index 6e7d002a1b..e2512f48c7 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -76,6 +76,10 @@ DECLARE_EXPORTED_HEAP_OBJECT(Object, Base) { static void markObjects(Heap::Base *base, MarkStack *stack); void init() { Base::init(); } + const Value *inlinePropertyDataWithOffset(uint indexWithOffset) const { + Q_ASSERT(indexWithOffset >= vtable()->inlinePropertyOffset && indexWithOffset < vtable()->inlinePropertyOffset + vtable()->nInlineProperties); + return reinterpret_cast<const Value *>(this) + indexWithOffset; + } const Value *inlinePropertyData(uint index) const { Q_ASSERT(index < vtable()->nInlineProperties); return reinterpret_cast<const Value *>(this) + vtable()->inlinePropertyOffset + index; |