From 5c0481c1934ef4b39437eef06ddfa15170473bcb Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 4 Nov 2017 14:57:59 +0100 Subject: Simplify inline getters Precalculate the offset inside the object. Change-Id: I61faf463677fe9602fe235a39dcf9e16c5d013cd Reviewed-by: Erik Verbruggen --- src/qml/jsruntime/qv4object_p.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/qml/jsruntime/qv4object_p.h') 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(this) + indexWithOffset; + } const Value *inlinePropertyData(uint index) const { Q_ASSERT(index < vtable()->nInlineProperties); return reinterpret_cast(this) + vtable()->inlinePropertyOffset + index; -- cgit v1.2.3