7#include <QtQml/private/qv4calldata_p.h>
33 parent->nestedContexts.append(
c);
45 if (accessAcrossContextBoundaries)
65 return (scope == VariableScope::Var);
70 if (scope != VariableScope::Var || (*it).scope != VariableScope::Var)
72 if ((*it).type <=
type) {
88 m.declarationLocation = declarationLocation;
89 m.isInjected = isInjected;
106 if (!
c->parent &&
m.index < 0)
113 result.isConst = (
m.scope == VariableScope::Const);
114 result.requiresTDZCheck =
m.requiresTDZCheck(accessLocation,
c !=
this) ||
c->isCaseBlock();
116 result.isArgOrEval =
true;
117 result.declarationLocation =
m.declarationLocation;
118 result.isInjected =
m.isInjected;
121 const int argIdx =
c->findArgument(
name, &
result.isInjected);
123 if (
c->argumentsCanEscape) {
124 result.index = argIdx +
c->locals.size();
137 if (
c->hasDirectEval) {
142 if (
c->requiresExecutionContext)
151 for (
int i = 0;
i <
c->importEntries.size(); ++
i) {
152 if (
c->importEntries.at(
i).localName ==
name) {
157 result.requiresTDZCheck =
true;
188 Instruction::PushScriptContext scriptContext;
193 Instruction::PushCatchContext catchContext;
198 Instruction::PushBlockContext blockContext;
203 Instruction::CreateCallContext createContext;
209 Instruction::InitializeBlockDeadTemporalZone tdzInit;
218 Instruction::ConvertThisToObject
convert;
222 Instruction::LoadReg
load;
229 Instruction::LoadReg
load;
239 if (
it->isLexicallyScoped())
243 Instruction::DeclareVar declareVar;
254 Instruction::LoadReg
load;
257 Instruction::StoreLocal store;
258 store.index =
it->index;
267 Instruction::CreateUnmappedArgumentsObject setup;
270 Instruction::CreateMappedArgumentsObject setup;
277 if (member.function) {
278 const int function = codegen->
defineFunction(member.function->name.toString(), member.function, member.function->formals, member.function->body);
297 bytecodeGenerator->
addInstruction(Instruction::PopScriptContext());
316 const auto registerLocal = [
this, &localsInTDZ](Context::MemberMap::iterator member) {
317 if (member->isLexicallyScoped()) {
318 localsInTDZ << member;
320 member->index =
locals.size();
321 locals.append(member.key());
326 const auto allocateRegister = [bytecodeGenerator, ®istersInTDZ](Context::MemberMap::iterator member) {
327 if (member->isLexicallyScoped())
328 registersInTDZ << member;
345 allocateRegister(
it);
359 allocateRegister(
it);
365 for (
auto &member: std::as_const(localsInTDZ)) {
366 member->index =
locals.size();
367 locals.append(member.key());
381 for (
auto &member: std::as_const(registersInTDZ))
qsizetype size() const noexcept
iterator insert(const Key &key, const T &value)
bool contains(const Key &key) const
iterator find(const Key &key)
const_iterator constBegin() const
const_iterator constEnd() const
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
int registerString(const QString &name)
Reference referenceForName(const QString &name, bool lhs, const QQmlJS::SourceLocation &accessLocation=QQmlJS::SourceLocation())
virtual int defineFunction(const QString &name, QQmlJS::AST::Node *ast, QQmlJS::AST::FormalParameterList *formals, QQmlJS::AST::StatementList *body)
BytecodeGenerator * generator() const
void loadClosure(int index)
int currentRegister() const
void addInstruction(const InstrData< InstrT > &data)
int newRegisterArray(int n)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
\qmltype Particle \inqmlmodule QtQuick.Particles
#define QT_WARNING_DISABLE_GCC(text)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
QLatin1StringView QLatin1String
#define QStringLiteral(str)
Reference storeConsumeAccumulator() const
bool isLexicallyScoped() const
bool requiresTDZCheck(const QQmlJS::SourceLocation &accessLocation, bool accessAcrossContextBoundaries) const
QQmlJS::SourceLocation declarationLocation
void emitBlockFooter(Compiler::Codegen *codegen)
QQmlJS::AST::FormalParameterList * formals
bool innerFunctionAccessesThis
void emitBlockHeader(Compiler::Codegen *codegen)
bool innerFunctionAccessesNewTarget
int firstTemporalDeadZoneRegister
UsesArgumentsObject usesArgumentsObject
bool requiresExecutionContext
int sizeOfRegisterTemporalDeadZone
ResolvedName resolveName(const QString &name, const QQmlJS::SourceLocation &accessLocation)
QString localNameForDefaultExport
void setupFunctionIndices(Moth::BytecodeGenerator *bytecodeGenerator)
int sizeOfLocalTemporalDeadZone
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)
QHash< QQmlJS::AST::Node *, Context * > contextMap
QList< Context * > blocks
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent