aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4argumentsobject_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-11-14 11:08:41 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-22 14:54:12 +0100
commitce26bfcb3952dcd1238e7aa07b9ab1d9585c9871 (patch)
treee639703f38ff6b7a9407b7951f815ba9e2f11da8 /src/qml/jsruntime/qv4argumentsobject_p.h
parent9bf5e87ef0abd3c4612baca66c79e2d33f8fbfb9 (diff)
Speed up arguments object
Don't fully create the arguments object unless required. In the 95% use case, we can avoid creating any array based data structures for the arguments object and directly manipulate the functions arguments. only create the full data structure for the other 5%. Speeds up the raytrace test by 50%, gives around 10% overall on v8-bench. Change-Id: If727d28b96585e83314f544031a6c3ca1817ea19 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4argumentsobject_p.h')
-rw-r--r--src/qml/jsruntime/qv4argumentsobject_p.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4argumentsobject_p.h b/src/qml/jsruntime/qv4argumentsobject_p.h
index 7a5b0817a3..7c58c48bcc 100644
--- a/src/qml/jsruntime/qv4argumentsobject_p.h
+++ b/src/qml/jsruntime/qv4argumentsobject_p.h
@@ -74,20 +74,26 @@ struct ArgumentsSetterFunction: FunctionObject
struct ArgumentsObject: Object {
Q_MANAGED
CallContext *context;
+ bool fullyCreated;
QVector<SafeValue> mappedArguments;
ArgumentsObject(CallContext *context);
~ArgumentsObject() {}
+
enum {
LengthPropertyIndex = 0,
CalleePropertyIndex = 1,
CallerPropertyIndex = 2
};
bool defineOwnProperty(ExecutionContext *ctx, uint index, const Property &desc, PropertyAttributes attrs);
-
+ static ReturnedValue getIndexed(Managed *m, uint index, bool *hasProperty);
+ static void putIndexed(Managed *m, uint index, const ValueRef value);
+ static bool deleteIndexedProperty(Managed *m, uint index);
+ static PropertyAttributes queryIndexed(const Managed *m, uint index);
static void markObjects(Managed *that, ExecutionEngine *e);
-protected:
static void destroy(Managed *);
+
+ void fullyCreate();
};
}