aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4isel_moth.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-02-15 04:39:33 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-24 20:41:48 +0100
commit90a7249e70b37f97907a28ccc6016064231eb861 (patch)
tree96cb93cc7c4357c7c526063948a49a52e4654df9 /src/qml/compiler/qv4isel_moth.cpp
parentc78d1052c2509646c8cf13b460a8d098de836ad0 (diff)
Determine whether or not an object literal requires a sparse array at compile time
Change-Id: Ieb7f6ee97a4f251f1e2369850ebb9e2931f84ac1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4isel_moth.cpp')
-rw-r--r--src/qml/compiler/qv4isel_moth.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp
index 8045b811ea..0dac3dbdf2 100644
--- a/src/qml/compiler/qv4isel_moth.cpp
+++ b/src/qml/compiler/qv4isel_moth.cpp
@@ -1260,7 +1260,7 @@ void InstructionSelection::callBuiltinDefineArray(IR::Temp *result, IR::ExprList
addInstruction(call);
}
-void InstructionSelection::callBuiltinDefineObjectLiteral(IR::Temp *result, int keyValuePairCount, IR::ExprList *keyValuePairs, IR::ExprList *arrayEntries)
+void InstructionSelection::callBuiltinDefineObjectLiteral(IR::Temp *result, int keyValuePairCount, IR::ExprList *keyValuePairs, IR::ExprList *arrayEntries, bool needSparseArray)
{
int argLocation = outgoingArgumentTempStart();
@@ -1300,7 +1300,7 @@ void InstructionSelection::callBuiltinDefineObjectLiteral(IR::Temp *result, int
}
// Process array values
- int arrayValueCount = 0;
+ uint arrayValueCount = 0;
it = arrayEntries;
while (it) {
IR::Const *index = it->expr->asConst();
@@ -1332,7 +1332,7 @@ void InstructionSelection::callBuiltinDefineObjectLiteral(IR::Temp *result, int
}
// Process array getter/setter pairs
- int arrayGetterSetterCount = 0;
+ uint arrayGetterSetterCount = 0;
it = arrayEntries;
while (it) {
IR::Const *index = it->expr->asConst();
@@ -1374,7 +1374,7 @@ void InstructionSelection::callBuiltinDefineObjectLiteral(IR::Temp *result, int
Instruction::CallBuiltinDefineObjectLiteral call;
call.internalClassId = classId;
call.arrayValueCount = arrayValueCount;
- call.arrayGetterSetterCount = arrayGetterSetterCount;
+ call.arrayGetterSetterCountAndFlags = arrayGetterSetterCount | (needSparseArray << 30);
call.args = outgoingArgumentTempStart();
call.result = getResultParam(result);
addInstruction(call);