aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-03-09 13:32:59 +0100
committerLars Knoll <lars.knoll@qt.io>2017-04-07 06:06:22 +0000
commitb361a59c699fca02379c149cf0b9c59490a1ba62 (patch)
treeb66f16bff41b941d44b07d5e14706d2ae3e73e44 /src/qml
parent589f8a90fa8c158ec97f32d4a9539b47ba8486a2 (diff)
Micro optimization
Avoid the check whether the Value has a HeapObject if the Value is a Managed. Change-Id: I1dd42126cab57d094698402390fdcb4e427a7919 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/jsruntime/qv4engine_p.h6
-rw-r--r--src/qml/jsruntime/qv4managed_p.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index bace8b700b..a2c774c295 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -559,6 +559,12 @@ inline void Value::mark(MarkStack *markStack)
o->mark(markStack);
}
+inline void Managed::mark(MarkStack *markStack)
+{
+ Q_ASSERT(m());
+ m()->mark(markStack);
+}
+
#define CHECK_STACK_LIMITS(v4, scope) if ((v4)->checkStackLimits(scope)) return; \
ExecutionEngineCallDepthRecorder _executionEngineCallDepthRecorder(v4);
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h
index 9ecc4bd087..f97771831c 100644
--- a/src/qml/jsruntime/qv4managed_p.h
+++ b/src/qml/jsruntime/qv4managed_p.h
@@ -207,6 +207,7 @@ public:
bool inUse() const { return d()->inUse(); }
bool markBit() const { return d()->isMarked(); }
+ inline void mark(MarkStack *markStack);
static void destroy(Heap::Base *) {}
static void markObjects(Heap::Base *, MarkStack *) {}