aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2012-03-01 19:04:29 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-02 06:14:49 +0100
commit8bcedb39a738e417fb9c159dc2eb003873d60271 (patch)
tree8df367b6d3a96a71a0949dd90f47caa0ffe45a66 /src
parent61ab01252d928576bf9ef1d8c6cc421e1a825dde (diff)
V4 handles a maximum of 32 temporary registers.
Drop back to V8 if there are more than 32 being used. Change-Id: I11f6e84746d897cd9b6789a5e9e4d2848909de00 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/v4/qv4compiler.cpp5
-rw-r--r--src/declarative/qml/v4/qv4compiler_p_p.h1
2 files changed, 4 insertions, 2 deletions
diff --git a/src/declarative/qml/v4/qv4compiler.cpp b/src/declarative/qml/v4/qv4compiler.cpp
index 42e56d12c9..29023ae66e 100644
--- a/src/declarative/qml/v4/qv4compiler.cpp
+++ b/src/declarative/qml/v4/qv4compiler.cpp
@@ -62,7 +62,7 @@ static bool qmlEnableV4 = true;
using namespace QDeclarativeJS;
QV4CompilerPrivate::QV4CompilerPrivate()
-: _function(0) , _block(0) , _discarded(false)
+ : _function(0) , _block(0) , _discarded(false), registerCount(0)
{
}
@@ -74,6 +74,7 @@ void QV4CompilerPrivate::trace(int line, int column)
bytecode.clear();
this->currentReg = _function->tempCount;
+ this->registerCount = qMax(this->registerCount, this->currentReg);
foreach (IR::BasicBlock *bb, _function->basicBlocks) {
if (! bb->isTerminated() && (bb->index + 1) < _function->basicBlocks.size())
@@ -1118,7 +1119,7 @@ bool QV4CompilerPrivate::compile(QDeclarativeJS::AST::Node *node)
qerr << endl;
}
- if (discarded || subscriptionIds.count() > 0xFFFF || registeredStrings.count() > 0xFFFF)
+ if (discarded || subscriptionIds.count() > 0xFFFF || registeredStrings.count() > 0xFFFF || registerCount > 31)
return false;
return true;
diff --git a/src/declarative/qml/v4/qv4compiler_p_p.h b/src/declarative/qml/v4/qv4compiler_p_p.h
index 85a7c36f87..c43140663e 100644
--- a/src/declarative/qml/v4/qv4compiler_p_p.h
+++ b/src/declarative/qml/v4/qv4compiler_p_p.h
@@ -231,6 +231,7 @@ private:
void discard() { _discarded = true; }
bool _discarded;
quint8 currentReg;
+ quint8 registerCount;
bool usedSubscriptionIdsChanged;
quint32 currentBlockMask;