diff options
| author | Lars Knoll <lars.knoll@qt.io> | 2016-12-12 10:49:55 +0100 |
|---|---|---|
| committer | Lars Knoll <lars.knoll@qt.io> | 2016-12-13 08:27:57 +0000 |
| commit | 180decaf11ea6fb1147825a78a95c455400f7c7e (patch) | |
| tree | b27564cfb0b2459cbc32f120471242ee108b5375 /src/qml/jsruntime/qv4functionobject.cpp | |
| parent | 4ccba8ea25312e0b635df21ce3fea7624744ee34 (diff) | |
Optimize code in instanceOf() of FunctionObject::protoForConstructor()
Saves around 1.5% instructions for the Earley Boyer benchmark
Change-Id: I552d324d5e1713f655ab9909f30c9527bb4ff777
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 2da05f6217..64f7b98618 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -451,11 +451,10 @@ void Heap::ScriptFunction::init(QV4::ExecutionContext *scope, Function *function Heap::Object *ScriptFunction::protoForConstructor() const { - Scope scope(engine()); - ScopedObject p(scope, protoProperty()); - if (p) - return p->d(); - return scope.engine->objectPrototype()->d(); + const Object *o = d()->protoProperty(); + if (o) + return o->d(); + return engine()->objectPrototype()->d(); } |
