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_p.h | |
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_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index c720632153..a02e89e883 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -79,6 +79,8 @@ struct Q_QML_PRIVATE_EXPORT FunctionObject : Object { unsigned int varCount() { return function ? function->compiledFunction->nLocals : 0; } bool needsActivation() const { return function ? function->needsActivation() : false; } + const QV4::Object *protoProperty() const { return propertyData(Index_Prototype)->cast<QV4::Object>(); } + Pointer<ExecutionContext> scope; Function *function; }; @@ -145,8 +147,6 @@ struct Q_QML_EXPORT FunctionObject: Object { static Heap::FunctionObject *createScriptFunction(ExecutionContext *scope, Function *function); - ReturnedValue protoProperty() const { return propertyData(Heap::FunctionObject::Index_Prototype)->asReturnedValue(); } - bool needsActivation() const { return d()->needsActivation(); } bool strictMode() const { return d()->function ? d()->function->isStrict() : false; } bool isBinding() const; |