Fix performance regression introduced by 6adb06
authorLars Knoll <lars.knoll@digia.com>
Mon, 14 Oct 2013 11:08:58 +0000 (13:08 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 14 Oct 2013 18:24:10 +0000 (20:24 +0200)
The global scope is compiled as EvalCode. Because of this
we were never using global lookups anymore, slowing down
the v8 test suite by ~20%.

Change-Id: I6c47ccf90f4d9ec3bf531bbb689d3f1511f69968
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/compiler/qv4codegen.cpp

index e3f835b..727d20d 100644 (file)
@@ -1374,7 +1374,7 @@ V4IR::Expr *Codegen::identifier(const QString &name, int line, int col)
         f = f->outer;
     }
 
-    if (!e->parent && (!f || !f->insideWithOrCatch) && e->compilationMode != EvalCode && e->compilationMode != QmlBinding)
+    if (!e->parent && (!f || !f->insideWithOrCatch) && _env->compilationMode != EvalCode && e->compilationMode != QmlBinding)
         return _block->GLOBALNAME(name, line, col);
 
     // global context or with. Lookup by name