Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmljsshadowcheck_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef QQMLJSSHADOWCHECK_P_H
5#define QQMLJSSHADOWCHECK_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16
17#include <private/qqmljscompilepass_p.h>
18
20
21class Q_QMLCOMPILER_EXPORT QQmlJSShadowCheck : public QQmlJSCompilePass
22{
23public:
25 const QQmlJSTypeResolver *typeResolver, QQmlJSLogger *logger,
26 BasicBlocks basicBlocks, InstructionAnnotations annotations)
27 : QQmlJSCompilePass(jsUnitGenerator, typeResolver, logger, basicBlocks, annotations)
28 {}
29
30 ~QQmlJSShadowCheck() = default;
31
33
34private:
35 struct ResettableStore {
36 QQmlJSRegisterContent accumulatorIn;
37 int instructionOffset = -1;
38 };
39
40 void handleStore(int base, const QString &memberName);
41
42 void generate_LoadProperty(int nameIndex) override;
43 void generate_GetLookup(int index) override;
44 void generate_GetOptionalLookup(int index, int offset) override;
45 void generate_StoreProperty(int nameIndex, int base) override;
46 void generate_SetLookup(int index, int base) override;
47 void generate_CallProperty(int nameIndex, int base, int argc, int argv) override;
48 void generate_CallPropertyLookup(int nameIndex, int base, int argc, int argv) override;
49
51 void endInstruction(QV4::Moth::Instr::Type) override;
52
53 enum Shadowability { NotShadowable, Shadowable };
54 Shadowability checkShadowing(
55 const QQmlJSRegisterContent &baseType, const QString &propertyName, int baseRegister);
56
57 void checkResettable(const QQmlJSRegisterContent &accumulatorIn, int instructionOffset);
58
59 Shadowability checkBaseType(const QQmlJSRegisterContent &baseType);
60
61 QList<ResettableStore> m_resettableStores;
62 QList<QQmlJSRegisterContent> m_baseTypes;
63 QSet<QQmlJSRegisterContent> m_adjustedTypes;
64
65 State m_state;
66};
67
69
70#endif // QQMLJSSHADOWCHECK_P_H
~QQmlJSShadowCheck()=default
QQmlJSShadowCheck(const QV4::Compiler::JSUnitGenerator *jsUnitGenerator, const QQmlJSTypeResolver *typeResolver, QQmlJSLogger *logger, BasicBlocks basicBlocks, InstructionAnnotations annotations)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLuint index
[2]
GLenum GLuint GLintptr offset
static const uint base
Definition qurlidna.cpp:20