diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-09 13:02:26 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-10 08:19:44 +0000 |
commit | 25c5e356353aab15dbf144391a455811c160c3e4 (patch) | |
tree | fde3f9dd9e16ee941564bb268f9ab62bed6017f0 /src/qml/compiler | |
parent | 5fa0bd1f0323bd8c031224e22d52027e38ea9702 (diff) |
Split StoreName into StoreNameStrict and StoreNameSloppy
And adjust the name of the corresponding runtime functions.
Change-Id: I4adf7b0e069d9b0dff9162cd1271dafc60be854b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 13 | ||||
-rw-r--r-- | src/qml/compiler/qv4instr_moth.cpp | 8 | ||||
-rw-r--r-- | src/qml/compiler/qv4instr_moth_p.h | 12 |
3 files changed, 25 insertions, 8 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index a0f1ce5879..8ede8a6818 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2866,9 +2866,16 @@ void Codegen::Reference::storeAccumulator() const return; } case Name: { - Instruction::StoreName store; - store.name = unqualifiedNameIndex; - codegen->bytecodeGenerator->addInstruction(store); + Context *c = codegen->currentContext(); + if (c->isStrict) { + Instruction::StoreNameStrict store; + store.name = unqualifiedNameIndex; + codegen->bytecodeGenerator->addInstruction(store); + } else { + Instruction::StoreNameSloppy store; + store.name = unqualifiedNameIndex; + codegen->bytecodeGenerator->addInstruction(store); + } } return; case Member: if (codegen->useFastLookups) { diff --git a/src/qml/compiler/qv4instr_moth.cpp b/src/qml/compiler/qv4instr_moth.cpp index db68c2d76f..52f2190959 100644 --- a/src/qml/compiler/qv4instr_moth.cpp +++ b/src/qml/compiler/qv4instr_moth.cpp @@ -173,9 +173,13 @@ void dumpBytecode(const char *code, int len, int nFormals) d << instr.index; MOTH_END_INSTR(GetGlobalLookup) - MOTH_BEGIN_INSTR(StoreName) + MOTH_BEGIN_INSTR(StoreNameSloppy) d << instr.name; - MOTH_END_INSTR(StoreName) + MOTH_END_INSTR(StoreNameSloppy) + + MOTH_BEGIN_INSTR(StoreNameStrict) + d << instr.name; + MOTH_END_INSTR(StoreNameStrict) MOTH_BEGIN_INSTR(LoadElement) d << instr.base.dump(nFormals) << "[" << instr.index.dump(nFormals) << "]"; diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index 52d0497926..d840cda090 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -85,7 +85,8 @@ QT_BEGIN_NAMESPACE F(LoadClosure, loadClosure) \ F(LoadName, loadName) \ F(GetGlobalLookup, getGlobalLookup) \ - F(StoreName, storeName) \ + F(StoreNameSloppy, storeNameSloppy) \ + F(StoreNameStrict, storeNameStrict) \ F(LoadElement, loadElement) \ F(LoadElementA, loadElementA) \ F(StoreElement, storeElement) \ @@ -322,7 +323,11 @@ union Instr MOTH_INSTR_HEADER int index; }; - struct instr_storeName { + struct instr_storeNameSloppy { + MOTH_INSTR_HEADER + int name; + }; + struct instr_storeNameStrict { MOTH_INSTR_HEADER int name; }; @@ -706,7 +711,8 @@ union Instr instr_loadClosure loadClosure; instr_loadName loadName; instr_getGlobalLookup getGlobalLookup; - instr_storeName storeName; + instr_storeNameSloppy storeNameSloppy; + instr_storeNameStrict storeNameStrict; instr_loadElement loadElement; instr_loadElementA loadElementA; instr_storeElement storeElement; |