aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4object_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-11-04 14:57:59 +0100
committerLars Knoll <lars.knoll@qt.io>2017-11-14 21:45:50 +0000
commit5c0481c1934ef4b39437eef06ddfa15170473bcb (patch)
tree4f5418b31e53417a94f01c2ba0e9b83e4509c54e /src/qml/jsruntime/qv4object_p.h
parent002fdc48d43e4fd67921e0cd46c28d28aee06848 (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.h4
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;