Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rename QDeclarativeV4 -> QV4
Change-Id: Ic35e0ad1663cafe4aa535594dc3999a2d317ce0e
Reviewed-on: http://codereview.qt-project.org/6301
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Sanity-Review: Aaron Kennedy <aaron.kennedy@nokia.com>
  • Loading branch information
Aaron Kennedy authored and Qt by Nokia committed Oct 12, 2011
1 parent 25a743d commit fee823e
Show file tree
Hide file tree
Showing 34 changed files with 282 additions and 283 deletions.
6 changes: 3 additions & 3 deletions src/declarative/qml/qdeclarativecompiler.cpp
Expand Up @@ -61,7 +61,7 @@
#include "qdeclarativescriptstring.h"
#include "private/qdeclarativeglobal_p.h"
#include "private/qdeclarativebinding_p.h"
#include "private/qdeclarativev4compiler_p.h"
#include "private/qv4compiler_p.h"

#include <QColor>
#include <QDebug>
Expand Down Expand Up @@ -3298,12 +3298,12 @@ bool QDeclarativeCompiler::completeComponentBuild()
aliasObject = compileState->aliasingObjects.next(aliasObject))
COMPILE_CHECK(buildDynamicMeta(aliasObject, ResolveAliases));

QDeclarativeV4Compiler::Expression expr(unit->imports());
QV4Compiler::Expression expr(unit->imports());
expr.component = compileState->root;
expr.ids = &compileState->ids;
expr.importCache = output->importCache;

QDeclarativeV4Compiler bindingCompiler;
QV4Compiler bindingCompiler;

QList<BindingReference*> sharedBindings;

Expand Down
2 changes: 1 addition & 1 deletion src/declarative/qml/qdeclarativecontext.cpp
Expand Up @@ -47,7 +47,7 @@
#include "private/qdeclarativeengine_p.h"
#include "qdeclarativeengine.h"
#include "qdeclarativeinfo.h"
#include "private/qdeclarativev4bindings_p.h"
#include "private/qv4bindings_p.h"
#include "private/qv8bindings_p.h"

#include <qjsengine.h>
Expand Down
4 changes: 2 additions & 2 deletions src/declarative/qml/qdeclarativecontext_p.h
Expand Up @@ -80,7 +80,7 @@ class QDeclarativeEngine;
class QDeclarativeExpression;
class QDeclarativeExpressionPrivate;
class QDeclarativeAbstractExpression;
class QDeclarativeV4Bindings;
class QV4Bindings;
class QDeclarativeContextData;

class QDeclarativeContextPrivate : public QObjectPrivate
Expand Down Expand Up @@ -206,7 +206,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeContextData
QDeclarativeComponentAttached *componentAttached;

// Optimized binding objects. Needed for deferred properties.
QDeclarativeV4Bindings *v4bindings;
QV4Bindings *v4bindings;
QV8Bindings *v8bindings;

// Return the outermost id for obj, if any.
Expand Down
4 changes: 2 additions & 2 deletions src/declarative/qml/qdeclarativevme.cpp
Expand Up @@ -58,7 +58,7 @@
#include "private/qdeclarativevmemetaobject_p.h"
#include "private/qdeclarativebinding_p_p.h"
#include "private/qdeclarativecontext_p.h"
#include "private/qdeclarativev4bindings_p.h"
#include "private/qv4bindings_p.h"
#include "private/qv8bindings_p.h"
#include "private/qdeclarativeglobal_p.h"
#include "private/qfinitestack_p.h"
Expand Down Expand Up @@ -306,7 +306,7 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors,
CTXT->setIdPropertyData(COMP->contextCaches.at(instr.contextCache));
if (instr.compiledBinding != -1) {
const char *v4data = DATAS.at(instr.compiledBinding).constData();
CTXT->v4bindings = new QDeclarativeV4Bindings(v4data, CTXT, COMP);
CTXT->v4bindings = new QV4Bindings(v4data, CTXT, COMP);
}
if (states.count() == 1) {
rootContext = CTXT;
Expand Down
Expand Up @@ -41,10 +41,10 @@

// #define REGISTER_CLEANUP_DEBUG

#include "private/qdeclarativev4bindings_p.h"
#include "private/qdeclarativev4program_p.h"
#include "private/qdeclarativev4compiler_p.h"
#include "private/qdeclarativev4compiler_p_p.h"
#include "private/qv4bindings_p.h"
#include "private/qv4program_p.h"
#include "private/qv4compiler_p.h"
#include "private/qv4compiler_p_p.h"

#include <private/qdeclarativefastproperties_p.h>
#include <private/qdeclarativedebugtrace_p.h>
Expand Down Expand Up @@ -187,12 +187,12 @@ void Register::init(Type type)

} // end of anonymous namespace

QDeclarativeV4Bindings::QDeclarativeV4Bindings(const char *programData,
QV4Bindings::QV4Bindings(const char *programData,
QDeclarativeContextData *context,
QDeclarativeRefCount *ref)
: subscriptions(0), program(0), dataRef(0), bindings(0)
{
program = (QDeclarativeV4Program *)programData;
program = (QV4Program *)programData;
dataRef = ref;
if (dataRef) dataRef->addref();

Expand All @@ -204,14 +204,14 @@ QDeclarativeV4Bindings::QDeclarativeV4Bindings(const char *programData,
}
}

QDeclarativeV4Bindings::~QDeclarativeV4Bindings()
QV4Bindings::~QV4Bindings()
{
delete [] bindings;
delete [] subscriptions; subscriptions = 0;
if (dataRef) dataRef->release();
}

QDeclarativeAbstractBinding *QDeclarativeV4Bindings::configBinding(int index, QObject *target,
QDeclarativeAbstractBinding *QV4Bindings::configBinding(int index, QObject *target,
QObject *scope, int property)
{
Binding *rv = bindings + index;
Expand All @@ -227,7 +227,7 @@ QDeclarativeAbstractBinding *QDeclarativeV4Bindings::configBinding(int index, QO
return rv;
}

void QDeclarativeV4Bindings::Binding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags)
void QV4Bindings::Binding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags)
{
if (enabled != e) {
enabled = e;
Expand All @@ -236,14 +236,14 @@ void QDeclarativeV4Bindings::Binding::setEnabled(bool e, QDeclarativePropertyPri
}
}

void QDeclarativeV4Bindings::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags)
void QV4Bindings::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags)
{
QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Binding);
parent->run(this, flags);
QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Binding);
}

void QDeclarativeV4Bindings::Binding::destroy()
void QV4Bindings::Binding::destroy()
{
enabled = false;
removeFromObject();
Expand All @@ -252,26 +252,26 @@ void QDeclarativeV4Bindings::Binding::destroy()
parent->release();
}

void QDeclarativeV4Bindings::Subscription::subscriptionCallback(QDeclarativeNotifierEndpoint *e)
void QV4Bindings::Subscription::subscriptionCallback(QDeclarativeNotifierEndpoint *e)
{
Subscription *s = static_cast<Subscription *>(e);
s->bindings->subscriptionNotify(s->method);
}

void QDeclarativeV4Bindings::subscriptionNotify(int id)
void QV4Bindings::subscriptionNotify(int id)
{
QDeclarativeV4Program::BindingReferenceList *list = program->signalTable(id);
QV4Program::BindingReferenceList *list = program->signalTable(id);

for (quint32 ii = 0; ii < list->count; ++ii) {
QDeclarativeV4Program::BindingReference *bindingRef = list->bindings + ii;
QV4Program::BindingReference *bindingRef = list->bindings + ii;

Binding *binding = bindings + bindingRef->binding;
if (binding->executedBlocks & bindingRef->blockMask)
run(binding, QDeclarativePropertyPrivate::DontRemoveBinding);
}
}

void QDeclarativeV4Bindings::run(Binding *binding, QDeclarativePropertyPrivate::WriteFlags flags)
void QV4Bindings::run(Binding *binding, QDeclarativePropertyPrivate::WriteFlags flags)
{
if (!binding->enabled)
return;
Expand Down Expand Up @@ -317,13 +317,13 @@ void QDeclarativeV4Bindings::run(Binding *binding, QDeclarativePropertyPrivate::
}


void QDeclarativeV4Bindings::unsubscribe(int subIndex)
void QV4Bindings::unsubscribe(int subIndex)
{
Subscription *sub = (subscriptions + subIndex);
sub->disconnect();
}

void QDeclarativeV4Bindings::subscribeId(QDeclarativeContextData *p, int idIndex, int subIndex)
void QV4Bindings::subscribeId(QDeclarativeContextData *p, int idIndex, int subIndex)
{
unsubscribe(subIndex);

Expand All @@ -335,7 +335,7 @@ void QDeclarativeV4Bindings::subscribeId(QDeclarativeContextData *p, int idIndex
}
}

void QDeclarativeV4Bindings::subscribe(QObject *o, int notifyIndex, int subIndex)
void QV4Bindings::subscribe(QObject *o, int notifyIndex, int subIndex)
{
Subscription *sub = (subscriptions + subIndex);
sub->bindings = this;
Expand Down Expand Up @@ -544,7 +544,7 @@ static void testBindingResult(const QString &binding, int line, int column,
iserror = true;

if (iserror) {
qWarning().nospace() << "QDeclarativeV4: Optimization error @" << context->url.toString().toUtf8().constData() << ":" << line << ":" << column;
qWarning().nospace() << "QV4: Optimization error @" << context->url.toString().toUtf8().constData() << ":" << line << ":" << column;

qWarning().nospace() << " Binding: " << binding;
qWarning().nospace() << " QtScript: " << qtscriptResult.constData();
Expand All @@ -561,15 +561,15 @@ static void testBindingException(const QString &binding, int line, int column,

if (!expression.hasError()) {
QByteArray qtscriptResult = testResultToString(value, isUndefined);
qWarning().nospace() << "QDeclarativeV4: Optimization error @" << context->url.toString().toUtf8().constData() << ":" << line << ":" << column;
qWarning().nospace() << "QV4: Optimization error @" << context->url.toString().toUtf8().constData() << ":" << line << ":" << column;
qWarning().nospace() << " Binding: " << binding;
qWarning().nospace() << " QtScript: " << qtscriptResult.constData();
qWarning().nospace() << " V4: exception";
}
}

static void throwException(int id, QDeclarativeDelayedError *error,
QDeclarativeV4Program *program, QDeclarativeContextData *context,
QV4Program *program, QDeclarativeContextData *context,
const QString &description = QString())
{
error->error.setUrl(context->url);
Expand All @@ -589,9 +589,9 @@ static void throwException(int id, QDeclarativeDelayedError *error,
QDeclarativeEnginePrivate::warning(context->engine, error->error);
}

const qreal QDeclarativeV4Bindings::D32 = 4294967296.0;
const qreal QV4Bindings::D32 = 4294967296.0;

qint32 QDeclarativeV4Bindings::toInt32(qreal n)
qint32 QV4Bindings::toInt32(qreal n)
{
if (qIsNaN(n) || qIsInf(n) || (n == 0))
return 0;
Expand All @@ -611,7 +611,7 @@ qint32 QDeclarativeV4Bindings::toInt32(qreal n)
return qint32 (n);
}

inline quint32 QDeclarativeV4Bindings::toUint32(qreal n)
inline quint32 QV4Bindings::toUint32(qreal n)
{
if (qIsNaN(n) || qIsInf(n) || (n == 0))
return 0;
Expand Down Expand Up @@ -654,11 +654,11 @@ inline quint32 QDeclarativeV4Bindings::toUint32(qreal n)
}

#ifdef QML_THREADED_INTERPRETER
void **QDeclarativeV4Bindings::getDecodeInstrTable()
void **QV4Bindings::getDecodeInstrTable()
{
static void **decode_instr;
if (!decode_instr) {
QDeclarativeV4Bindings *dummy = new QDeclarativeV4Bindings(0, 0, 0);
QV4Bindings *dummy = new QV4Bindings(0, 0, 0);
quint32 executedBlocks = 0;
dummy->run(0, executedBlocks, 0, 0, 0, 0,
QDeclarativePropertyPrivate::BypassInterceptor,
Expand All @@ -669,7 +669,7 @@ void **QDeclarativeV4Bindings::getDecodeInstrTable()
}
#endif

void QDeclarativeV4Bindings::run(int instrIndex, quint32 &executedBlocks,
void QV4Bindings::run(int instrIndex, quint32 &executedBlocks,
QDeclarativeContextData *context, QDeclarativeDelayedError *error,
QObject *scope, QObject *output,
QDeclarativePropertyPrivate::WriteFlags storeFlags
Expand Down Expand Up @@ -1411,7 +1411,7 @@ void QDeclarativeV4Bindings::run(int instrIndex, quint32 &executedBlocks,
// nothing to do
#else
default:
qFatal("QDeclarativeV4: Unknown instruction %d encountered.", instr->common.type);
qFatal("QV4: Unknown instruction %d encountered.", instr->common.type);
break;
} // switch

Expand Down
Expand Up @@ -39,8 +39,8 @@
**
****************************************************************************/

#ifndef QDECLARATIVEV4BINDINGS_P_H
#define QDECLARATIVEV4BINDINGS_P_H
#ifndef QV4BINDINGS_P_H
#define QV4BINDINGS_P_H

//
// W A R N I N G
Expand All @@ -55,21 +55,21 @@

#include "private/qdeclarativeexpression_p.h"
#include "private/qdeclarativebinding_p.h"
#include "private/qdeclarativev4instruction_p.h"
#include "private/qv4instruction_p.h"

QT_BEGIN_HEADER

QT_BEGIN_NAMESPACE

class QDeclarativeV4Program;
class QDeclarativeV4Bindings : public QDeclarativeAbstractExpression,
class QV4Program;
class QV4Bindings : public QDeclarativeAbstractExpression,
public QDeclarativeRefCount
{
Q_DECLARE_TR_FUNCTIONS(QDeclarativeV4Bindings)
Q_DECLARE_TR_FUNCTIONS(QV4Bindings)
public:
QDeclarativeV4Bindings(const char *program, QDeclarativeContextData *context,
QV4Bindings(const char *program, QDeclarativeContextData *context,
QDeclarativeRefCount *);
virtual ~QDeclarativeV4Bindings();
virtual ~QV4Bindings();

QDeclarativeAbstractBinding *configBinding(int index, QObject *target,
QObject *scope, int property);
Expand All @@ -79,7 +79,7 @@ class QDeclarativeV4Bindings : public QDeclarativeAbstractExpression,
#endif

private:
Q_DISABLE_COPY(QDeclarativeV4Bindings)
Q_DISABLE_COPY(QV4Bindings)

struct Binding : public QDeclarativeAbstractBinding, public QDeclarativeDelayedError {
Binding() : enabled(false), updating(0), property(0),
Expand All @@ -98,14 +98,14 @@ class QDeclarativeV4Bindings : public QDeclarativeAbstractExpression,
QObject *target;
quint32 executedBlocks;

QDeclarativeV4Bindings *parent;
QV4Bindings *parent;
};

struct Subscription : public QDeclarativeNotifierEndpoint
{
Subscription() : bindings(0), method(-1) { callback = &subscriptionCallback; }
static void subscriptionCallback(QDeclarativeNotifierEndpoint *e);
QDeclarativeV4Bindings *bindings;
QV4Bindings *bindings;
int method;
};
friend class Subscription;
Expand All @@ -115,7 +115,7 @@ class QDeclarativeV4Bindings : public QDeclarativeAbstractExpression,
void subscriptionNotify(int);
void run(Binding *, QDeclarativePropertyPrivate::WriteFlags flags);

QDeclarativeV4Program *program;
QV4Program *program;
QDeclarativeRefCount *dataRef;
Binding *bindings;

Expand Down Expand Up @@ -143,5 +143,5 @@ QT_END_NAMESPACE

QT_END_HEADER

#endif // QDECLARATIVEV4BINDINGS_P_H
#endif // QV4BINDINGS_P_H

0 comments on commit fee823e

Please sign in to comment.