diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-07-01 11:33:04 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-07-03 08:09:13 +0000 |
commit | 6e79a00cad2f5dd09bdf40e594a65af58b370d9d (patch) | |
tree | dc00a93fae797b24a53c0f858ae70904dc6f169c /src/qml/compiler | |
parent | dcbdb306f4442199384a71d532a3610a84d13fd5 (diff) |
Get rid of the duplication for the GetLookup instructions
GetLookup and GetLookupA were doing exactly the same thing. Only keep
the version that expects the base object in the accumulator and
rename it to GetLookup.
Change-Id: Ia14256880cef23f7b70d8c7e6bb74aba371b8d9a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r-- | src/qml/compiler/qv4bytecodehandler.cpp | 3 | ||||
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 14 | ||||
-rw-r--r-- | src/qml/compiler/qv4instr_moth.cpp | 6 | ||||
-rw-r--r-- | src/qml/compiler/qv4instr_moth_p.h | 4 |
4 files changed, 6 insertions, 21 deletions
diff --git a/src/qml/compiler/qv4bytecodehandler.cpp b/src/qml/compiler/qv4bytecodehandler.cpp index b96c04dc01..45968570d0 100644 --- a/src/qml/compiler/qv4bytecodehandler.cpp +++ b/src/qml/compiler/qv4bytecodehandler.cpp @@ -206,9 +206,6 @@ std::vector<int> ByteCodeHandler::collectLabelsInBytecode(const char *code, uint COLLECTOR_BEGIN_INSTR(GetLookup) COLLECTOR_END_INSTR(GetLookup) - COLLECTOR_BEGIN_INSTR(GetLookupA) - COLLECTOR_END_INSTR(GetLookupA) - COLLECTOR_BEGIN_INSTR(StoreProperty) COLLECTOR_END_INSTR(StoreProperty) diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index cb9049c73d..7e22966302 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -4106,16 +4106,10 @@ QT_WARNING_POP return; case Member: if (!disable_lookups && codegen->useFastLookups) { - if (propertyBase.isAccumulator()) { - Instruction::GetLookupA load; - load.index = codegen->registerGetterLookup(propertyNameIndex); - codegen->bytecodeGenerator->addInstruction(load); - } else { - Instruction::GetLookup load; - load.base = propertyBase.storeOnStack().stackSlot(); - load.index = codegen->registerGetterLookup(propertyNameIndex); - codegen->bytecodeGenerator->addInstruction(load); - } + propertyBase.loadInAccumulator(); + Instruction::GetLookup load; + load.index = codegen->registerGetterLookup(propertyNameIndex); + codegen->bytecodeGenerator->addInstruction(load); } else { propertyBase.loadInAccumulator(); Instruction::LoadProperty load; diff --git a/src/qml/compiler/qv4instr_moth.cpp b/src/qml/compiler/qv4instr_moth.cpp index 2ce06c9552..56da14b098 100644 --- a/src/qml/compiler/qv4instr_moth.cpp +++ b/src/qml/compiler/qv4instr_moth.cpp @@ -301,12 +301,8 @@ void dumpBytecode(const char *code, int len, int nLocals, int nFormals, int /*st MOTH_END_INSTR(LoadProperty) MOTH_BEGIN_INSTR(GetLookup) - d << dumpRegister(base, nFormals) << "(" << index << ")"; - MOTH_END_INSTR(GetLookup) - - MOTH_BEGIN_INSTR(GetLookupA) d << "acc(" << index << ")"; - MOTH_END_INSTR(GetLookupA) + MOTH_END_INSTR(GetLookup) MOTH_BEGIN_INSTR(StoreProperty) d << dumpRegister(base, nFormals) << "[" << name<< "]"; diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index 00ed76e6c2..f0a3332ee1 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -87,8 +87,7 @@ QT_BEGIN_NAMESPACE #define INSTR_StoreNameSloppy(op) INSTRUCTION(op, StoreNameSloppy, 1, name) #define INSTR_StoreNameStrict(op) INSTRUCTION(op, StoreNameStrict, 1, name) #define INSTR_LoadProperty(op) INSTRUCTION(op, LoadProperty, 1, name) -#define INSTR_GetLookup(op) INSTRUCTION(op, GetLookup, 2, index, base) -#define INSTR_GetLookupA(op) INSTRUCTION(op, GetLookupA, 1, index) +#define INSTR_GetLookup(op) INSTRUCTION(op, GetLookup, 1, index) #define INSTR_LoadScopeObjectProperty(op) INSTRUCTION(op, LoadScopeObjectProperty, 3, propertyIndex, base, captureRequired) #define INSTR_LoadContextObjectProperty(op) INSTRUCTION(op, LoadContextObjectProperty, 3, propertyIndex, base, captureRequired) #define INSTR_LoadIdObject(op) INSTRUCTION(op, LoadIdObject, 2, index, base) @@ -220,7 +219,6 @@ QT_BEGIN_NAMESPACE F(StoreElement) \ F(LoadProperty) \ F(GetLookup) \ - F(GetLookupA) \ F(StoreProperty) \ F(SetLookup) \ F(StoreScopeObjectProperty) \ |