diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-07-27 08:31:21 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-07-27 10:30:23 (GMT) |
commit | ab7c405ac2e528eb23b2c56ef02bd33c42bc3256 (patch) | |
tree | f6e90a9ede2252deb4a948c1a8dba52ebc6966e1 /src | |
parent | 39097c5d652efd3eb0946e5a215d82573a46dbf9 (diff) | |
download | Qt-ab7c405ac2e528eb23b2c56ef02bd33c42bc3256.zip Qt-ab7c405ac2e528eb23b2c56ef02bd33c42bc3256.tar.gz Qt-ab7c405ac2e528eb23b2c56ef02bd33c42bc3256.tar.bz2 |
QScriptEngineAgent: recompile all the function when installing a debugger.
Recompile all the function is necessary to ger the debug opcode that
notifies us when the position changes.
The change in CollectorHeapIterator.h is nessesary to get it work as
Debugger::recompileAllJSFunctions uses LiveObjectIterator,
LiveObjectIterator initialied m_cell to -1 and to ++(*this) in its
constructor. But as m_cell is of type size_t (unsigned) then the
< comparison will always fail as it is an unsigned comparison.
This was already fixed upstream in r54672
Reviewed-by: Jedrzej Nowacki
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/runtime/CollectorHeapIterator.h | 10 | ||||
-rw-r--r-- | src/script/api/qscriptengine.cpp | 1 | ||||
-rw-r--r-- | src/script/api/qscriptengineagent.cpp | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/CollectorHeapIterator.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/CollectorHeapIterator.h index e4f2f91..4a38df9 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/CollectorHeapIterator.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/CollectorHeapIterator.h @@ -97,14 +97,12 @@ namespace JSC { inline LiveObjectIterator& LiveObjectIterator::operator++() { - if (m_block < m_heap.nextBlock || m_cell < m_heap.nextCell) { - advance(HeapConstants::cellsPerBlock); + advance(HeapConstants::cellsPerBlock - 1); + if (m_block < m_heap.nextBlock || (m_block == m_heap.nextBlock && m_cell < m_heap.nextCell)) return *this; - } - do { - advance(HeapConstants::cellsPerBlock); - } while (m_block < m_heap.usedBlocks && !m_heap.blocks[m_block]->marked.get(m_cell)); + while (m_block < m_heap.usedBlocks && !m_heap.blocks[m_block]->marked.get(m_cell)) + advance(HeapConstants::cellsPerBlock - 1); return *this; } diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 7bccffe..26673f4 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -4196,6 +4196,7 @@ void QScriptEngine::setAgent(QScriptEngineAgent *agent) "cannot set agent belonging to different engine"); return; } + QScript::APIShim shim(d); if (d->activeAgent) QScriptEngineAgentPrivate::get(d->activeAgent)->detach(); d->activeAgent = agent; diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp index 0b5828a..c3d1566 100644 --- a/src/script/api/qscriptengineagent.cpp +++ b/src/script/api/qscriptengineagent.cpp @@ -117,6 +117,8 @@ void QScriptEngineAgentPrivate::attach() if (engine->originalGlobalObject()->debugger()) engine->originalGlobalObject()->setDebugger(0); JSC::Debugger::attach(engine->originalGlobalObject()); + if (!QScriptEnginePrivate::get(engine)->isEvaluating()) + JSC::Debugger::recompileAllJSFunctions(engine->globalData); } void QScriptEngineAgentPrivate::detach() |