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
qqmljsoptimizations_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 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 QQMLJSOPTIMIZATIONS_P_H
5#define QQMLJSOPTIMIZATIONS_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 QQmlJSOptimizations : public QQmlJSCompilePass
22{
23public:
24 using Conversions = QSet<int>;
25
27 const QQmlJSTypeResolver *typeResolver, QQmlJSLogger *logger,
28 BasicBlocks basicBlocks, InstructionAnnotations annotations,
29 QList<ObjectOrArrayDefinition> objectAndArrayDefinitions)
30 : QQmlJSCompilePass(unitGenerator, typeResolver, logger, basicBlocks, annotations),
31 m_objectAndArrayDefinitions{ objectAndArrayDefinitions }
32 {
33 }
34
36
38
39private:
40 struct RegisterAccess
41 {
42 QList<QQmlJSScope::ConstPtr> trackedTypes;
43 QHash<int, QQmlJSScope::ConstPtr> typeReaders;
44 QHash<int, Conversions> registerReadersAndConversions;
45 int trackedRegister;
46 };
47
49 {
50 return ProcessInstruction;
51 }
53
54 void populateBasicBlocks();
55 void populateReaderLocations();
56 void adjustTypes();
57 bool canMove(int instructionOffset, const RegisterAccess &access) const;
58
59 QHash<int, RegisterAccess> m_readerLocations;
60 QList<ObjectOrArrayDefinition> m_objectAndArrayDefinitions;
61};
62
64
65#endif // QQMLJSOPTIMIZATIONS_P_H
~QQmlJSOptimizations()=default
QV4::Moth::ByteCodeHandler::Verdict startInstruction(QV4::Moth::Instr::Type) override
QQmlJSOptimizations(const QV4::Compiler::JSUnitGenerator *unitGenerator, const QQmlJSTypeResolver *typeResolver, QQmlJSLogger *logger, BasicBlocks basicBlocks, InstructionAnnotations annotations, QList< ObjectOrArrayDefinition > objectAndArrayDefinitions)
void endInstruction(QV4::Moth::Instr::Type) override
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLenum access