diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-07 08:37:45 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-10 08:18:56 +0000 |
commit | 30e3664bf3668bda9a211fe7d1404f8f806dbf7b (patch) | |
tree | bd119839af7db0f6f9119401d478b37b44051c8b /src/qml/jsruntime/qv4lookup.cpp | |
parent | eb2c08f57493aa12850e6cddff2cc3527e7cbfd7 (diff) |
Avoid creating a CallContext for simple functions
This cuts out quite a bit of overhead when entering
and leaving functions.
Change-Id: I32670c98a4087ea3b2d45853d9cabff9066399e8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4lookup.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4lookup.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4lookup.cpp b/src/qml/jsruntime/qv4lookup.cpp index 8d2d18fa2a..0fa8e1fc3d 100644 --- a/src/qml/jsruntime/qv4lookup.cpp +++ b/src/qml/jsruntime/qv4lookup.cpp @@ -49,7 +49,7 @@ using namespace QV4; ReturnedValue Lookup::lookup(const Value &thisObject, Object *o, PropertyAttributes *attrs) { ExecutionEngine *engine = o->engine(); - Identifier *name = engine->current->v4Function->compilationUnit->runtimeStrings[nameIndex]->identifier; + Identifier *name = engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]->identifier; int i = 0; Heap::Object *obj = o->d(); while (i < Size && obj) { @@ -85,7 +85,7 @@ ReturnedValue Lookup::lookup(const Object *thisObject, PropertyAttributes *attrs { Heap::Object *obj = thisObject->d(); ExecutionEngine *engine = thisObject->engine(); - Identifier *name = engine->current->v4Function->compilationUnit->runtimeStrings[nameIndex]->identifier; + Identifier *name = engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]->identifier; int i = 0; while (i < Size && obj) { classList[i] = obj->internalClass; @@ -133,7 +133,7 @@ ReturnedValue Lookup::getterGeneric(Lookup *l, ExecutionEngine *engine, const Va Q_ASSERT(object.isString()); proto = engine->stringPrototype(); Scope scope(engine); - ScopedString name(scope, engine->current->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); + ScopedString name(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); if (name->equals(engine->id_length())) { // special case, as the property is on the object itself l->getter = stringLengthGetter; @@ -234,7 +234,7 @@ ReturnedValue Lookup::getterFallback(Lookup *l, ExecutionEngine *engine, const V QV4::ScopedObject o(scope, object.toObject(scope.engine)); if (!o) return Encode::undefined(); - ScopedString name(scope, engine->current->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); + ScopedString name(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); return o->get(name); } @@ -580,7 +580,7 @@ ReturnedValue Lookup::globalGetterGeneric(Lookup *l, ExecutionEngine *engine) } } Scope scope(engine); - ScopedString n(scope, engine->current->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); + ScopedString n(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); return engine->throwReferenceError(n); } @@ -697,7 +697,7 @@ bool Lookup::setterGeneric(Lookup *l, ExecutionEngine *engine, Value &object, co o = RuntimeHelpers::convertToObject(scope.engine, object); if (!o) // type error return false; - ScopedString name(scope, engine->current->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); + ScopedString name(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); return o->put(name, value); } return o->setLookup(l, value); @@ -730,7 +730,7 @@ bool Lookup::setterFallback(Lookup *l, ExecutionEngine *engine, Value &object, c if (!o) return false; - ScopedString name(scope, engine->current->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); + ScopedString name(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); return o->put(name, value); } |