Get rid of the GCBlocker
It's a hack we needed when we still had a conservative GC, but it is not required anymore. The only thing we still need is the protection against running the GC recursively. Change-Id: I55cd51d4929c828db5b61b38e781467c5bf77314 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
67d783622d
commit
d2eaf438ac
|
@ -158,8 +158,6 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
|
||||||
}
|
}
|
||||||
Q_ASSERT(maxCallDepth > 0);
|
Q_ASSERT(maxCallDepth > 0);
|
||||||
|
|
||||||
MemoryManager::GCBlocker gcBlocker(memoryManager);
|
|
||||||
|
|
||||||
if (!factory) {
|
if (!factory) {
|
||||||
#if QT_CONFIG(qml_interpreter)
|
#if QT_CONFIG(qml_interpreter)
|
||||||
bool jitDisabled = true;
|
bool jitDisabled = true;
|
||||||
|
|
|
@ -88,8 +88,6 @@ void Script::parse()
|
||||||
ExecutionEngine *v4 = scope->engine();
|
ExecutionEngine *v4 = scope->engine();
|
||||||
Scope valueScope(v4);
|
Scope valueScope(v4);
|
||||||
|
|
||||||
MemoryManager::GCBlocker gcBlocker(v4->memoryManager);
|
|
||||||
|
|
||||||
IR::Module module(v4->debugger() != 0);
|
IR::Module module(v4->debugger() != 0);
|
||||||
|
|
||||||
QQmlJS::Engine ee, *engine = ⅇ
|
QQmlJS::Engine ee, *engine = ⅇ
|
||||||
|
|
|
@ -565,16 +565,6 @@ void MemoryManager::sweep(bool lastSweep)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MemoryManager::isGCBlocked() const
|
|
||||||
{
|
|
||||||
return m_d->gcBlocked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MemoryManager::setGCBlocked(bool blockGC)
|
|
||||||
{
|
|
||||||
m_d->gcBlocked = blockGC;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MemoryManager::runGC()
|
void MemoryManager::runGC()
|
||||||
{
|
{
|
||||||
if (m_d->gcBlocked) {
|
if (m_d->gcBlocked) {
|
||||||
|
|
|
@ -76,26 +76,6 @@ class Q_QML_EXPORT MemoryManager
|
||||||
public:
|
public:
|
||||||
struct Data;
|
struct Data;
|
||||||
|
|
||||||
class GCBlocker
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
GCBlocker(MemoryManager *mm)
|
|
||||||
: mm(mm)
|
|
||||||
, wasBlocked(mm->isGCBlocked())
|
|
||||||
{
|
|
||||||
mm->setGCBlocked(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
~GCBlocker()
|
|
||||||
{
|
|
||||||
mm->setGCBlocked(wasBlocked);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
MemoryManager *mm;
|
|
||||||
bool wasBlocked;
|
|
||||||
};
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MemoryManager(ExecutionEngine *engine);
|
MemoryManager(ExecutionEngine *engine);
|
||||||
~MemoryManager();
|
~MemoryManager();
|
||||||
|
@ -309,8 +289,6 @@ public:
|
||||||
return t->d();
|
return t->d();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isGCBlocked() const;
|
|
||||||
void setGCBlocked(bool blockGC);
|
|
||||||
void runGC();
|
void runGC();
|
||||||
|
|
||||||
void dumpStats() const;
|
void dumpStats() const;
|
||||||
|
|
Loading…
Reference in New Issue