// ### FIXME: v4
// v8::Debug::SetMessageHandler2(DebugMessageHandler);
// v8::Debug::SetDebugMessageDispatchHandler(DebugMessageDispatchHandler);
-#ifdef QT_USE_OLD_V4
- QV4Compiler::enableV4(false);
-#endif
}
// executed in the gui thread
extern QQmlAbstractBinding::VTable QQmlBinding_vtable;
extern QQmlAbstractBinding::VTable QQmlValueTypeProxyBinding_vtable;
-#ifdef QT_USE_OLD_V4
-extern QQmlAbstractBinding::VTable QV4Bindings_Binding_vtable;
-#endif
extern QQmlAbstractBinding::VTable QV8Bindings_Binding_vtable;
QQmlAbstractBinding::VTable *QQmlAbstractBinding::vTables[] = {
&QQmlBinding_vtable,
-#ifdef QT_USE_OLD_V4
- &QV4Bindings_Binding_vtable,
-#else
- 0,
-#endif
&QV8Bindings_Binding_vtable,
&QQmlValueTypeProxyBinding_vtable
};
#include "qqmlscriptstring.h"
#include "qqmlglobal_p.h"
#include "qqmlbinding_p.h"
-#ifdef QT_USE_OLD_V4
-#include <private/qv4compiler_p.h>
-#endif
#include <QDebug>
#include <QPointF>
output->addInstruction(store);
} else
#endif
-#ifdef QT_USE_OLD_V4
- if (ref.dataType == BindingReference::V4) {
- const JSBindingReference &js = static_cast<const JSBindingReference &>(ref);
-
- Instruction::StoreV4Binding store;
- store.value = js.compiledIndex;
- store.fallbackValue = js.sharedIndex;
- store.context = js.bindingContext.stack;
- store.owner = js.bindingContext.owner;
- store.isAlias = prop->isAlias;
- if (valueTypeProperty) {
- store.property = ((prop->index << 16) | valueTypeProperty->index);
- store.propType = valueTypeProperty->type;
- store.isRoot = (compileState->root == valueTypeProperty->parent);
- } else {
- store.property = prop->index;
- store.propType = 0;
- store.isRoot = (compileState->root == obj);
- }
- store.line = binding->location.start.line;
- store.column = binding->location.start.column;
- output->addInstruction(store);
-
- if (store.fallbackValue > -1) {
- //also create v8 instruction (needed to properly configure the fallback v8 binding)
- JSBindingReference &js = static_cast<JSBindingReference &>(*binding->bindingReference);
- js.dataType = BindingReference::V8;
- genBindingAssignment(binding, prop, obj, valueTypeProperty);
- }
- } else
-#endif
if (ref.dataType == BindingReference::V8) {
const JSBindingReference &js = static_cast<const JSBindingReference &>(ref);
aliasObject = compileState->aliasingObjects.next(aliasObject))
COMPILE_CHECK(buildDynamicMetaAliases(aliasObject));
-#ifdef QT_USE_OLD_V4
- QV4Compiler::Expression expr(unit->imports());
- expr.component = compileState->root;
- expr.ids = &compileState->ids;
- expr.importCache = output->importCache;
-
- QV4Compiler bindingCompiler;
-#endif
-
QList<JSBindingReference*> sharedBindings;
for (JSBindingReference *b = compileState->bindings.first(); b; b = b->nextReference) {
JSBindingReference &binding = *b;
- // First try v4
-#ifdef QT_USE_OLD_V4
- expr.context = binding.bindingContext.object;
- expr.property = binding.property;
- expr.expression = binding.expression;
-
- bool needsFallback = false;
- int index = bindingCompiler.compile(expr, enginePrivate, &needsFallback);
- if (index != -1) {
- binding.dataType = BindingReference::V4;
- binding.compiledIndex = index;
- binding.sharedIndex = -1;
- if (componentStats)
- componentStats->componentStat.optimizedBindings.append(b->value->location);
-
- if (!needsFallback)
- continue;
-
- // Drop through. We need to create a V8 binding in case the V4 binding is invalidated
- }
-#else
- bool needsFallback = false;
-#endif
-
// Pre-rewrite the expression
QString expression = binding.expression.asScript();
if (isSharable && binding.property->type != qMetaTypeId<QQmlBinding*>()) {
sharedBindings.append(b);
- if (!needsFallback) {
- binding.dataType = BindingReference::V8;
- binding.compiledIndex = -1;
+ binding.dataType = BindingReference::V8;
+ binding.compiledIndex = -1;
- if (componentStats)
- componentStats->componentStat.sharedBindings.append(b->value->location);
- }
+ if (componentStats)
+ componentStats->componentStat.sharedBindings.append(b->value->location);
} else {
- Q_ASSERT(!needsFallback);
binding.dataType = BindingReference::QtScript;
if (componentStats)
compileState->v8BindingProgramLine = startLineNumber;
}
-#ifdef QT_USE_OLD_V4
- if (bindingCompiler.isValid())
- compileState->compiledBindingData = bindingCompiler.program();
-#endif
// Check pop()'s matched push()'s
Q_ASSERT(compileState->objectDepth.depth() == 0);
struct BindingReference
{
- enum DataType { QtScript, V4, V8,
+ enum DataType { QtScript, V8,
Tr, TrId };
DataType dataType;
};
#include "qqmlengine_p.h"
#include "qqmlengine.h"
#include "qqmlinfo.h"
-#ifdef QT_USE_OLD_V4
-#include <private/qv4bindings_p.h>
-#endif
#include <private/qv8bindings_p.h>
#include <qjsengine.h>
propertyNames(0), contextObject(0), imports(0), childContexts(0), nextChild(0), prevChild(0),
expressions(0), contextObjects(0), contextGuards(0), idValues(0), idValueCount(0), linkedContext(0),
componentAttached(0),
-#ifdef QT_USE_OLD_V4
- v4bindings(0),
-#endif
v8bindings(0)
{
}
propertyNames(0), contextObject(0), imports(0), childContexts(0), nextChild(0), prevChild(0),
expressions(0), contextObjects(0), contextGuards(0), idValues(0), idValueCount(0), linkedContext(0),
componentAttached(0),
-#ifdef QT_USE_OLD_V4
- v4bindings(0),
-#endif
v8bindings(0)
{
}
if (imports)
imports->release();
-#ifdef QT_USE_OLD_V4
- if (v4bindings)
- v4bindings->release();
-#endif
-
if (v8bindings)
v8bindings->release();
class QQmlExpression;
class QQmlExpressionPrivate;
class QQmlAbstractExpression;
-#ifdef QT_USE_OLD_V4
-class QV4Bindings;
-#endif
class QQmlContextData;
class QQmlContextPrivate : public QObjectPrivate
// context
QQmlComponentAttached *componentAttached;
- // Optimized binding objects. Needed for deferred properties.
-#ifdef QT_USE_OLD_V4
- QV4Bindings *v4bindings;
-#endif
QV8Bindings *v8bindings;
// Return the outermost id for obj, if any.
case QQmlInstruction::StoreBinding:
qWarning().nospace() << idx << "\t\t" << "STORE_BINDING\t" << instr->assignBinding.property.coreIndex << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
break;
-#ifdef QT_USE_OLD_V4
- case QQmlInstruction::StoreV4Binding:
- qWarning().nospace() << idx << "\t\t" << "STORE_COMPILED_BINDING\t" << instr->assignV4Binding.property << "\t" << instr->assignV4Binding.value << "\t" << instr->assignV4Binding.context;
- break;
-#endif
case QQmlInstruction::StoreV8Binding:
qWarning().nospace() << idx << "\t\t" << "STORE_V8_BINDING\t" << instr->assignBinding.property.coreIndex << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
break;
QT_BEGIN_NAMESPACE
-#ifdef QT_USE_OLD_V4
-#define FV4(x, y) F(x,y)
-#else
-#define FV4(x, y)
-#endif
-
#define FOR_EACH_QML_INSTR(F) \
F(Init, init) \
F(DeferInit, deferInit) \
F(InitV8Bindings, initV8Bindings) \
F(StoreBinding, assignBinding) \
F(StoreV8Binding, assignBinding) \
- FV4(StoreV4Binding, assignV4Binding) \
F(StoreValueSource, assignValueSource) \
F(StoreValueInterceptor, assignValueInterceptor) \
F(StoreObjectQList, common) \
void QQmlBoundSignal_callback(QQmlNotifierEndpoint *, void **);
void QQmlJavaScriptExpressionGuard_callback(QQmlNotifierEndpoint *, void **);
void QQmlVMEMetaObjectEndpoint_callback(QQmlNotifierEndpoint *, void **);
-#ifdef QT_USE_OLD_V4
-void QV4BindingsSubscription_callback(QQmlNotifierEndpoint *, void **);
-#endif
static Callback QQmlNotifier_callbacks[] = {
0,
QQmlBoundSignal_callback,
QQmlJavaScriptExpressionGuard_callback,
QQmlVMEMetaObjectEndpoint_callback
-#ifdef QT_USE_OLD_V4
- , QV4BindingsSubscription_callback
-#endif
};
void QQmlNotifier::emitNotify(QQmlNotifierEndpoint *endpoint, void **a)
#include "qqmlcomponent_p.h"
#include "qqmlvmemetaobject_p.h"
#include "qqmlcontext_p.h"
-#ifdef QT_USE_OLD_V4
-#include <private/qv4bindings_p.h>
-#endif
#include <private/qv8bindings_p.h>
#include "qqmlglobal_p.h"
#include <private/qfinitestack_p.h>
CTXT->setParent(parentCtxt);
if (instr.contextCache != -1)
CTXT->setIdPropertyData(COMP->contextCaches.at(instr.contextCache));
-#ifdef QT_USE_OLD_V4
- if (instr.compiledBinding != -1) {
- const char *v4data = DATAS.at(instr.compiledBinding).constData();
- CTXT->v4bindings = new QV4Bindings(v4data, CTXT);
- }
-#endif
if (states.count() == 1) {
rootContext = CTXT;
rootContext->activeVMEData = data;
}
QML_END_INSTR(StoreBinding)
-#ifdef QT_USE_OLD_V4
- QML_BEGIN_INSTR(StoreV4Binding)
- QObject *target =
- objects.at(objects.count() - 1 - instr.owner);
- QObject *scope =
- objects.at(objects.count() - 1 - instr.context);
-
- int propertyIdx = (instr.property & 0x0000FFFF);
-
- if (instr.isRoot && BINDINGSKIPLIST.testBit(propertyIdx))
- QML_NEXT_INSTR(StoreV4Binding);
-
- QQmlAbstractBinding *binding = CTXT->v4bindings->configBinding(target, scope, &instr);
- bindValues.push(binding);
- binding->m_mePtr = &bindValues.top();
-
- if (instr.isAlias) {
- QQmlAbstractBinding *old =
- QQmlPropertyPrivate::setBindingNoEnable(target,
- propertyIdx,
- instr.propType ? (instr.property >> 16) : -1,
- binding);
- if (old) { old->destroy(); }
- } else {
- Q_ASSERT(binding->propertyIndex() == instr.property);
- Q_ASSERT(binding->object() == target);
-
- CLEAN_PROPERTY(target, instr.property);
-
- binding->addToObject();
-
- if (instr.propType == 0) {
- // All non-valuetype V4 bindings are safe bindings
- QQmlData *data = QQmlData::get(target);
- Q_ASSERT(data);
- data->setPendingBindingBit(target, propertyIdx);
- }
- }
- QML_END_INSTR(StoreV4Binding)
-#endif
-
QML_BEGIN_INSTR(StoreV8Binding)
QObject *target =
objects.at(objects.count() - 1 - instr.owner);