diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-11-02 18:48:18 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-25 22:04:42 +0100 |
commit | a41764cafbc85c271edde8d09eae46798ccdcb8d (patch) | |
tree | cb027ea57c6f764bdc277bf899caa3f8a866647b /src/qml/jsruntime | |
parent | 62c906059516bb829f05073096fd3e12f5103fba (diff) |
IR Cleanup, resolve ID objects through array subscripts
...instead of a special MEMBER type. This allows removing the
type member from V4IR::Member altogether (and thus unshadow from
V4IR::Expr::type). By not requiring the base of a id lookup
member expression to be a NAME, we can also speed up repeated
id lookups by fetching the id object array wrapper only once
per function.
Change-Id: I3e9b8f498d32ace4a0cc2254f49e02ecc124f79c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 5 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4runtime_p.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 6 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 4c0573ceaf..fbd4496875 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -1242,10 +1242,9 @@ ReturnedValue __qmljs_lookup_runtime_regexp(ExecutionContext *ctx, int id) return ctx->compilationUnit->runtimeRegularExpressions[id].asReturnedValue(); } -ReturnedValue __qmljs_get_id_object(NoThrowContext *ctx, int id) +ReturnedValue __qmljs_get_id_array(NoThrowContext *ctx) { - QQmlContextData *context = QmlContextWrapper::callingContext(ctx->engine); - return QObjectWrapper::wrap(ctx->engine, context->idValues[id].data()); + return ctx->engine->qmlContextObject()->getPointer()->as<QmlContextWrapper>()->idObjectsArray(); } ReturnedValue __qmljs_get_context_object(NoThrowContext *ctx) diff --git a/src/qml/jsruntime/qv4runtime_p.h b/src/qml/jsruntime/qv4runtime_p.h index 194523727f..935ccd2012 100644 --- a/src/qml/jsruntime/qv4runtime_p.h +++ b/src/qml/jsruntime/qv4runtime_p.h @@ -171,7 +171,7 @@ QV4::ReturnedValue __qmljs_construct_global_lookup(QV4::ExecutionContext *contex QV4::ReturnedValue __qmljs_get_element(QV4::ExecutionContext *ctx, const QV4::ValueRef object, const QV4::ValueRef index); void __qmljs_set_element(QV4::ExecutionContext *ctx, const QV4::ValueRef object, const QV4::ValueRef index, const QV4::ValueRef value); -QV4::ReturnedValue __qmljs_get_id_object(NoThrowContext *ctx, int id); +QV4::ReturnedValue __qmljs_get_id_array(NoThrowContext *ctx); QV4::ReturnedValue __qmljs_get_imported_scripts(NoThrowContext *ctx); QV4::ReturnedValue __qmljs_get_context_object(NoThrowContext *ctx); QV4::ReturnedValue __qmljs_get_scope_object(NoThrowContext *ctx); diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index 98b446ef2e..944fe6e514 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -657,9 +657,9 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code, VALUE(instr.result) = context->callData->thisObject; MOTH_END_INSTR(LoadThis) - MOTH_BEGIN_INSTR(LoadQmlIdObject) - VALUE(instr.result) = __qmljs_get_id_object(static_cast<QV4::NoThrowContext*>(context), instr.id); - MOTH_END_INSTR(LoadQmlIdObject) + MOTH_BEGIN_INSTR(LoadQmlIdArray) + VALUE(instr.result) = __qmljs_get_id_array(static_cast<QV4::NoThrowContext*>(context)); + MOTH_END_INSTR(LoadQmlIdArray) MOTH_BEGIN_INSTR(LoadQmlImportedScripts) VALUE(instr.result) = __qmljs_get_imported_scripts(static_cast<QV4::NoThrowContext*>(context)); |