The mandatory line number bloats QML instructions for no reason.
Moving it inline actually increases the instruction size further,
but that will come down again once variable sized instruction
support is added.
Change-Id: I0ace03a50371ef57946edbb7c8e0e8c2fa4fdd76
{
if (!name.isEmpty())
qWarning() << name;
- qWarning().nospace() << "Index\tLine\tOperation\t\tData1\tData2\tData3\tComments";
+ qWarning().nospace() << "Index\tOperation\t\tData1\tData2\tData3\tComments";
qWarning().nospace() << "-------------------------------------------------------------------------------";
for (int ii = 0; ii < bytecode.count(); ++ii) {
dump(&bytecode[ii], ii);
QDeclarativeParser::Value *v)
{
QDeclarativeInstruction instr;
- instr.line = v->location.start.line;
if (prop.isEnumType()) {
int value;
if (v->value.isNumber()) {
instr.type = QDeclarativeInstruction::AssignCustomType;
instr.assignCustomType.propertyIndex = prop.propertyIndex();
instr.assignCustomType.valueIndex = index;
+ instr.assignCustomType.line = v->location.start.line;
QDeclarativeCompiledData::CustomTypeData data;
data.index = output->indexForString(string);
QDeclarativeInstruction import;
import.type = QDeclarativeInstruction::StoreImportedScript;
- import.line = 0;
import.storeScript.value = output->scripts.count();
QDeclarativeScriptData *scriptData = script.script->scriptData();
QDeclarativeInstruction init;
init.type = QDeclarativeInstruction::Init;
- init.line = 0;
init.init.bindingsSize = compileState.bindings.count();
init.init.parserStatusSize = compileState.parserStatusCount;
init.init.contextCache = genContextCache();
genObject(tree);
QDeclarativeInstruction def;
- init.line = 0;
def.type = QDeclarativeInstruction::SetDefault;
output->bytecode << def;
QDeclarativeInstruction create;
create.type = QDeclarativeInstruction::CreateSimpleObject;
- create.line = obj->location.start.line;
create.createSimple.create = output->types.at(obj->type).type->createFunction();
create.createSimple.typeSize = output->types.at(obj->type).type->createSize();
create.createSimple.type = obj->type;
+ create.createSimple.line = obj->location.start.line;
create.createSimple.column = obj->location.start.column;
output->bytecode << create;
QDeclarativeInstruction create;
create.type = QDeclarativeInstruction::CreateObject;
- create.line = obj->location.start.line;
+ create.create.line = obj->location.start.line;
create.create.column = obj->location.start.column;
create.create.data = -1;
if (!obj->custom.isEmpty())
if (!obj->metadata.isEmpty()) {
QDeclarativeInstruction meta;
meta.type = QDeclarativeInstruction::StoreMetaObject;
- meta.line = 0;
meta.storeMeta.data = output->indexForByteArray(obj->metadata);
meta.storeMeta.aliasData = output->indexForByteArray(obj->synthdata);
meta.storeMeta.propertyCache = output->propertyCaches.count();
if (!obj->id.isEmpty()) {
QDeclarativeInstruction id;
id.type = QDeclarativeInstruction::SetId;
- id.line = 0;
id.setId.value = output->indexForString(obj->id);
id.setId.index = obj->idIndex;
output->bytecode << id;
QDeclarativeInstruction begin;
begin.type = QDeclarativeInstruction::BeginObject;
begin.begin.castValue = obj->parserStatusCast;
- begin.line = obj->location.start.line;
output->bytecode << begin;
}
if (seenDefer) {
QDeclarativeInstruction defer;
defer.type = QDeclarativeInstruction::Defer;
- defer.line = 0;
defer.defer.deferCount = 0;
int deferIdx = output->bytecode.count();
output->bytecode << defer;
QDeclarativeInstruction assign;
assign.type = QDeclarativeInstruction::AssignSignalObject;
- assign.line = v->location.start.line;
+ assign.assignSignalObject.line = v->location.start.line;
assign.assignSignalObject.signal =
output->indexForByteArray(prop->name);
output->bytecode << assign;
QDeclarativeInstruction store;
store.type = QDeclarativeInstruction::StoreSignal;
- store.line = v->location.start.line;
store.storeSignal.signalIndex = prop->index;
store.storeSignal.value =
output->indexForString(v->value.asScript().trimmed());
store.storeSignal.context = ctxt.stack;
store.storeSignal.name = output->indexForByteArray(prop->name);
+ store.storeSignal.line = v->location.start.line;
output->bytecode << store;
}
foreach(Property *prop, obj->attachedProperties) {
QDeclarativeInstruction fetch;
fetch.type = QDeclarativeInstruction::FetchAttached;
- fetch.line = prop->location.start.line;
fetch.fetchAttached.id = prop->index;
+ fetch.fetchAttached.line = prop->location.start.line;
output->bytecode << fetch;
genObjectBody(prop->value);
QDeclarativeInstruction pop;
pop.type = QDeclarativeInstruction::PopFetchedObject;
- pop.line = prop->location.start.line;
output->bytecode << pop;
}
QDeclarativeInstruction fetch;
fetch.type = QDeclarativeInstruction::FetchObject;
fetch.fetch.property = prop->index;
- fetch.line = prop->location.start.line;
+ fetch.fetch.line = prop->location.start.line;
output->bytecode << fetch;
if (!prop->value->metadata.isEmpty()) {
QDeclarativeInstruction meta;
meta.type = QDeclarativeInstruction::StoreMetaObject;
- meta.line = 0;
meta.storeMeta.data = output->indexForByteArray(prop->value->metadata);
meta.storeMeta.aliasData = output->indexForByteArray(prop->value->synthdata);
meta.storeMeta.propertyCache = -1;
QDeclarativeInstruction pop;
pop.type = QDeclarativeInstruction::PopFetchedObject;
- pop.line = prop->location.start.line;
output->bytecode << pop;
}
fetch.fetchValue.property = prop->index;
fetch.fetchValue.type = prop->type;
fetch.fetchValue.bindingSkipList = 0;
- fetch.line = prop->location.start.line;
if (obj->type == -1 || output->types.at(obj->type).component) {
// We only have to do this if this is a composite type. If it is a builtin
pop.fetchValue.property = prop->index;
pop.fetchValue.type = prop->type;
pop.fetchValue.bindingSkipList = 0;
- pop.line = prop->location.start.line;
output->bytecode << pop;
}
QDeclarativeInstruction create;
create.type = QDeclarativeInstruction::CreateComponent;
- create.line = root->location.start.line;
+ create.createComponent.line = root->location.start.line;
create.createComponent.column = root->location.start.column;
create.createComponent.endLine = root->location.end.line;
output->bytecode << create;
init.init.compiledBinding = -1;
else
init.init.compiledBinding = output->indexForByteArray(compileState.compiledBindingData);
- init.line = obj->location.start.line;
output->bytecode << init;
genObject(root);
QDeclarativeInstruction def;
- init.line = 0;
def.type = QDeclarativeInstruction::SetDefault;
output->bytecode << def;
if (!obj->id.isEmpty()) {
QDeclarativeInstruction id;
id.type = QDeclarativeInstruction::SetId;
- id.line = 0;
id.setId.value = output->indexForString(obj->id);
id.setId.index = obj->idIndex;
output->bytecode << id;
QDeclarativeInstruction fetch;
fetch.type = QDeclarativeInstruction::FetchQList;
- fetch.line = prop->location.start.line;
fetch.fetchQmlList.property = prop->index;
bool listTypeIsInterface = QDeclarativeMetaType::isInterface(listType);
fetch.fetchQmlList.type = listType;
if (listTypeIsInterface) {
QDeclarativeInstruction assign;
assign.type = QDeclarativeInstruction::AssignObjectList;
- assign.line = prop->location.start.line;
+ assign.assignObjectList.line = prop->location.start.line;
output->bytecode << assign;
} else {
QDeclarativeInstruction store;
store.type = QDeclarativeInstruction::StoreObjectQList;
- store.line = prop->location.start.line;
output->bytecode << store;
}
QDeclarativeInstruction pop;
pop.type = QDeclarativeInstruction::PopQList;
- pop.line = prop->location.start.line;
output->bytecode << pop;
}
QDeclarativeInstruction store;
store.type = QDeclarativeInstruction::StoreInterface;
- store.line = v->object->location.start.line;
+ store.storeObject.line = v->object->location.start.line;
store.storeObject.propertyIndex = prop->index;
output->bytecode << store;
QDeclarativeInstruction store;
store.type = QDeclarativeInstruction::StoreVariantObject;
- store.line = v->object->location.start.line;
+ store.storeObject.line = v->object->location.start.line;
store.storeObject.propertyIndex = prop->index;
output->bytecode << store;
QDeclarativeInstruction store;
store.type = QDeclarativeInstruction::StoreObject;
- store.line = v->object->location.start.line;
+ store.storeObject.line = v->object->location.start.line;
store.storeObject.propertyIndex = prop->index;
output->bytecode << store;
QDeclarativeInstruction store;
store.type = QDeclarativeInstruction::StoreValueSource;
- store.line = v->object->location.start.line;
if (valueTypeProperty) {
store.assignValueSource.property = genValueTypeData(prop, valueTypeProperty);
store.assignValueSource.owner = 1;
QDeclarativeInstruction store;
store.type = QDeclarativeInstruction::StoreValueInterceptor;
- store.line = v->object->location.start.line;
if (valueTypeProperty) {
store.assignValueInterceptor.property = genValueTypeData(prop, valueTypeProperty);
store.assignValueInterceptor.owner = 1;
((prop->index & 0xFF) << 24);
else
store.assignBinding.property = prop->index;
- store.line = binding->location.start.line;
+ store.assignBinding.line = binding->location.start.line;
output->bytecode << store;
return;
}
store.assignBinding.value = output->indexForByteArray(ref.compiledData);
store.assignBinding.context = ref.bindingContext.stack;
store.assignBinding.owner = ref.bindingContext.owner;
- store.line = binding->location.start.line;
+ store.assignBinding.line = binding->location.start.line;
Q_ASSERT(ref.bindingContext.owner == 0 ||
(ref.bindingContext.owner != 0 && valueTypeProperty));
Q_UNUSED(instr)
Q_UNUSED(idx)
#else
- QByteArray lineNumber = QByteArray::number(instr->line);
- if (instr->line == (unsigned short)-1)
- lineNumber = "NA";
- const char *line = lineNumber.constData();
-
switch(instr->type) {
case QDeclarativeInstruction::Init:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "INIT\t\t\t" << instr->init.bindingsSize << "\t" << instr->init.parserStatusSize << "\t" << instr->init.contextCache << "\t" << instr->init.compiledBinding;
+ qWarning().nospace() << idx << "\t\t" << "INIT\t\t\t" << instr->init.bindingsSize << "\t" << instr->init.parserStatusSize << "\t" << instr->init.contextCache << "\t" << instr->init.compiledBinding;
break;
case QDeclarativeInstruction::CreateObject:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "CREATE\t\t\t" << instr->create.type << "\t" << instr->create.bindingBits << "\t\t" << types.at(instr->create.type).className;
+ qWarning().nospace() << idx << "\t\t" << "CREATE\t\t\t" << instr->create.type << "\t" << instr->create.bindingBits << "\t\t" << types.at(instr->create.type).className;
break;
case QDeclarativeInstruction::CreateSimpleObject:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "CREATE_SIMPLE\t\t" << instr->createSimple.typeSize;
+ qWarning().nospace() << idx << "\t\t" << "CREATE_SIMPLE\t\t" << instr->createSimple.typeSize;
break;
case QDeclarativeInstruction::SetId:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "SETID\t\t\t" << instr->setId.value << "\t\t\t" << primitives.at(instr->setId.value);
+ qWarning().nospace() << idx << "\t\t" << "SETID\t\t\t" << instr->setId.value << "\t\t\t" << primitives.at(instr->setId.value);
break;
case QDeclarativeInstruction::SetDefault:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "SET_DEFAULT";
+ qWarning().nospace() << idx << "\t\t" << "SET_DEFAULT";
break;
case QDeclarativeInstruction::CreateComponent:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "CREATE_COMPONENT\t" << instr->createComponent.count;
+ qWarning().nospace() << idx << "\t\t" << "CREATE_COMPONENT\t" << instr->createComponent.count;
break;
case QDeclarativeInstruction::StoreMetaObject:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_META\t\t" << instr->storeMeta.data;
+ qWarning().nospace() << idx << "\t\t" << "STORE_META\t\t" << instr->storeMeta.data;
break;
-
case QDeclarativeInstruction::StoreFloat:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_FLOAT\t\t" << instr->storeFloat.propertyIndex << "\t" << instr->storeFloat.value;
+ qWarning().nospace() << idx << "\t\t" << "STORE_FLOAT\t\t" << instr->storeFloat.propertyIndex << "\t" << instr->storeFloat.value;
break;
case QDeclarativeInstruction::StoreDouble:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_DOUBLE\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value;
+ qWarning().nospace() << idx << "\t\t" << "STORE_DOUBLE\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value;
break;
case QDeclarativeInstruction::StoreInteger:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_INTEGER\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value;
+ qWarning().nospace() << idx << "\t\t" << "STORE_INTEGER\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value;
break;
case QDeclarativeInstruction::StoreBool:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_BOOL\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value;
+ qWarning().nospace() << idx << "\t\t" << "STORE_BOOL\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value;
break;
case QDeclarativeInstruction::StoreString:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_STRING\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value);
+ qWarning().nospace() << idx << "\t\t" << "STORE_STRING\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value);
break;
case QDeclarativeInstruction::StoreByteArray:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_BYTEARRAY" << instr->storeByteArray.propertyIndex << "\t" << instr->storeByteArray.value << "\t\t" << datas.at(instr->storeByteArray.value);
+ qWarning().nospace() << idx << "\t\t" << "STORE_BYTEARRAY" << instr->storeByteArray.propertyIndex << "\t" << instr->storeByteArray.value << "\t\t" << datas.at(instr->storeByteArray.value);
break;
case QDeclarativeInstruction::StoreUrl:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_URL\t\t" << instr->storeUrl.propertyIndex << "\t" << instr->storeUrl.value << "\t\t" << urls.at(instr->storeUrl.value);
+ qWarning().nospace() << idx << "\t\t" << "STORE_URL\t\t" << instr->storeUrl.propertyIndex << "\t" << instr->storeUrl.value << "\t\t" << urls.at(instr->storeUrl.value);
break;
case QDeclarativeInstruction::StoreColor:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_COLOR\t\t" << instr->storeColor.propertyIndex << "\t\t\t" << QString::number(instr->storeColor.value, 16);
+ qWarning().nospace() << idx << "\t\t" << "STORE_COLOR\t\t" << instr->storeColor.propertyIndex << "\t\t\t" << QString::number(instr->storeColor.value, 16);
break;
case QDeclarativeInstruction::StoreDate:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_DATE\t\t" << instr->storeDate.propertyIndex << "\t" << instr->storeDate.value;
+ qWarning().nospace() << idx << "\t\t" << "STORE_DATE\t\t" << instr->storeDate.propertyIndex << "\t" << instr->storeDate.value;
break;
case QDeclarativeInstruction::StoreTime:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_TIME\t\t" << instr->storeTime.propertyIndex << "\t" << instr->storeTime.valueIndex;
+ qWarning().nospace() << idx << "\t\t" << "STORE_TIME\t\t" << instr->storeTime.propertyIndex << "\t" << instr->storeTime.valueIndex;
break;
case QDeclarativeInstruction::StoreDateTime:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_DATETIME\t\t" << instr->storeDateTime.propertyIndex << "\t" << instr->storeDateTime.valueIndex;
+ qWarning().nospace() << idx << "\t\t" << "STORE_DATETIME\t\t" << instr->storeDateTime.propertyIndex << "\t" << instr->storeDateTime.valueIndex;
break;
case QDeclarativeInstruction::StorePoint:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_POINT\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
+ qWarning().nospace() << idx << "\t\t" << "STORE_POINT\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
break;
case QDeclarativeInstruction::StorePointF:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_POINTF\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
+ qWarning().nospace() << idx << "\t\t" << "STORE_POINTF\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
break;
case QDeclarativeInstruction::StoreSize:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SIZE\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
+ qWarning().nospace() << idx << "\t\t" << "STORE_SIZE\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
break;
case QDeclarativeInstruction::StoreSizeF:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SIZEF\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
+ qWarning().nospace() << idx << "\t\t" << "STORE_SIZEF\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
break;
case QDeclarativeInstruction::StoreRect:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_RECT\t\t" << instr->storeRect.propertyIndex << "\t" << instr->storeRect.valueIndex;
+ qWarning().nospace() << idx << "\t\t" << "STORE_RECT\t\t" << instr->storeRect.propertyIndex << "\t" << instr->storeRect.valueIndex;
break;
case QDeclarativeInstruction::StoreRectF:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_RECTF\t\t" << instr->storeRect.propertyIndex << "\t" << instr->storeRect.valueIndex;
+ qWarning().nospace() << idx << "\t\t" << "STORE_RECTF\t\t" << instr->storeRect.propertyIndex << "\t" << instr->storeRect.valueIndex;
break;
case QDeclarativeInstruction::StoreVector3D:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VECTOR3D\t\t" << instr->storeVector3D.propertyIndex << "\t" << instr->storeVector3D.valueIndex;
+ qWarning().nospace() << idx << "\t\t" << "STORE_VECTOR3D\t\t" << instr->storeVector3D.propertyIndex << "\t" << instr->storeVector3D.valueIndex;
break;
case QDeclarativeInstruction::StoreVariant:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value);
+ qWarning().nospace() << idx << "\t\t" << "STORE_VARIANT\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value);
break;
case QDeclarativeInstruction::StoreVariantInteger:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_INTEGER\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value;
+ qWarning().nospace() << idx << "\t\t" << "STORE_VARIANT_INTEGER\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value;
break;
case QDeclarativeInstruction::StoreVariantDouble:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_DOUBLE\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value;
+ qWarning().nospace() << idx << "\t\t" << "STORE_VARIANT_DOUBLE\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value;
break;
case QDeclarativeInstruction::StoreVariantBool:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_BOOL\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value;
+ qWarning().nospace() << idx << "\t\t" << "STORE_VARIANT_BOOL\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value;
break;
case QDeclarativeInstruction::StoreObject:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_OBJECT\t\t" << instr->storeObject.propertyIndex;
+ qWarning().nospace() << idx << "\t\t" << "STORE_OBJECT\t\t" << instr->storeObject.propertyIndex;
break;
case QDeclarativeInstruction::StoreVariantObject:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_OBJECT\t" << instr->storeObject.propertyIndex;
+ qWarning().nospace() << idx << "\t\t" << "STORE_VARIANT_OBJECT\t" << instr->storeObject.propertyIndex;
break;
case QDeclarativeInstruction::StoreInterface:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_INTERFACE\t\t" << instr->storeObject.propertyIndex;
+ qWarning().nospace() << idx << "\t\t" << "STORE_INTERFACE\t\t" << instr->storeObject.propertyIndex;
break;
-
case QDeclarativeInstruction::StoreSignal:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SIGNAL\t\t" << instr->storeSignal.signalIndex << "\t" << instr->storeSignal.value << "\t\t" << primitives.at(instr->storeSignal.value);
+ qWarning().nospace() << idx << "\t\t" << "STORE_SIGNAL\t\t" << instr->storeSignal.signalIndex << "\t" << instr->storeSignal.value << "\t\t" << primitives.at(instr->storeSignal.value);
break;
case QDeclarativeInstruction::StoreImportedScript:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_IMPORTED_SCRIPT\t" << instr->storeScript.value;
+ qWarning().nospace() << idx << "\t\t" << "STORE_IMPORTED_SCRIPT\t" << instr->storeScript.value;
break;
case QDeclarativeInstruction::StoreScriptString:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SCRIPT_STRING\t" << instr->storeScriptString.propertyIndex << "\t" << instr->storeScriptString.value << "\t" << instr->storeScriptString.scope;
+ qWarning().nospace() << idx << "\t\t" << "STORE_SCRIPT_STRING\t" << instr->storeScriptString.propertyIndex << "\t" << instr->storeScriptString.value << "\t" << instr->storeScriptString.scope;
break;
-
case QDeclarativeInstruction::AssignSignalObject:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "ASSIGN_SIGNAL_OBJECT\t" << instr->assignSignalObject.signal << "\t\t\t" << datas.at(instr->assignSignalObject.signal);
+ qWarning().nospace() << idx << "\t\t" << "ASSIGN_SIGNAL_OBJECT\t" << instr->assignSignalObject.signal << "\t\t\t" << datas.at(instr->assignSignalObject.signal);
break;
case QDeclarativeInstruction::AssignCustomType:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "ASSIGN_CUSTOMTYPE\t" << instr->assignCustomType.propertyIndex << "\t" << instr->assignCustomType.valueIndex;
+ qWarning().nospace() << idx << "\t\t" << "ASSIGN_CUSTOMTYPE\t" << instr->assignCustomType.propertyIndex << "\t" << instr->assignCustomType.valueIndex;
break;
-
case QDeclarativeInstruction::StoreBinding:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_BINDING\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
+ qWarning().nospace() << idx << "\t\t" << "STORE_BINDING\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
break;
case QDeclarativeInstruction::StoreBindingOnAlias:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_BINDING_ALIAS\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
+ qWarning().nospace() << idx << "\t\t" << "STORE_BINDING_ALIAS\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
break;
case QDeclarativeInstruction::StoreCompiledBinding:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_COMPILED_BINDING\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
+ qWarning().nospace() << idx << "\t\t" << "STORE_COMPILED_BINDING\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
break;
case QDeclarativeInstruction::StoreValueSource:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VALUE_SOURCE\t" << instr->assignValueSource.property << "\t" << instr->assignValueSource.castValue;
+ qWarning().nospace() << idx << "\t\t" << "STORE_VALUE_SOURCE\t" << instr->assignValueSource.property << "\t" << instr->assignValueSource.castValue;
break;
case QDeclarativeInstruction::StoreValueInterceptor:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VALUE_INTERCEPTOR\t" << instr->assignValueInterceptor.property << "\t" << instr->assignValueInterceptor.castValue;
+ qWarning().nospace() << idx << "\t\t" << "STORE_VALUE_INTERCEPTOR\t" << instr->assignValueInterceptor.property << "\t" << instr->assignValueInterceptor.castValue;
break;
-
case QDeclarativeInstruction::BeginObject:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "BEGIN\t\t\t" << instr->begin.castValue;
+ qWarning().nospace() << idx << "\t\t" << "BEGIN\t\t\t" << instr->begin.castValue;
break;
case QDeclarativeInstruction::StoreObjectQList:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_OBJECT_QLIST";
+ qWarning().nospace() << idx << "\t\t" << "STORE_OBJECT_QLIST";
break;
case QDeclarativeInstruction::AssignObjectList:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "ASSIGN_OBJECT_LIST";
+ qWarning().nospace() << idx << "\t\t" << "ASSIGN_OBJECT_LIST";
break;
case QDeclarativeInstruction::FetchAttached:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH_ATTACHED\t\t" << instr->fetchAttached.id;
+ qWarning().nospace() << idx << "\t\t" << "FETCH_ATTACHED\t\t" << instr->fetchAttached.id;
break;
case QDeclarativeInstruction::FetchQList:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH_QLIST\t\t" << instr->fetch.property;
+ qWarning().nospace() << idx << "\t\t" << "FETCH_QLIST\t\t" << instr->fetch.property;
break;
case QDeclarativeInstruction::FetchObject:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH\t\t\t" << instr->fetch.property;
+ qWarning().nospace() << idx << "\t\t" << "FETCH\t\t\t" << instr->fetch.property;
break;
case QDeclarativeInstruction::FetchValueType:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH_VALUE\t\t" << instr->fetchValue.property << "\t" << instr->fetchValue.type << "\t" << instr->fetchValue.bindingSkipList;
+ qWarning().nospace() << idx << "\t\t" << "FETCH_VALUE\t\t" << instr->fetchValue.property << "\t" << instr->fetchValue.type << "\t" << instr->fetchValue.bindingSkipList;
break;
case QDeclarativeInstruction::PopFetchedObject:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "POP";
+ qWarning().nospace() << idx << "\t\t" << "POP";
break;
case QDeclarativeInstruction::PopQList:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "POP_QLIST";
+ qWarning().nospace() << idx << "\t\t" << "POP_QLIST";
break;
case QDeclarativeInstruction::PopValueType:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "POP_VALUE\t\t" << instr->fetchValue.property << "\t" << instr->fetchValue.type;
+ qWarning().nospace() << idx << "\t\t" << "POP_VALUE\t\t" << instr->fetchValue.property << "\t" << instr->fetchValue.type;
break;
case QDeclarativeInstruction::Defer:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "DEFER" << "\t\t\t" << instr->defer.deferCount;
+ qWarning().nospace() << idx << "\t\t" << "DEFER" << "\t\t\t" << instr->defer.deferCount;
break;
default:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "XXX UNKNOWN INSTRUCTION" << "\t" << instr->type;
+ qWarning().nospace() << idx << "\t\t" << "XXX UNKNOWN INSTRUCTION" << "\t" << instr->type;
break;
}
#endif // QT_NO_DEBUG_STREAM
BeginObject, /* begin */
StoreObjectQList, /* NA */
- AssignObjectList, /* NA */
+ AssignObjectList, /* assignObjectList */
FetchAttached, /* fetchAttached */
FetchQList, /* fetch */
//
Defer /* defer */
};
- QDeclarativeInstruction()
- : line(0) {}
+ QDeclarativeInstruction() {}
Type type;
- unsigned short line;
struct InitInstruction {
int bindingsSize;
int data;
int bindingBits;
ushort column;
+ ushort line;
};
struct CreateSimpleInstruction {
void (*create)(void *);
int typeSize;
int type;
ushort column;
+ ushort line;
};
struct StoreMetaInstruction {
int data;
int value;
short context;
short owner;
+ ushort line;
};
struct FetchInstruction {
int property;
+ ushort line;
};
struct FetchValueInstruction {
int property;
};
struct StoreObjectInstruction {
int propertyIndex;
+ ushort line;
};
struct AssignCustomTypeInstruction {
int propertyIndex;
int valueIndex;
+ ushort line;
};
struct StoreSignalInstruction {
int signalIndex;
int value;
short context;
int name;
+ ushort line;
};
struct AssignSignalObjectInstruction {
int signal;
+ ushort line;
};
struct CreateComponentInstruction {
int count;
- ushort column;
int endLine;
int metaObject;
+ ushort column;
+ ushort line;
};
struct FetchAttachedInstruction {
int id;
+ ushort line;
};
struct DeferInstruction {
int deferCount;
};
+ struct AssignObjectListInstruction {
+ ushort line;
+ };
union {
InitInstruction init;
CreateComponentInstruction createComponent;
FetchAttachedInstruction fetchAttached;
DeferInstruction defer;
+ AssignObjectListInstruction assignObjectList;
};
void dump(QDeclarativeCompiledData *);
{
}
-#define VME_EXCEPTION(desc) \
+#define VME_EXCEPTION(desc, line) \
{ \
QDeclarativeError error; \
error.setDescription(desc.trimmed()); \
- error.setLine(instr.line); \
+ error.setLine(line); \
error.setUrl(comp->url); \
vmeErrors << error; \
break; \
types.at(instr.create.type).createInstance(ctxt, bindings, &vmeErrors);
if (!o) {
- VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Unable to create object of type %1").arg(QString::fromLatin1(types.at(instr.create.type).className)));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Unable to create object of type %1").arg(QString::fromLatin1(types.at(instr.create.type).className)), instr.create.line);
}
QDeclarativeData *ddata = QDeclarativeData::get(o);
ddata->setImplicitDestructible();
ddata->outerContext = ctxt;
- ddata->lineNumber = instr.line;
+ ddata->lineNumber = instr.create.line;
ddata->columnNumber = instr.create.column;
if (instr.create.data != -1) {
ddata->propertyCache = ref.typePropertyCache;
ddata->propertyCache->addref();
}
- ddata->lineNumber = instr.line;
+ ddata->lineNumber = instr.createSimple.line;
ddata->columnNumber = instr.createSimple.column;
QObjectPrivate::get(o)->declarativeData = ddata;
ddata->setImplicitDestructible();
ddata->outerContext = ctxt;
- ddata->lineNumber = instr.line;
- ddata->columnNumber = instr.create.column;
+ ddata->lineNumber = instr.createComponent.line;
+ ddata->columnNumber = instr.createComponent.column;
QDeclarativeComponentPrivate::get(qcomp)->creationContext = ctxt;
QMetaProperty prop =
target->metaObject()->property(instr.assignCustomType.propertyIndex);
if (v.isNull() || ((int)prop.type() != data.type && prop.userType() != data.type))
- VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign value %1 to property %2").arg(primitive).arg(QString::fromUtf8(prop.name())));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign value %1 to property %2").arg(primitive).arg(QString::fromUtf8(prop.name())), instr.assignCustomType.line);
void *a[] = { (void *)v.data(), 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
QMetaMethod method = QDeclarativeMetaType::defaultMethod(assign);
if (method.signature() == 0)
- VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign object type %1 with no default method").arg(QString::fromLatin1(assign->metaObject()->className())));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign object type %1 with no default method").arg(QString::fromLatin1(assign->metaObject()->className())), instr.assignSignalObject.line);
if (!QMetaObject::checkConnectArgs(prop.method().signature(), method.signature()))
- VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot connect mismatched signal/slot %1 %vs. %2").arg(QString::fromLatin1(method.signature())).arg(QString::fromLatin1(prop.method().signature())));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot connect mismatched signal/slot %1 %vs. %2").arg(QString::fromLatin1(method.signature())).arg(QString::fromLatin1(prop.method().signature())), instr.assignSignalObject.line);
QDeclarativePropertyPrivate::connect(target, prop.index(), assign, method.methodIndex());
} else {
- VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign an object to signal property %1").arg(QString::fromUtf8(pr)));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign an object to signal property %1").arg(QString::fromUtf8(pr)), instr.assignSignalObject.line);
}
QDeclarativeBoundSignal *bs = new QDeclarativeBoundSignal(target, signal, target);
QDeclarativeExpression *expr =
new QDeclarativeExpression(ctxt, context, primitives.at(instr.storeSignal.value));
- expr->setSourceLocation(comp->name, instr.line);
+ expr->setSourceLocation(comp->name, instr.storeSignal.line);
static_cast<QDeclarativeExpressionPrivate *>(QObjectPrivate::get(expr))->name = datas.at(instr.storeSignal.name);
bs->setExpression(expr);
}
if ((stack.count() - instr.assignBinding.owner) == 1 && bindingSkipList.testBit(coreIndex))
break;
- QDeclarativeBinding *bind = new QDeclarativeBinding((void *)datas.at(instr.assignBinding.value).constData(), comp, context, ctxt, comp->name, instr.line, 0);
+ QDeclarativeBinding *bind = new QDeclarativeBinding((void *)datas.at(instr.assignBinding.value).constData(), comp, context, ctxt, comp->name, instr.assignBinding.line, 0);
bindValues.append(bind);
bind->m_mePtr = &bindValues.values[bindValues.count - 1];
bind->setTarget(mp);
if (iid)
ptr = assign->qt_metacast(iid);
if (!ptr)
- VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign object to list"));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign object to list"), instr.assignObjectList.line);
list.qListProperty.append((QDeclarativeListProperty<void>*)&list.qListProperty, ptr);
}
if (!ok)
- VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign object to interface property"));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign object to interface property"), instr.storeObject.line);
}
break;
QObject *qmlObject = qmlAttachedPropertiesObjectById(instr.fetchAttached.id, target);
if (!qmlObject)
- VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Unable to create attached object"));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Unable to create attached object"), instr.fetchAttached.line);
stack.push(qmlObject);
}
instr.fetch.property, a);
if (!obj)
- VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot set properties on %1 as it is null").arg(QString::fromUtf8(target->metaObject()->property(instr.fetch.property).name())));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot set properties on %1 as it is null").arg(QString::fromUtf8(target->metaObject()->property(instr.fetch.property).name())), instr.fetch.line);
stack.push(obj);
}
QDeclarativeCompiledData *data = new QDeclarativeCompiledData(0);
{
QDeclarativeInstruction i;
- i.line = 0;
i.type = QDeclarativeInstruction::Init;
i.init.bindingsSize = 0;
i.init.parserStatusSize = 3;
data->types << ref;
QDeclarativeInstruction i;
- i.line = 1;
i.type = QDeclarativeInstruction::CreateObject;
i.create.type = 0;
i.create.data = -1;
data->primitives << "testId";
QDeclarativeInstruction i;
- i.line = 2;
i.type = QDeclarativeInstruction::SetId;
i.setId.value = data->primitives.count() - 1;
i.setId.index = 0;
{
QDeclarativeInstruction i;
- i.line = 3;
i.type = QDeclarativeInstruction::SetDefault;
data->bytecode << i;
}
{
QDeclarativeInstruction i;
- i.line = 4;
i.type = QDeclarativeInstruction::CreateComponent;
i.createComponent.count = 3;
i.createComponent.column = 4;
{
QDeclarativeInstruction i;
- i.line = 5;
i.type = QDeclarativeInstruction::StoreMetaObject;
i.storeMeta.data = 3;
i.storeMeta.aliasData = 6;
{
QDeclarativeInstruction i;
- i.line = 6;
i.type = QDeclarativeInstruction::StoreFloat;
i.storeFloat.propertyIndex = 3;
i.storeFloat.value = 11.3;
{
QDeclarativeInstruction i;
- i.line = 7;
i.type = QDeclarativeInstruction::StoreDouble;
i.storeDouble.propertyIndex = 4;
i.storeDouble.value = 14.8;
{
QDeclarativeInstruction i;
- i.line = 8;
i.type = QDeclarativeInstruction::StoreInteger;
i.storeInteger.propertyIndex = 5;
i.storeInteger.value = 9;
{
QDeclarativeInstruction i;
- i.line = 9;
i.type = QDeclarativeInstruction::StoreBool;
i.storeBool.propertyIndex = 6;
i.storeBool.value = true;
{
data->primitives << "Test String";
QDeclarativeInstruction i;
- i.line = 10;
i.type = QDeclarativeInstruction::StoreString;
i.storeString.propertyIndex = 7;
i.storeString.value = data->primitives.count() - 1;
{
data->urls << QUrl("http://www.nokia.com");
QDeclarativeInstruction i;
- i.line = 11;
i.type = QDeclarativeInstruction::StoreUrl;
i.storeUrl.propertyIndex = 8;
i.storeUrl.value = data->urls.count() - 1;
{
QDeclarativeInstruction i;
- i.line = 12;
i.type = QDeclarativeInstruction::StoreColor;
i.storeColor.propertyIndex = 9;
i.storeColor.value = 0xFF00FF00;
{
QDeclarativeInstruction i;
- i.line = 13;
i.type = QDeclarativeInstruction::StoreDate;
i.storeDate.propertyIndex = 10;
i.storeDate.value = 9;
{
QDeclarativeInstruction i;
- i.line = 14;
i.type = QDeclarativeInstruction::StoreTime;
i.storeTime.propertyIndex = 11;
i.storeTime.valueIndex = 33;
{
QDeclarativeInstruction i;
- i.line = 15;
i.type = QDeclarativeInstruction::StoreDateTime;
i.storeDateTime.propertyIndex = 12;
i.storeDateTime.valueIndex = 44;
{
QDeclarativeInstruction i;
- i.line = 16;
i.type = QDeclarativeInstruction::StorePoint;
i.storeRealPair.propertyIndex = 13;
i.storeRealPair.valueIndex = 3;
{
QDeclarativeInstruction i;
- i.line = 17;
i.type = QDeclarativeInstruction::StorePointF;
i.storeRealPair.propertyIndex = 14;
i.storeRealPair.valueIndex = 9;
{
QDeclarativeInstruction i;
- i.line = 18;
i.type = QDeclarativeInstruction::StoreSize;
i.storeRealPair.propertyIndex = 15;
i.storeRealPair.valueIndex = 8;
{
QDeclarativeInstruction i;
- i.line = 19;
i.type = QDeclarativeInstruction::StoreSizeF;
i.storeRealPair.propertyIndex = 16;
i.storeRealPair.valueIndex = 99;
{
QDeclarativeInstruction i;
- i.line = 20;
i.type = QDeclarativeInstruction::StoreRect;
i.storeRect.propertyIndex = 17;
i.storeRect.valueIndex = 2;
{
QDeclarativeInstruction i;
- i.line = 21;
i.type = QDeclarativeInstruction::StoreRectF;
i.storeRect.propertyIndex = 18;
i.storeRect.valueIndex = 19;
{
QDeclarativeInstruction i;
- i.line = 22;
i.type = QDeclarativeInstruction::StoreVector3D;
i.storeVector3D.propertyIndex = 19;
i.storeVector3D.valueIndex = 9;
{
data->primitives << "color(1, 1, 1, 1)";
QDeclarativeInstruction i;
- i.line = 23;
i.type = QDeclarativeInstruction::StoreVariant;
i.storeString.propertyIndex = 20;
i.storeString.value = data->primitives.count() - 1;
{
QDeclarativeInstruction i;
- i.line = 24;
i.type = QDeclarativeInstruction::StoreObject;
i.storeObject.propertyIndex = 21;
data->bytecode << i;
{
QDeclarativeInstruction i;
- i.line = 25;
i.type = QDeclarativeInstruction::StoreVariantObject;
i.storeObject.propertyIndex = 22;
data->bytecode << i;
{
QDeclarativeInstruction i;
- i.line = 26;
i.type = QDeclarativeInstruction::StoreInterface;
i.storeObject.propertyIndex = 23;
data->bytecode << i;
data->primitives << "console.log(1921)";
QDeclarativeInstruction i;
- i.line = 27;
i.type = QDeclarativeInstruction::StoreSignal;
i.storeSignal.signalIndex = 2;
i.storeSignal.value = data->primitives.count() - 1;
{
QDeclarativeInstruction i;
- i.line = 29;
i.type = QDeclarativeInstruction::StoreScriptString;
i.storeScriptString.propertyIndex = 24;
i.storeScriptString.value = 3;
data->datas << "mySignal";
QDeclarativeInstruction i;
- i.line = 30;
i.type = QDeclarativeInstruction::AssignSignalObject;
i.assignSignalObject.signal = 0;
data->bytecode << i;
{
QDeclarativeInstruction i;
- i.line = 31;
i.type = QDeclarativeInstruction::AssignCustomType;
i.assignCustomType.propertyIndex = 25;
i.assignCustomType.valueIndex = 4;
{
QDeclarativeInstruction i;
- i.line = 32;
i.type = QDeclarativeInstruction::StoreBinding;
i.assignBinding.property = 26;
i.assignBinding.value = 3;
{
QDeclarativeInstruction i;
- i.line = 33;
i.type = QDeclarativeInstruction::StoreCompiledBinding;
i.assignBinding.property = 27;
i.assignBinding.value = 2;
{
QDeclarativeInstruction i;
- i.line = 34;
i.type = QDeclarativeInstruction::StoreValueSource;
i.assignValueSource.property = 29;
i.assignValueSource.owner = 1;
{
QDeclarativeInstruction i;
- i.line = 35;
i.type = QDeclarativeInstruction::StoreValueInterceptor;
i.assignValueInterceptor.property = 30;
i.assignValueInterceptor.owner = 2;
{
QDeclarativeInstruction i;
- i.line = 36;
i.type = QDeclarativeInstruction::BeginObject;
i.begin.castValue = 4;
data->bytecode << i;
{
QDeclarativeInstruction i;
- i.line = 38;
i.type = QDeclarativeInstruction::StoreObjectQList;
data->bytecode << i;
}
{
QDeclarativeInstruction i;
- i.line = 39;
i.type = QDeclarativeInstruction::AssignObjectList;
data->bytecode << i;
}
{
QDeclarativeInstruction i;
- i.line = 40;
i.type = QDeclarativeInstruction::FetchAttached;
i.fetchAttached.id = 23;
data->bytecode << i;
{
QDeclarativeInstruction i;
- i.line = 42;
i.type = QDeclarativeInstruction::FetchQList;
i.fetch.property = 32;
data->bytecode << i;
{
QDeclarativeInstruction i;
- i.line = 43;
i.type = QDeclarativeInstruction::FetchObject;
i.fetch.property = 33;
data->bytecode << i;
{
QDeclarativeInstruction i;
- i.line = 44;
i.type = QDeclarativeInstruction::FetchValueType;
i.fetchValue.property = 34;
i.fetchValue.type = 6;
{
QDeclarativeInstruction i;
- i.line = 45;
i.type = QDeclarativeInstruction::PopFetchedObject;
data->bytecode << i;
}
{
QDeclarativeInstruction i;
- i.line = 46;
i.type = QDeclarativeInstruction::PopQList;
data->bytecode << i;
}
{
QDeclarativeInstruction i;
- i.line = 47;
i.type = QDeclarativeInstruction::PopValueType;
i.fetchValue.property = 35;
i.fetchValue.type = 8;
{
QDeclarativeInstruction i;
- i.line = 48;
i.type = QDeclarativeInstruction::Defer;
i.defer.deferCount = 7;
data->bytecode << i;
{
QDeclarativeInstruction i;
- i.line = -1;
i.type = QDeclarativeInstruction::Defer;
i.defer.deferCount = 7;
data->bytecode << i;
{
QDeclarativeInstruction i;
- i.line = 48;
i.type = QDeclarativeInstruction::StoreImportedScript;
i.storeScript.value = 2;
data->bytecode << i;
{
QDeclarativeInstruction i;
- i.line = 50;
i.type = (QDeclarativeInstruction::Type)(1234); // Non-existent
data->bytecode << i;
}
{
QDeclarativeInstruction i;
- i.line = 51;
i.type = QDeclarativeInstruction::StoreVariantInteger;
i.storeInteger.value = 11;
i.storeInteger.propertyIndex = 32;
{
QDeclarativeInstruction i;
- i.line = 52;
i.type = QDeclarativeInstruction::StoreVariantDouble;
i.storeDouble.value = 33.7;
i.storeDouble.propertyIndex = 19;
QStringList expect;
expect
- << "Index\tLine\tOperation\t\tData1\tData2\tData3\tComments"
+ << "Index\tOperation\t\tData1\tData2\tData3\tComments"
<< "-------------------------------------------------------------------------------"
- << "0\t\t0\tINIT\t\t\t0\t3\t-1\t-1"
- << "1\t\t1\tCREATE\t\t\t0\t-1\t\t\"Test\""
- << "2\t\t2\tSETID\t\t\t0\t\t\t\"testId\""
- << "3\t\t3\tSET_DEFAULT"
- << "4\t\t4\tCREATE_COMPONENT\t3"
- << "5\t\t5\tSTORE_META\t\t3"
- << "6\t\t6\tSTORE_FLOAT\t\t3\t11.3"
- << "7\t\t7\tSTORE_DOUBLE\t\t4\t14.8"
- << "8\t\t8\tSTORE_INTEGER\t\t5\t9"
- << "9\t\t9\tSTORE_BOOL\t\t6\ttrue"
- << "10\t\t10\tSTORE_STRING\t\t7\t1\t\t\"Test String\""
- << "11\t\t11\tSTORE_URL\t\t8\t0\t\tQUrl(\"http://www.nokia.com\") "
- << "12\t\t12\tSTORE_COLOR\t\t9\t\t\t\"ff00ff00\""
- << "13\t\t13\tSTORE_DATE\t\t10\t9"
- << "14\t\t14\tSTORE_TIME\t\t11\t33"
- << "15\t\t15\tSTORE_DATETIME\t\t12\t44"
- << "16\t\t16\tSTORE_POINT\t\t13\t3"
- << "17\t\t17\tSTORE_POINTF\t\t14\t9"
- << "18\t\t18\tSTORE_SIZE\t\t15\t8"
- << "19\t\t19\tSTORE_SIZEF\t\t16\t99"
- << "20\t\t20\tSTORE_RECT\t\t17\t2"
- << "21\t\t21\tSTORE_RECTF\t\t18\t19"
- << "22\t\t22\tSTORE_VECTOR3D\t\t19\t9"
- << "23\t\t23\tSTORE_VARIANT\t\t20\t2\t\t\"color(1, 1, 1, 1)\""
- << "24\t\t24\tSTORE_OBJECT\t\t21"
- << "25\t\t25\tSTORE_VARIANT_OBJECT\t22"
- << "26\t\t26\tSTORE_INTERFACE\t\t23"
- << "27\t\t27\tSTORE_SIGNAL\t\t2\t3\t\t\"console.log(1921)\""
- << "28\t\t29\tSTORE_SCRIPT_STRING\t24\t3\t1"
- << "29\t\t30\tASSIGN_SIGNAL_OBJECT\t0\t\t\t\"mySignal\""
- << "30\t\t31\tASSIGN_CUSTOMTYPE\t25\t4"
- << "31\t\t32\tSTORE_BINDING\t26\t3\t2"
- << "32\t\t33\tSTORE_COMPILED_BINDING\t27\t2\t4"
- << "33\t\t34\tSTORE_VALUE_SOURCE\t29\t4"
- << "34\t\t35\tSTORE_VALUE_INTERCEPTOR\t30\t-4"
- << "35\t\t36\tBEGIN\t\t\t4"
- << "36\t\t38\tSTORE_OBJECT_QLIST"
- << "37\t\t39\tASSIGN_OBJECT_LIST"
- << "38\t\t40\tFETCH_ATTACHED\t\t23"
- << "39\t\t42\tFETCH_QLIST\t\t32"
- << "40\t\t43\tFETCH\t\t\t33"
- << "41\t\t44\tFETCH_VALUE\t\t34\t6\t7"
- << "42\t\t45\tPOP"
- << "43\t\t46\tPOP_QLIST"
- << "44\t\t47\tPOP_VALUE\t\t35\t8"
- << "45\t\t48\tDEFER\t\t\t7"
- << "46\t\tNA\tDEFER\t\t\t7"
- << "47\t\t48\tSTORE_IMPORTED_SCRIPT\t2"
- << "48\t\t50\tXXX UNKNOWN INSTRUCTION\t1234"
- << "49\t\t51\tSTORE_VARIANT_INTEGER\t\t32\t11"
- << "50\t\t52\tSTORE_VARIANT_DOUBLE\t\t19\t33.7"
+ << "0\t\tINIT\t\t\t0\t3\t-1\t-1"
+ << "1\t\tCREATE\t\t\t0\t-1\t\t\"Test\""
+ << "2\t\tSETID\t\t\t0\t\t\t\"testId\""
+ << "3\t\tSET_DEFAULT"
+ << "4\t\tCREATE_COMPONENT\t3"
+ << "5\t\tSTORE_META\t\t3"
+ << "6\t\tSTORE_FLOAT\t\t3\t11.3"
+ << "7\t\tSTORE_DOUBLE\t\t4\t14.8"
+ << "8\t\tSTORE_INTEGER\t\t5\t9"
+ << "9\t\tSTORE_BOOL\t\t6\ttrue"
+ << "10\t\tSTORE_STRING\t\t7\t1\t\t\"Test String\""
+ << "11\t\tSTORE_URL\t\t8\t0\t\tQUrl(\"http://www.nokia.com\") "
+ << "12\t\tSTORE_COLOR\t\t9\t\t\t\"ff00ff00\""
+ << "13\t\tSTORE_DATE\t\t10\t9"
+ << "14\t\tSTORE_TIME\t\t11\t33"
+ << "15\t\tSTORE_DATETIME\t\t12\t44"
+ << "16\t\tSTORE_POINT\t\t13\t3"
+ << "17\t\tSTORE_POINTF\t\t14\t9"
+ << "18\t\tSTORE_SIZE\t\t15\t8"
+ << "19\t\tSTORE_SIZEF\t\t16\t99"
+ << "20\t\tSTORE_RECT\t\t17\t2"
+ << "21\t\tSTORE_RECTF\t\t18\t19"
+ << "22\t\tSTORE_VECTOR3D\t\t19\t9"
+ << "23\t\tSTORE_VARIANT\t\t20\t2\t\t\"color(1, 1, 1, 1)\""
+ << "24\t\tSTORE_OBJECT\t\t21"
+ << "25\t\tSTORE_VARIANT_OBJECT\t22"
+ << "26\t\tSTORE_INTERFACE\t\t23"
+ << "27\t\tSTORE_SIGNAL\t\t2\t3\t\t\"console.log(1921)\""
+ << "28\t\tSTORE_SCRIPT_STRING\t24\t3\t1"
+ << "29\t\tASSIGN_SIGNAL_OBJECT\t0\t\t\t\"mySignal\""
+ << "30\t\tASSIGN_CUSTOMTYPE\t25\t4"
+ << "31\t\tSTORE_BINDING\t26\t3\t2"
+ << "32\t\tSTORE_COMPILED_BINDING\t27\t2\t4"
+ << "33\t\tSTORE_VALUE_SOURCE\t29\t4"
+ << "34\t\tSTORE_VALUE_INTERCEPTOR\t30\t-4"
+ << "35\t\tBEGIN\t\t\t4"
+ << "36\t\tSTORE_OBJECT_QLIST"
+ << "37\t\tASSIGN_OBJECT_LIST"
+ << "38\t\tFETCH_ATTACHED\t\t23"
+ << "39\t\tFETCH_QLIST\t\t32"
+ << "40\t\tFETCH\t\t\t33"
+ << "41\t\tFETCH_VALUE\t\t34\t6\t7"
+ << "42\t\tPOP"
+ << "43\t\tPOP_QLIST"
+ << "44\t\tPOP_VALUE\t\t35\t8"
+ << "45\t\tDEFER\t\t\t7"
+ << "46\t\tDEFER\t\t\t7"
+ << "47\t\tSTORE_IMPORTED_SCRIPT\t2"
+ << "48\t\tXXX UNKNOWN INSTRUCTION\t1234"
+ << "49\t\tSTORE_VARIANT_INTEGER\t\t32\t11"
+ << "50\t\tSTORE_VARIANT_DOUBLE\t\t19\t33.7"
<< "-------------------------------------------------------------------------------";
messages = QStringList();