diff options
Diffstat (limited to 'src/qml/jsruntime/qv4engine_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4engine_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index 737f377730..4316967484 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -374,7 +374,7 @@ public: const bool m_canAllocateExecutableMemory; #endif - int internalClassIdCount = 0; + quintptr protoIdCount = 1; ExecutionEngine(QJSEngine *jsEngine = nullptr); ~ExecutionEngine(); @@ -398,7 +398,8 @@ public: return static_cast<ExecutionContext *>(¤tStackFrame->jsFrame->context); } - int newInternalClassId() { return ++internalClassIdCount; } + // ensure we always get odd prototype IDs. This helps make marking in QV4::Lookup fast + quintptr newProtoId() { return (protoIdCount += 2); } Heap::InternalClass *newInternalClass(const VTable *vtable, Object *prototype); |