aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compileddata.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-08-16 13:21:31 +0200
committerLars Knoll <lars.knoll@digia.com>2013-08-16 16:52:18 +0200
commit944717a46c237e5a5b2d6e5ea2fd8389523638e4 (patch)
tree6e894837d1cd327bb578b00d7826e3de0cde816c /src/qml/compiler/qv4compileddata.cpp
parent85e6b8e9e7e158b5cb4238c2dd5e28406bc913e2 (diff)
Ported the compile-time class setup for object literals to be run-time based
Change-Id: I21225e4bf0f66914229cf64fa29ce870548c0e93 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4compileddata.cpp')
-rw-r--r--src/qml/compiler/qv4compileddata.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index 6ac7a4843d..4b7f132d97 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -57,6 +57,7 @@ CompilationUnit::~CompilationUnit()
free(runtimeStrings);
delete [] runtimeLookups;
delete [] runtimeRegularExpressions;
+ free(runtimeClasses);
}
QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine)
@@ -105,6 +106,20 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine)
}
}
+ if (data->jsClassTableSize) {
+ runtimeClasses = (QV4::InternalClass**)malloc(data->jsClassTableSize * sizeof(QV4::InternalClass*));
+
+ for (int i = 0; i < data->jsClassTableSize; ++i) {
+ int memberCount = 0;
+ const CompiledData::JSClassMember *member = data->jsClassAt(i, &memberCount);
+ QV4::InternalClass *klass = engine->emptyClass;
+ for (int j = 0; j < memberCount; ++j, ++member)
+ klass = klass->addMember(runtimeStrings[member->nameOffset], member->isAccessor ? QV4::Attr_Accessor : QV4::Attr_Data);
+
+ runtimeClasses[i] = klass;
+ }
+ }
+
return linkBackendToEngine(engine);
}