5#ifndef QV4COMPILERCONTEXT_P_H
6#define QV4COMPILERCONTEXT_P_H
19#include <private/qqmljsast_p.h>
20#include <private/qv4compileddata_p.h>
21#include <QtCore/QStringList>
22#include <QtCore/QDateTime>
23#include <QtCore/QStack>
24#include <QtCore/QHash>
27#include <QtCore/QVarLengthArray>
81 return strings == other.strings && rawStrings == other.rawStrings;
94 {
return lhs.exportName < rhs.exportName; }
106 Module(
const QString &fileName,
const QString &finalUrl,
bool debugMode)
112 qDeleteAll(contextMap);
173 bool requiresTDZCheck(
const QQmlJS::SourceLocation &accessLocation,
bool accessAcrossContextBoundaries)
const;
227 template <
typename T>
233 for (
auto it : *
this) {
259 for (
auto it = begin(), eit = end(); it != eit; ++it) {
260 if (it->_key == key) {
279 return arguments.contains(name);
285 for (
int i = arguments.size() - 1; i >= 0; --i) {
286 const auto &arg = arguments.at(i);
287 if (arg.id == name) {
288 *isInjected = arg.isInjected();
297 MemberMap::const_iterator it =
members.find(name);
300 Q_ASSERT(it->index != -1 || !
parent);
307 MemberMap::const_iterator it =
members.find(name);
323 usedVariables.insert(name);
327 const QString &name,
MemberType contextType, QQmlJS::AST::VariableScope scope,
328 QQmlJS::AST::FunctionExpression *function =
nullptr,
330 bool isInjected =
false);
371 return contextType == ContextType::Block && name == u"%CaseBlock";
void insert(quint32 key, quint32 value)
int currentRegister() const
int newRegisterArray(int n)
QList< Method > staticMethods
KeyValuePair(quint32 key, quint32 value)
bool isLexicallyScoped() const
QQmlJS::AST::FunctionExpression * function
bool requiresTDZCheck(const QQmlJS::SourceLocation &accessLocation, bool accessAcrossContextBoundaries) const
QQmlJS::SourceLocation declarationLocation
QQmlJS::AST::VariableScope scope
QQmlJS::SourceLocation declarationLocation
Context::MemberType memberType
QQmlJS::SourceLocation location
QList< Context * > nestedContexts
bool memberInfo(const QString &name, const Member **m) const
void emitBlockFooter(Compiler::Codegen *codegen)
QQmlJS::AST::FormalParameterList * formals
bool innerFunctionAccessesThis
bool hasArgument(const QString &name) const
void emitBlockHeader(Compiler::Codegen *codegen)
QQmlJS::AST::BoundNames arguments
QSet< QString > usedVariables
bool canHaveTailCalls() const
bool innerFunctionAccessesNewTarget
int firstTemporalDeadZoneRegister
std::unique_ptr< SourceLocationTable > sourceLocationTable
UsesArgumentsObject usesArgumentsObject
QList< CompiledData::CodeOffsetToLineAndStatement > lineAndStatementNumberMapping
QList< ImportEntry > importEntries
bool requiresExecutionContext
QMap< QString, Member > MemberMap
QQmlJS::AST::Type * returnType
Context(Context *parent, ContextType type)
int sizeOfRegisterTemporalDeadZone
ResolvedName resolveName(const QString &name, const QQmlJS::SourceLocation &accessLocation)
QString localNameForDefaultExport
bool requiresImplicitReturnValue() const
void setupFunctionIndices(Moth::BytecodeGenerator *bytecodeGenerator)
int registerCountInFunction
QQmlJS::SourceLocation lastBlockInitializerLocation
void addUsedVariable(const QString &name)
ControlFlow * controlFlow
QList< ExportEntry > exportEntries
int sizeOfLocalTemporalDeadZone
std::vector< unsigned > labelInfo
Member findMember(const QString &name) const
QStringList moduleRequests
bool addLocalVar(const QString &name, MemberType contextType, QQmlJS::AST::VariableScope scope, QQmlJS::AST::FunctionExpression *function=nullptr, const QQmlJS::SourceLocation &declarationLocation=QQmlJS::SourceLocation(), bool isInjected=false)
int findArgument(const QString &name, bool *isInjected) const
CompiledData::Location location
static bool lessThan(const ExportEntry &lhs, const ExportEntry &rhs)
CompiledData::Location location
Context * newContext(QQmlJS::AST::Node *node, Context *parent, ContextType compilationMode)
QHash< QQmlJS::AST::Node *, Context * > contextMap
QList< ExportEntry > indirectExportEntries
QList< Context * > functions
QDateTime sourceTimeStamp
Module(const QString &fileName, const QString &finalUrl, bool debugMode)
QStringList moduleRequests
QList< ExportEntry > starExportEntries
QList< TemplateObject > templateObjects
QList< ImportEntry > importEntries
QList< ExportEntry > localExportEntries
QList< Context * > blocks
bool operator==(const TemplateObject &other)