diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-04-14 12:17:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-04-15 10:34:47 +0200 |
commit | 3e6fc20a2ac4da117aa5f6da278c8dd784741f5e (patch) | |
tree | 6351677cc503ebd522744db54b70db18d9da9188 /src/v4/qv4lookup.h | |
parent | 3dbd772cc4c3e0cff133d401c6986b013d507eb9 (diff) |
use lookups for the global scope
Gives about 12% speed improvement for the V8 benchmark.
fact.2.js is almost twice as fast.
Change-Id: Icfa1a780b30e131b9531e12f4bd569516c404e86
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/v4/qv4lookup.h')
-rw-r--r-- | src/v4/qv4lookup.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/v4/qv4lookup.h b/src/v4/qv4lookup.h index c51940ac2d..c287c97124 100644 --- a/src/v4/qv4lookup.h +++ b/src/v4/qv4lookup.h @@ -55,7 +55,10 @@ namespace VM { struct Lookup { enum { Size = 4 }; - void (*lookupProperty)(Lookup *l, ExecutionContext *ctx, Value *result, const Value &object); + union { + void (*lookupProperty)(Lookup *l, ExecutionContext *ctx, Value *result, const Value &object); + void (*lookupGlobal)(Lookup *l, ExecutionContext *ctx, Value *result); + }; InternalClass *classList[Size]; int level; uint index; @@ -66,6 +69,11 @@ struct Lookup { static void lookupProperty1(Lookup *l, ExecutionContext *ctx, Value *result, const Value &object); static void lookupProperty2(Lookup *l, ExecutionContext *ctx, Value *result, const Value &object); + static void lookupGlobalGeneric(Lookup *l, ExecutionContext *ctx, Value *result); + static void lookupGlobal0(Lookup *l, ExecutionContext *ctx, Value *result); + static void lookupGlobal1(Lookup *l, ExecutionContext *ctx, Value *result); + static void lookupGlobal2(Lookup *l, ExecutionContext *ctx, Value *result); + Property *lookup(Object *obj, PropertyAttributes *attrs) { int i = 0; while (i < level && obj && obj->internalClass == classList[i]) { |