Micro optimisations
authorLars Knoll <lars.knoll@digia.com>
Thu, 18 Oct 2012 12:52:22 +0000 (14:52 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Thu, 18 Oct 2012 13:04:06 +0000 (15:04 +0200)
Change-Id: Ifae82d259f55e8e3791ef05eb7ea5f607fbfd747
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
qmljs_runtime.cpp

index 026cef0..6d0f5cd 100644 (file)
@@ -280,7 +280,7 @@ void Context::init(ExecutionEngine *eng)
 Value *Context::lookupPropertyDescriptor(String *name)
 {
     for (Context *ctx = this; ctx; ctx = ctx->parent) {
-        if (ctx->activation.is(Value::Object_Type)) {
+        if (ctx->activation.isObject()) {
             if (Value *prop = ctx->activation.objectValue()->getPropertyDescriptor(this, name)) {
                 return prop;
             }
@@ -1028,7 +1028,7 @@ Value __qmljs_get_element(Context *ctx, Value object, Value index)
     if (! object.isObject())
         object = __qmljs_to_object(object, ctx);
 
-    return object.property(ctx, name);
+    return object.objectValue()->getProperty(ctx, name);
 }
 
 void __qmljs_set_element(Context *ctx, Value object, Value index, Value value)
@@ -1268,8 +1268,7 @@ Value __qmljs_construct_property(Context *context, Value base, String *name, Val
     if (!thisObject.isObject())
         thisObject = __qmljs_to_object(base, context);
 
-    assert(thisObject.isObject());
-    Value func = thisObject.property(context, name);
+    Value func = thisObject.objectValue()->getProperty(context, name);
     if (FunctionObject *f = func.asFunctionObject()) {
         Context k;
         Context *ctx = f->needsActivation ? context->engine->newContext() : &k;