diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-10-10 11:51:42 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-30 08:29:49 +0100 |
commit | b59751b146ecdf7a4b387845d9be19e4600e2911 (patch) | |
tree | dddca88f6544adbf0de3ef05fbf56cbd0bdac095 /src/qml/compiler/qv4instr_moth_p.h | |
parent | 928a7d3e3edb278281641b6928ba046b123548ca (diff) |
Use lookups in the interpreter
Implement lookup calls for the interpreter. This
significantly reduces overhead by avoiding repeated
name lookups on the same object type.
This doubles the speed of quite a few of the v8
benchmarks, and brings the interpreter up to close
to 40% of the speed of the JIT.
Change-Id: Ie8c2f5b1ca71a7329bc643c3d2158a6301a392ed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4instr_moth_p.h')
-rw-r--r-- | src/qml/compiler/qv4instr_moth_p.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index 562f70bddd..6734d93ae0 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -57,16 +57,21 @@ QT_BEGIN_NAMESPACE F(Move, move) \ F(SwapTemps, swapTemps) \ F(LoadName, loadName) \ + F(GetGlobalLookup, getGlobalLookup) \ F(StoreName, storeName) \ F(LoadElement, loadElement) \ F(StoreElement, storeElement) \ F(LoadProperty, loadProperty) \ + F(GetLookup, getLookup) \ F(StoreProperty, storeProperty) \ + F(SetLookup, setLookup) \ F(Push, push) \ F(CallValue, callValue) \ F(CallProperty, callProperty) \ + F(CallPropertyLookup, callPropertyLookup) \ F(CallElement, callElement) \ F(CallActivationProperty, callActivationProperty) \ + F(CallGlobalLookup, callGlobalLookup) \ F(SetExceptionHandler, setExceptionHandler) \ F(CallBuiltinThrow, callBuiltinThrow) \ F(CallBuiltinUnwindException, callBuiltinUnwindException) \ @@ -91,6 +96,7 @@ QT_BEGIN_NAMESPACE F(CreateValue, createValue) \ F(CreateProperty, createProperty) \ F(CreateActivationProperty, createActivationProperty) \ + F(ConstructGlobalLookup, constructGlobalLookup) \ F(Jump, jump) \ F(CJump, cjump) \ F(UNot, unot) \ @@ -247,6 +253,11 @@ union Instr int name; Param result; }; + struct instr_getGlobalLookup { + MOTH_INSTR_HEADER + int index; + Param result; + }; struct instr_storeName { MOTH_INSTR_HEADER int name; @@ -258,12 +269,24 @@ union Instr Param base; Param result; }; + struct instr_getLookup { + MOTH_INSTR_HEADER + int index; + Param base; + Param result; + }; struct instr_storeProperty { MOTH_INSTR_HEADER int name; Param base; Param source; }; + struct instr_setLookup { + MOTH_INSTR_HEADER + int index; + Param base; + Param source; + }; struct instr_loadElement { MOTH_INSTR_HEADER Param base; @@ -295,6 +318,14 @@ union Instr Param base; Param result; }; + struct instr_callPropertyLookup { + MOTH_INSTR_HEADER + int lookupIndex; + quint32 argc; + quint32 callData; + Param base; + Param result; + }; struct instr_callElement { MOTH_INSTR_HEADER Param base; @@ -310,6 +341,13 @@ union Instr quint32 callData; Param result; }; + struct instr_callGlobalLookup { + MOTH_INSTR_HEADER + int index; + quint32 argc; + quint32 callData; + Param result; + }; struct instr_setExceptionHandler { MOTH_INSTR_HEADER qptrdiff offset; @@ -438,6 +476,13 @@ union Instr quint32 callData; Param result; }; + struct instr_constructGlobalLookup { + MOTH_INSTR_HEADER + int index; + quint32 argc; + quint32 callData; + Param result; + }; struct instr_jump { MOTH_INSTR_HEADER ptrdiff_t offset; @@ -592,16 +637,21 @@ union Instr instr_swapTemps swapTemps; instr_loadClosure loadClosure; instr_loadName loadName; + instr_getGlobalLookup getGlobalLookup; instr_storeName storeName; instr_loadElement loadElement; instr_storeElement storeElement; instr_loadProperty loadProperty; + instr_getLookup getLookup; instr_storeProperty storeProperty; + instr_setLookup setLookup; instr_push push; instr_callValue callValue; instr_callProperty callProperty; + instr_callPropertyLookup callPropertyLookup; instr_callElement callElement; instr_callActivationProperty callActivationProperty; + instr_callGlobalLookup callGlobalLookup; instr_callBuiltinThrow callBuiltinThrow; instr_setExceptionHandler setExceptionHandler; instr_callBuiltinUnwindException callBuiltinUnwindException; @@ -626,6 +676,7 @@ union Instr instr_createValue createValue; instr_createProperty createProperty; instr_createActivationProperty createActivationProperty; + instr_constructGlobalLookup constructGlobalLookup; instr_jump jump; instr_cjump cjump; instr_unot unot; |