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
QV4::Compiler::JSUnitGenerator Struct Reference

#include <qv4compiler_p.h>

+ Collaboration diagram for QV4::Compiler::JSUnitGenerator:

Classes

struct  MemberInfo
 

Public Types

enum  LookupMode { LookupForStorage , LookupForCall }
 
enum  GeneratorOption { GenerateWithStringTable , GenerateWithoutStringTable }
 

Public Member Functions

 JSUnitGenerator (Module *module)
 
int registerString (const QString &str)
 
int getStringId (const QString &string) const
 
QString stringForIndex (int index) const
 
int registerGetterLookup (const QString &name, LookupMode mode)
 
int registerGetterLookup (int nameIndex, LookupMode mode)
 
int registerSetterLookup (const QString &name)
 
int registerSetterLookup (int nameIndex)
 
int registerGlobalGetterLookup (int nameIndex, LookupMode mode)
 
int registerQmlContextPropertyGetterLookup (int nameIndex, LookupMode mode)
 
int lookupNameIndex (int index) const
 
QString lookupName (int index) const
 
int registerRegExp (QQmlJS::AST::RegExpLiteral *regexp)
 
int registerConstant (ReturnedValue v)
 
ReturnedValue constant (int idx) const
 
int registerJSClass (const QStringList &members)
 
int jsClassSize (int jsClassId) const
 
QString jsClassMember (int jsClassId, int member) const
 
int registerTranslation (const CompiledData::TranslationData &translation)
 
QV4::CompiledData::UnitgenerateUnit (GeneratorOption option=GenerateWithStringTable)
 
void writeFunction (char *f, Context *irFunction) const
 
void writeClass (char *f, const Class &c)
 
void writeTemplateObject (char *f, const TemplateObject &o)
 
void writeBlock (char *f, Context *irBlock) const
 

Static Public Member Functions

static void generateUnitChecksum (CompiledData::Unit *unit)
 

Public Attributes

StringTableGenerator stringTable
 
QString codeGeneratorName
 

Detailed Description

Definition at line 72 of file qv4compiler_p.h.

Member Enumeration Documentation

◆ GeneratorOption

Enumerator
GenerateWithStringTable 
GenerateWithoutStringTable 

Definition at line 108 of file qv4compiler_p.h.

◆ LookupMode

Enumerator
LookupForStorage 
LookupForCall 

Definition at line 73 of file qv4compiler_p.h.

Constructor & Destructor Documentation

◆ JSUnitGenerator()

QV4::Compiler::JSUnitGenerator::JSUnitGenerator ( Module * module)

Definition at line 113 of file qv4compiler.cpp.

References registerString().

+ Here is the call graph for this function:

Member Function Documentation

◆ constant()

QV4::ReturnedValue QV4::Compiler::JSUnitGenerator::constant ( int idx) const

Definition at line 195 of file qv4compiler.cpp.

Referenced by QQmlJSCodeGenerator::generate_LoadConst(), QQmlJSTypePropagator::generate_LoadConst(), QQmlJSCodeGenerator::generate_MoveConst(), and QQmlJSTypePropagator::generate_MoveConst().

+ Here is the caller graph for this function:

◆ generateUnit()

QV4::CompiledData::Unit * QV4::Compiler::JSUnitGenerator::generateUnit ( GeneratorOption option = GenerateWithStringTable)

Definition at line 252 of file qv4compiler.cpp.

References i, and request.

Referenced by QV4::Compiler::Codegen::generateCompilationUnit().

+ Here is the caller graph for this function:

◆ generateUnitChecksum()

void QV4::Compiler::JSUnitGenerator::generateUnitChecksum ( CompiledData::Unit * unit)
static

Definition at line 94 of file qv4compiler.cpp.

References checksum(), hash, QCryptographicHash::Md5, QV4::CompiledData::Unit::md5Checksum, Q_ASSERT, and QV4::CompiledData::Unit::unitSize.

Referenced by QmlIR::QmlUnitGenerator::generate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStringId()

int QV4::Compiler::JSUnitGenerator::getStringId ( const QString & string) const
inline

Definition at line 85 of file qv4compiler_p.h.

◆ jsClassMember()

QString QV4::Compiler::JSUnitGenerator::jsClassMember ( int jsClassId,
int member ) const

Definition at line 235 of file qv4compiler.cpp.

References jsClassMembersOffset, members(), and Q_ASSERT.

Referenced by QQmlJSCodeGenerator::generate_DefineObjectLiteral().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ jsClassSize()

int QV4::Compiler::JSUnitGenerator::jsClassSize ( int jsClassId) const

Definition at line 227 of file qv4compiler.cpp.

References QV4::CompiledData::JSClass::nMembers.

Referenced by QQmlJSCodeGenerator::generate_DefineObjectLiteral(), and QQmlJSTypePropagator::generate_DefineObjectLiteral().

+ Here is the caller graph for this function:

◆ lookupName()

◆ lookupNameIndex()

int QV4::Compiler::JSUnitGenerator::lookupNameIndex ( int index) const
inline

◆ registerConstant()

int QV4::Compiler::JSUnitGenerator::registerConstant ( QV4::ReturnedValue v)

Definition at line 186 of file qv4compiler.cpp.

Referenced by QV4::Compiler::Codegen::registerConstant(), QQmlTypeCompiler::registerConstant(), and QmlIR::IRBuilder::setBindingValue().

+ Here is the caller graph for this function:

◆ registerGetterLookup() [1/2]

int QV4::Compiler::JSUnitGenerator::registerGetterLookup ( const QString & name,
LookupMode mode )

Definition at line 120 of file qv4compiler.cpp.

Referenced by QV4::Compiler::Codegen::registerGetterLookup().

+ Here is the caller graph for this function:

◆ registerGetterLookup() [2/2]

int QV4::Compiler::JSUnitGenerator::registerGetterLookup ( int nameIndex,
LookupMode mode )

Definition at line 132 of file qv4compiler.cpp.

References lookupMode(), and QV4::CompiledData::Lookup::Type_Getter.

+ Here is the call graph for this function:

◆ registerGlobalGetterLookup()

int QV4::Compiler::JSUnitGenerator::registerGlobalGetterLookup ( int nameIndex,
LookupMode mode )

Definition at line 152 of file qv4compiler.cpp.

References lookupMode(), and QV4::CompiledData::Lookup::Type_GlobalGetter.

Referenced by QV4::Compiler::Codegen::registerGlobalGetterLookup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerJSClass()

int QV4::Compiler::JSUnitGenerator::registerJSClass ( const QStringList & members)

Definition at line 204 of file qv4compiler.cpp.

References QV4::CompiledData::JSClass::calculateSize(), jsClassMembersOffset, members(), QV4::CompiledData::JSClass::nMembers, and QV4::CompiledData::JSClassMember::set().

Referenced by QV4::Compiler::Codegen::visit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerQmlContextPropertyGetterLookup()

int QV4::Compiler::JSUnitGenerator::registerQmlContextPropertyGetterLookup ( int nameIndex,
LookupMode mode )

Definition at line 159 of file qv4compiler.cpp.

References lookupMode(), and QV4::CompiledData::Lookup::Type_QmlContextPropertyGetter.

Referenced by QV4::Compiler::Codegen::registerQmlContextPropertyGetterLookup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerRegExp()

int QV4::Compiler::JSUnitGenerator::registerRegExp ( QQmlJS::AST::RegExpLiteral * regexp)

◆ registerSetterLookup() [1/2]

int QV4::Compiler::JSUnitGenerator::registerSetterLookup ( const QString & name)

Definition at line 139 of file qv4compiler.cpp.

Referenced by QV4::Compiler::Codegen::registerSetterLookup().

+ Here is the caller graph for this function:

◆ registerSetterLookup() [2/2]

int QV4::Compiler::JSUnitGenerator::registerSetterLookup ( int nameIndex)

◆ registerString()

int QV4::Compiler::JSUnitGenerator::registerString ( const QString & str)
inline

Definition at line 84 of file qv4compiler_p.h.

References str.

Referenced by JSUnitGenerator(), QmlIR::ScriptDirectivesCollector::importFile(), QmlIR::ScriptDirectivesCollector::importModule(), QV4::Compiler::Codegen::registerString(), QmlIR::Document::registerString(), QQmlTypeCompiler::registerString(), and QmlIR::IRBuilder::tryGeneratingTranslationBinding().

+ Here is the caller graph for this function:

◆ registerTranslation()

int QV4::Compiler::JSUnitGenerator::registerTranslation ( const CompiledData::TranslationData & translation)

Definition at line 246 of file qv4compiler.cpp.

Referenced by QmlIR::IRBuilder::tryGeneratingTranslationBinding().

+ Here is the caller graph for this function:

◆ stringForIndex()

◆ writeBlock()

void QV4::Compiler::JSUnitGenerator::writeBlock ( char * f,
Context * irBlock ) const

Definition at line 602 of file qv4compiler.cpp.

References i, QV4::CompiledData::Block::localsOffset, QV4::CompiledData::Block::nLocals, qDebug, qEnvironmentVariableIsSet(), QtPrivate::roundUpToMultipleOf(), and QV4::CompiledData::Block::sizeOfLocalTemporalDeadZone.

+ Here is the call graph for this function:

◆ writeClass()

void QV4::Compiler::JSUnitGenerator::writeClass ( char * f,
const Class & c )

Definition at line 525 of file qv4compiler.cpp.

References QV4::CompiledData::Class::constructorFunction, QV4::CompiledData::Method::Getter, i, method, output, qDebug, qEnvironmentVariableIsSet(), and QV4::CompiledData::Method::Setter.

+ Here is the call graph for this function:

◆ writeFunction()

void QV4::Compiler::JSUnitGenerator::writeFunction ( char * f,
Context * irFunction ) const

◆ writeTemplateObject()

void QV4::Compiler::JSUnitGenerator::writeTemplateObject ( char * f,
const TemplateObject & o )

Definition at line 574 of file qv4compiler.cpp.

References i, qDebug, qEnvironmentVariableIsSet(), and QV4::CompiledData::TemplateObject::size.

+ Here is the call graph for this function:

Member Data Documentation

◆ codeGeneratorName

QString QV4::Compiler::JSUnitGenerator::codeGeneratorName

Definition at line 120 of file qv4compiler_p.h.

Referenced by QV4::Compiler::Codegen::Codegen().

◆ stringTable

StringTableGenerator QV4::Compiler::JSUnitGenerator::stringTable

The documentation for this struct was generated from the following files: