diff options
author | Lars Knoll <[email protected]> | 2013-11-14 22:08:00 +0100 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-12-04 09:45:25 +0100 |
commit | 8e25658011699596996e80d3d08f17ef2efa0634 (patch) | |
tree | 1b8322bd409e274c837e20dc64187fff3431fef2 /src/qml/jsruntime/qv4managed.cpp | |
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 <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4managed.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4managed.cpp | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/qml/jsruntime/qv4managed.cpp b/src/qml/jsruntime/qv4managed.cpp index 6455a08037..895ae8d91b 100644 --- a/src/qml/jsruntime/qv4managed.cpp +++ b/src/qml/jsruntime/qv4managed.cpp @@ -52,7 +52,6 @@ const ManagedVTable Managed::static_vtbl = 0 /*markObjects*/, destroy, 0 /*collectDeletables*/, - hasInstance, 0, 0, 0, @@ -178,11 +177,6 @@ QString Managed::className() const return QString::fromLatin1(s); } -bool Managed::hasInstance(Managed *m, const ValueRef) -{ - return m->engine()->current->throwTypeError(); -} - ReturnedValue Managed::construct(Managed *m, CallData *) { return m->engine()->current->throwTypeError(); @@ -208,11 +202,6 @@ bool Managed::isEqualTo(Managed *, Managed *) return false; } -bool Managed::hasInstance(const ValueRef v) -{ - return vtbl->hasInstance(this, v); -} - ReturnedValue Managed::get(const StringRef name, bool *hasProperty) { return vtbl->get(this, name, hasProperty); |