138 friend struct ExecutionContextSaver;
140 friend struct Heap::ExecutionContext;
144 AotByteCode = 1 << 0,
148 Aot = AotByteCode | AotNative,
149 Qmlc = QmlcRead | QmlcWrite,
150 Enabled = Aot | Qmlc,
167 jsStackTop =
ptr + nValues;
177 template<
typename TypeLoader = QQmlTypeLoader>
181 return TypeLoader::get(m_qmlEngine);
304 return reinterpret_cast<FunctionObject *
>(jsObjects + UrlSearchParams_Ctor);
358#if QT_CONFIG(qml_network)
522#if QT_CONFIG(qml_jit)
523 const bool m_canAllocateExecutableMemory;
531#if !QT_CONFIG(qml_debug)
541 void setDebugger(Debugging::Debugger *debugger);
542 void setProfiler(Profiling::Profiler *profiler);
548 template<
typename StackFrame = CppStackFrame>
559 Heap::Object *newObject();
566 Heap::Object *newStringObject(
const String *
string);
567 Heap::Object *newSymbolObject(
const Symbol *symbol);
568 Heap::Object *newNumberObject(
double value);
569 Heap::Object *newBooleanObject(
bool b);
579 Heap::DateObject *newDateObject(
double dateTime);
586 Heap::RegExpObject *newRegExpObject(
RegExp *re);
587#if QT_CONFIG(regularexpression)
591 Heap::UrlObject *newUrlObject();
592 Heap::UrlObject *newUrlObject(
const QUrl &
url);
593 Heap::UrlSearchParamsObject *newUrlSearchParamsObject();
595 Heap::Object *newErrorObject(
const Value &
value);
607 Heap::PromiseObject *newPromiseObject();
613 Heap::Object *newForInIteratorObject(
Object *
o);
614 Heap::Object *newSetIteratorObject(
Object *
o);
615 Heap::Object *newMapIteratorObject(
Object *
o);
616 Heap::Object *newArrayIteratorObject(
Object *
o);
620 Heap::ExecutionContext *outer =
ctx->outer;
622 if (
ctx->type != Heap::ExecutionContext::Type_QmlContext && !outer)
625 while (outer && outer->type != Heap::ExecutionContext::Type_GlobalContext) {
631 if (
ctx->type != Heap::ExecutionContext::Type_QmlContext)
638 QObject *qmlScopeObject()
const;
639 QQmlRefPointer<QQmlContextData> callingQmlContext()
const;
642 StackTrace stackTrace(
int frameLimit = -1)
const;
647 void initRootContext();
685 int maxJSStackSize()
const;
686 int maxGCStackSize()
const;
688 bool checkStackLimits();
689 int safeForAllocLength(
qint64 len64);
693#if QT_CONFIG(qml_jit)
694 if (!m_canAllocateExecutableMemory)
697 return f->kind != Function::AotCompiled
699 &&
f->interpreterCallCount >= s_jitCallCountThreshold;
709 void initQmlGlobalObject();
710 void initializeGlobal();
711 void createQtObject();
717 const QSet<QString> &illegalNames()
const;
719#if QT_CONFIG(qml_xml_http_request)
720 void *xmlHttpRequestData()
const {
return m_xmlHttpRequestData; }
728 void startTimer(
const QString &timerName);
729 qint64 stopTimer(
const QString &timerName,
bool *wasRunning);
738 static QMutex *registrationMutex();
739 static int registerExtension();
741 void setExtensionData(
int, Deletable *);
744 if (
index < m_extensionData.size())
745 return m_extensionData[
index];
750 double localTZA = 0.0;
752 QQmlRefPointer<ExecutableCompilationUnit> compileModule(
const QUrl &
url);
753 QQmlRefPointer<ExecutableCompilationUnit> compileModule(
756 QQmlRefPointer<ExecutableCompilationUnit> compilationUnitForUrl(
const QUrl &
url)
const;
758 QQmlRefPointer<ExecutableCompilationUnit> executableCompilationUnit(
759 QQmlRefPointer<QV4::CompiledData::CompilationUnit> &&unit);
761 QQmlRefPointer<ExecutableCompilationUnit> insertCompilationUnit(
762 QQmlRefPointer<QV4::CompiledData::CompilationUnit> &&unit);
766 return m_compilationUnits;
769 void trimCompilationUnits();
774 QQmlRefPointer<ExecutableCompilationUnit>
compiled;
783 DiskCacheOptions diskCacheOptions()
const;
798 template<
typename Value>
801 if (
v->isUndefined())
820 static void initializeStaticMembers();
822 bool inStack(
const void *current)
const
824#if Q_STACK_GROWTH_DIRECTION > 0
825 return current < cppStackLimit && current >= cppStackBase;
827 return current > cppStackLimit && current <= cppStackBase;
831 bool hasCppStackOverflow()
833 if (s_maxCallDepth >= 0)
834 return callDepth >= s_maxCallDepth;
842 cppStackBase = stack.
base;
847 bool hasJsStackOverflow()
const
849 return jsStackTop > jsStackLimit;
852 bool hasStackOverflow()
854 return hasJsStackOverflow() || hasCppStackOverflow();
857 static int s_maxCallDepth;
858 static int s_jitCallCountThreshold;
859 static int s_maxJSStackSize;
860 static int s_maxGCStackSize;
862#if QT_CONFIG(qml_debug)
863 QScopedPointer<QV4::Debugging::Debugger> m_debugger;
864 QScopedPointer<QV4::Profiling::Profiler> m_profiler;
866 QSet<QString> m_illegalNames;
869 QScopedPointer<QV4::Promise::ReactionHandler> m_reactionHandler;
871#if QT_CONFIG(qml_xml_http_request)
872 void *m_xmlHttpRequestData;
880 QHash<QString, qint64> m_startedTimers;
882 QHash<QString, quint32> m_consoleCount;
884 QVector<Deletable *> m_extensionData;
886 QMultiHash<QUrl, QQmlRefPointer<ExecutableCompilationUnit>> m_compilationUnits;
892 QHash<QUrl, Value *> nativeModules;