diff options
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; |