diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-11-14 22:08:00 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-04 09:45:25 +0100 |
commit | 8e25658011699596996e80d3d08f17ef2efa0634 (patch) | |
tree | 1b8322bd409e274c837e20dc64187fff3431fef2 /src/qml/jsruntime/qv4managed_p.h | |
parent | 0e864f2814959b0861ea5b07108893c2c4a047c6 (diff) |
Speedup JS instanceof operator
Cache the prototype of the functionobject, and inline hasInstance.
This removes a vtbl method and speeds things up quite a bit.
Change-Id: Ic68f301f7e09763d445a98bffa2cd201303f902e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4managed_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4managed_p.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index 47ac5e05e4..220363efff 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -84,7 +84,6 @@ struct ManagedVTable void (*markObjects)(Managed *, ExecutionEngine *e); void (*destroy)(Managed *); void (*collectDeletables)(Managed *, GCDeletable **deletable); - bool (*hasInstance)(Managed *, const ValueRef value); ReturnedValue (*get)(Managed *, const StringRef name, bool *hasProperty); ReturnedValue (*getIndexed)(Managed *, uint index, bool *hasProperty); void (*put)(Managed *, const StringRef name, const ValueRef value); @@ -108,7 +107,6 @@ const QV4::ManagedVTable classname::static_vtbl = \ markObjects, \ destroy, \ 0, \ - hasInstance, \ get, \ getIndexed, \ put, \ @@ -132,7 +130,6 @@ const QV4::ManagedVTable classname::static_vtbl = \ markObjects, \ destroy, \ collectDeletables, \ - hasInstance, \ get, \ getIndexed, \ put, \ @@ -240,7 +237,6 @@ public: *reinterpret_cast<Managed **>(this) = m; } - bool hasInstance(const ValueRef v); ReturnedValue construct(CallData *d); ReturnedValue call(CallData *d); ReturnedValue get(const StringRef name, bool *hasProperty = 0); @@ -263,7 +259,6 @@ public: Property *advanceIterator(ObjectIterator *it, StringRef name, uint *index, PropertyAttributes *attributes); static void destroy(Managed *that) { that->_data = 0; } - static bool hasInstance(Managed *that, const ValueRef value); static ReturnedValue construct(Managed *m, CallData *d); static ReturnedValue call(Managed *m, CallData *); static ReturnedValue getLookup(Managed *m, Lookup *); |