From: Martin Jones Date: Thu, 1 Mar 2012 09:04:29 +0000 (+1000) Subject: V4 handles a maximum of 32 temporary registers. X-Git-Tag: qt-v5.0.0-alpha1~261 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8bcedb39a738e417fb9c159dc2eb003873d60271;p=profile%2Fivi%2Fqtdeclarative.git 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 --- diff --git a/src/declarative/qml/v4/qv4compiler.cpp b/src/declarative/qml/v4/qv4compiler.cpp index 42e56d1..29023ae 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 85a7c36..c431406 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;