Optimise property access
authorLars Knoll <lars.knoll@digia.com>
Tue, 12 Feb 2013 21:50:41 +0000 (22:50 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Wed, 13 Feb 2013 07:11:39 +0000 (08:11 +0100)
Change-Id: I24e41395cd6f648b121f9a08ab1eaacae234e081
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/v4/qmljs_runtime.cpp

index f3555e3..51f6b40 100644 (file)
@@ -708,7 +708,7 @@ Value __qmljs_get_property_lookup(ExecutionContext *ctx, Value object, int looku
         }
 
         if (p)
-            return o->getValue(ctx, p);
+            return p->type == PropertyDescriptor::Data ? p->value : o->getValue(ctx, p);
         else
             return object.objectValue()->__get__(ctx, l->name);
     }
@@ -891,7 +891,7 @@ Value __qmljs_call_property_lookup(ExecutionContext *context, Value thisObject,
 
     Value func;
     if (p)
-        func = baseObject->getValue(context, p);
+        func =  p->type == PropertyDescriptor::Data ? p->value : baseObject->getValue(context, p);
     else
         func = baseObject->__get__(context, l->name);