25 QQmlJSShadowCheck(
const QV4::Compiler::JSUnitGenerator *jsUnitGenerator,
26 const QQmlJSTypeResolver *typeResolver, QQmlJSLogger *logger,
27 const BasicBlocks &basicBlocks,
const InstructionAnnotations &annotations)
28 : QQmlJSCompilePass(jsUnitGenerator, typeResolver, logger, basicBlocks, annotations)
31 ~QQmlJSShadowCheck() =
default;
33 BlocksAndAnnotations run(
const Function *function);
36 struct ResettableStore {
37 QQmlJSRegisterContent accumulatorIn;
38 int instructionOffset = -1;
41 void handleStore(
int base,
const QString &memberName);
43 void generate_LoadProperty(
int nameIndex) override;
44 void generate_GetLookup(
int index) override;
45 void generate_GetOptionalLookup(
int index,
int offset) override;
46 void generate_StoreProperty(
int nameIndex,
int base) override;
47 void generate_SetLookup(
int index,
int base) override;
48 void generate_CallProperty(
int nameIndex,
int base,
int argc,
int argv) override;
49 void generate_CallPropertyLookup(
int nameIndex,
int base,
int argc,
int argv) override;
51 QV4::Moth::ByteCodeHandler::Verdict startInstruction(QV4::Moth::Instr::Type) override;
52 void endInstruction(QV4::Moth::Instr::Type) override;
54 enum Shadowability { NotShadowable, Shadowable };
55 Shadowability checkShadowing(
56 QQmlJSRegisterContent baseType,
const QString &propertyName,
int baseRegister);
58 void checkResettable(QQmlJSRegisterContent accumulatorIn,
int instructionOffset);
60 Shadowability checkBaseType(QQmlJSRegisterContent baseType);
62 QList<ResettableStore> m_resettableStores;
63 QList<QQmlJSRegisterContent> m_baseTypes;
64 QSet<QQmlJSRegisterContent> m_adjustedTypes;