![]() |
Qt 6.x
The Qt SDK
|
#include <qqmljsstoragegeneralizer_p.h>
Inheritance diagram for QQmlJSStorageGeneralizer:
Collaboration diagram for QQmlJSStorageGeneralizer:Public Member Functions | |
| QQmlJSStorageGeneralizer (const QV4::Compiler::JSUnitGenerator *jsUnitGenerator, const QQmlJSTypeResolver *typeResolver, QQmlJSLogger *logger) | |
| InstructionAnnotations | run (InstructionAnnotations annotations, Function *function, QQmlJS::DiagnosticMessage *error) |
Public Member Functions inherited from QQmlJSCompilePass | |
| QQmlJSCompilePass (const QV4::Compiler::JSUnitGenerator *jsUnitGenerator, const QQmlJSTypeResolver *typeResolver, QQmlJSLogger *logger) | |
Public Member Functions inherited from QV4::Moth::ByteCodeHandler | |
| ByteCodeHandler ()=default | |
| virtual | ~ByteCodeHandler () |
| void | decode (const char *code, uint len) |
| void | reset () |
| int | currentInstructionOffset () const |
| int | nextInstructionOffset () const |
| int | absoluteOffset (int relativeOffset) const |
Additional Inherited Members | |
Public Types inherited from QQmlJSCompilePass | |
| enum | RegisterShortcuts { InvalidRegister = -1 , Accumulator = QV4::CallData::Accumulator , This = QV4::CallData::This , FirstArgument = QV4::CallData::OffsetCount } |
| using | SourceLocationTable = QV4::Compiler::Context::SourceLocationTable |
| using | VirtualRegisters = QFlatMap< int, VirtualRegister > |
| using | InstructionAnnotations = QFlatMap< int, InstructionAnnotation > |
Protected Types inherited from QV4::Moth::ByteCodeHandler | |
| enum | Verdict { ProcessInstruction , SkipInstruction } |
Static Protected Member Functions inherited from QQmlJSCompilePass | |
| static bool | instructionManipulatesContext (QV4::Moth::Instr::Type type) |
Protected Attributes inherited from QQmlJSCompilePass | |
| const QV4::Compiler::JSUnitGenerator * | m_jsUnitGenerator = nullptr |
| const QQmlJSTypeResolver * | m_typeResolver = nullptr |
| QQmlJSLogger * | m_logger = nullptr |
| const Function * | m_function = nullptr |
| QQmlJS::DiagnosticMessage * | m_error = nullptr |
The QQmlJSStorageGeneralizer is a compile pass that changes all type annotations and the function signature to use a generic storage type like QVariant or QObject*. This is necessary if we cannot rely on the original type to be immediately accessible, for example because we cannot include its header.
QQmlJSStorageGeneralizer does not have to use the byte code at all but operates only on the annotations and the function description.
Definition at line 21 of file qqmljsstoragegeneralizer_p.h.
|
inline |
Definition at line 24 of file qqmljsstoragegeneralizer_p.h.
|
inlineoverrideprotectedvirtual |
Implements QV4::Moth::ByteCodeHandler.
Definition at line 35 of file qqmljsstoragegeneralizer_p.h.
| QQmlJSCompilePass::InstructionAnnotations QQmlJSStorageGeneralizer::run | ( | InstructionAnnotations | annotations, |
| Function * | function, | ||
| QQmlJS::DiagnosticMessage * | error | ||
| ) |
Definition at line 22 of file qqmljsstoragegeneralizer.cpp.
References arg, argument, QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::begin(), QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::end(), error, function, QQmlJSTypeResolver::generalizeType(), QQmlJSTypeResolver::genericType(), i, j, QQmlJSCompilePass::m_error, QQmlJSCompilePass::m_typeResolver, Q_ASSERT, QStringLiteral, QQmlJSCompilePass::setError(), and QQmlJSTypeResolver::Yes.
Here is the call graph for this function:
|
inlineoverrideprotectedvirtual |
Implements QV4::Moth::ByteCodeHandler.
Definition at line 34 of file qqmljsstoragegeneralizer_p.h.
References QV4::Moth::ByteCodeHandler::SkipInstruction.