Cosmetic improvements to marking of objects during GC

Change-Id: I79a7093c7086ea7f34252f097f18fe7c835053aa
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
This commit is contained in:
Lars Knoll 2015-09-08 14:58:55 +02:00
parent c72f973a35
commit a8ccf32793
2 changed files with 7 additions and 6 deletions

View File

@ -496,11 +496,12 @@ void Heap::Base::mark(QV4::ExecutionEngine *engine)
inline void Value::mark(ExecutionEngine *e)
{
if (!_val)
if (!isManaged())
return;
Managed *m = as<Managed>();
if (m)
m->d()->mark(e);
Heap::Base *o = heapObject();
if (o)
o->mark(e);
}

View File

@ -361,10 +361,10 @@ void MemoryManager::mark()
engine->markObjects();
m_persistentValues->mark(engine);
collectFromJSStack();
m_persistentValues->mark(engine);
// Preserve QObject ownership rules within JavaScript: A parent with c++ ownership
// keeps all of its children alive in JavaScript.