Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QV4::Function Struct Reference

#include <qv4function_p.h>

+ Inheritance diagram for QV4::Function:
+ Collaboration diagram for QV4::Function:

Classes

struct  JSTypedFunction
 

Public Types

enum  Kind : quint8 { JsUntyped , JsTyped , AotCompiled , Eval }
 
typedef ReturnedValue(* JittedCode) (CppStackFrame *, ExecutionEngine *)
 

Public Member Functions

QV4::ExecutableCompilationUnitexecutableCompilationUnit () const
 
QV4::Heap::StringruntimeString (uint i) const
 
bool call (QObject *thisObject, void **a, const QMetaType *types, int argc, ExecutionContext *context)
 
ReturnedValue call (const Value *thisObject, const Value *argv, int argc, ExecutionContext *context)
 
void destroy ()
 
void updateInternalClass (ExecutionEngine *engine, const QList< QByteArray > &parameters)
 
Heap::Stringname () const
 
QString sourceFile () const
 
QUrl finalUrl () const
 
bool isStrict () const
 
bool isArrowFunction () const
 
bool isGenerator () const
 
bool isClosureWrapper () const
 
QQmlSourceLocation sourceLocation () const
 
FunctionnestedFunction () const
 
- Public Member Functions inherited from QV4::FunctionData
 FunctionData (ExecutableCompilationUnit *compilationUnit)
 

Static Public Member Functions

static Functioncreate (ExecutionEngine *engine, ExecutableCompilationUnit *unit, const CompiledData::Function *function, const QQmlPrivate::AOTCompiledFunction *aotFunction)
 
static QString prettyName (const Function *function, const void *address)
 

Public Attributes

const CompiledData::FunctioncompiledFunction
 
const char * codeData
 
JittedCode jittedCode
 
JSC::MacroAssemblerCodeRef * codeRef
 
union { 
 
   const QQmlPrivate::AOTCompiledFunction *   aotCompiledFunction = nullptr 
 
   const JSTypedFunction *   jsTypedFunction 
 
};  
 
Heap::InternalClassinternalClass
 
int interpreterCallCount = 0
 
quint16 nFormals
 
Kind kind = JsUntyped
 
bool detectedInjectedParameters = false
 
- Public Attributes inherited from QV4::FunctionData
CompiledData::CompilationUnitBasecompilationUnit
 

Protected Member Functions

 Function (ExecutionEngine *engine, ExecutableCompilationUnit *unit, const CompiledData::Function *function, const QQmlPrivate::AOTCompiledFunction *aotFunction)
 
 ~Function ()
 

Detailed Description

Definition at line 47 of file qv4function_p.h.

Member Typedef Documentation

◆ JittedCode

typedef ReturnedValue(* QV4::Function::JittedCode) (CppStackFrame *, ExecutionEngine *)

Definition at line 79 of file qv4function_p.h.

Member Enumeration Documentation

◆ Kind

Enumerator
JsUntyped 
JsTyped 
AotCompiled 
Eval 

Definition at line 91 of file qv4function_p.h.

Constructor & Destructor Documentation

◆ Function()

Function::Function ( ExecutionEngine engine,
ExecutableCompilationUnit unit,
const CompiledData::Function function,
const QQmlPrivate::AOTCompiledFunction aotFunction 
)
protected

Definition at line 100 of file qv4function.cpp.

References QQmlImport::AllowRecursion, QList< T >::append(), QV4::Function::JSTypedFunction::argumentTypes, QV4::Attr_NotConfigurable, QV4::EngineBase::Class_CallContext, QV4::FunctionData::compilationUnit, QQmlTypeData::compilationUnit(), compiledFunction, QQmlType::elementName(), engine, QV4::CompiledData::Function::formalsTable(), function, QQmlEnginePrivate::get(), QQmlTypeLoader::getType(), i, QV4::ExecutableCompilationUnit::ignoresFunctionSignature(), internalClass, QQmlType::isComposite(), QQmlType::isInlineComponentType(), QV4::isSpecificType(), QMetaType::isValid(), QQmlType::isValid(), JsTyped, jsTypedFunction, kind, QV4::CompiledData::Function::localsTable(), QQmlPropertyCacheCreatorBase::metaTypeForPropertyType(), QV4::CompiledData::Parameter::nameIndex, QV4::CompiledData::Function::nFormals, nFormals, QV4::CompiledData::Function::nLocals, QV4::ExecutableCompilationUnit::qmlType, QQmlMetaType::qmlType(), QV4::ExecutableCompilationUnit::qmlTypeForComponent(), QQmlTypeNameCache::query(), QV4::CompiledData::Function::returnType, QV4::Function::JSTypedFunction::returnType, QV4::CompiledData::CompilationUnitBase::runtimeStrings, QQmlType::sourceUrl(), QV4::CompiledData::CompilationUnit::stringAt(), QQmlType::typeId(), QQmlEnginePrivate::typeLoader, and QV4::ExecutableCompilationUnit::typeNameCache.

+ Here is the call graph for this function:

◆ ~Function()

Function::~Function ( )
protected

Definition at line 172 of file qv4function.cpp.

References codeRef, QV4::destroyFunctionTable(), JsTyped, jsTypedFunction, and kind.

+ Here is the call graph for this function:

Member Function Documentation

◆ call() [1/2]

ReturnedValue Function::call ( const Value thisObject,
const Value argv,
int  argc,
ExecutionContext context 
)

Definition at line 59 of file qv4function.cpp.

References AotCompiled, aotCompiledFunction, QV4::coerceAndCall(), compiledFunction, context, QV4::convertAndCall(), QV4::doCall(), JsTyped, jsTypedFunction, and kind.

+ Here is the call graph for this function:

◆ call() [2/2]

bool Function::call ( QObject thisObject,
void **  a,
const QMetaType types,
int  argc,
ExecutionContext context 
)

Definition at line 23 of file qv4function.cpp.

References AotCompiled, context, QV4::convertAndCall(), engine, QV4::Moth::VME::exec(), frame, and kind.

Referenced by QV4::EvalFunction::evalCall(), QQmlJavaScriptExpression::evaluate(), QQmlJavaScriptExpression::evaluate(), and QV4::Script::run().

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

◆ create()

Function * Function::create ( ExecutionEngine engine,
ExecutableCompilationUnit unit,
const CompiledData::Function function,
const QQmlPrivate::AOTCompiledFunction aotFunction 
)
static

Definition at line 82 of file qv4function.cpp.

References engine, and function.

Referenced by QV4::ExecutableCompilationUnit::linkToEngine().

+ Here is the caller graph for this function:

◆ destroy()

void Function::destroy ( )

Definition at line 89 of file qv4function.cpp.

◆ executableCompilationUnit()

QV4::ExecutableCompilationUnit * QV4::Function::executableCompilationUnit ( ) const
inline

Definition at line 61 of file qv4function_p.h.

Referenced by QQmlJavaScriptExpression::setupFunction().

+ Here is the caller graph for this function:

◆ finalUrl()

QUrl QV4::Function::finalUrl ( ) const
inline

Definition at line 110 of file qv4function_p.h.

Referenced by QV4::ExecutionEngine::resolvedUrl().

+ Here is the caller graph for this function:

◆ isArrowFunction()

bool QV4::Function::isArrowFunction ( ) const
inline

Definition at line 113 of file qv4function_p.h.

References QV4::CompiledData::Function::flags.

Referenced by QV4::FunctionObject::createScriptFunction(), and QV4::getSuperBase().

+ Here is the caller graph for this function:

◆ isClosureWrapper()

bool QV4::Function::isClosureWrapper ( ) const
inline

Definition at line 115 of file qv4function_p.h.

References QV4::CompiledData::Function::flags.

◆ isGenerator()

bool QV4::Function::isGenerator ( ) const
inline

Definition at line 114 of file qv4function_p.h.

References QV4::CompiledData::Function::flags.

Referenced by QV4::Runtime::Closure::call(), and QV4::Runtime::ObjectLiteral::call().

+ Here is the caller graph for this function:

◆ isStrict()

bool QV4::Function::isStrict ( ) const
inline

Definition at line 112 of file qv4function_p.h.

References QV4::CompiledData::Function::flags.

Referenced by QV4::Runtime::StoreProperty::call(), QV4::ExecutionContext::deleteProperty(), QV4::EvalFunction::evalCall(), and QJSEngine::evaluate().

+ Here is the caller graph for this function:

◆ name()

Heap::String * QV4::Function::name ( ) const
inline

Definition at line 103 of file qv4function_p.h.

References QV4::CompiledData::Function::nameIndex.

Referenced by QV4::CppStackFrame::function().

+ Here is the caller graph for this function:

◆ nestedFunction()

Function * QV4::Function::nestedFunction ( ) const
inline

Definition at line 119 of file qv4function_p.h.

References QV4::CompiledData::Function::nestedFunctionIndex.

◆ prettyName()

QString Function::prettyName ( const Function function,
const void address 
)
static

Definition at line 229 of file qv4function.cpp.

References QString::append(), function, QString::isEmpty(), QString::number(), QString::prepend(), and prettyName().

Referenced by prettyName().

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

◆ runtimeString()

QV4::Heap::String * QV4::Function::runtimeString ( uint  i) const
inline

Definition at line 67 of file qv4function_p.h.

References i.

◆ sourceFile()

QString QV4::Function::sourceFile ( ) const
inline

Definition at line 109 of file qv4function_p.h.

Referenced by QV4::CppStackFrame::source(), and sourceLocation().

+ Here is the caller graph for this function:

◆ sourceLocation()

QQmlSourceLocation Function::sourceLocation ( ) const

Definition at line 240 of file qv4function.cpp.

References QV4::CompiledData::Location::column(), compiledFunction, QV4::CompiledData::Location::line(), QV4::CompiledData::Function::location, and sourceFile().

Referenced by QQmlJavaScriptExpression::sourceLocation().

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

◆ updateInternalClass()

void Function::updateInternalClass ( ExecutionEngine engine,
const QList< QByteArray > &  parameters 
)

Definition at line 182 of file qv4function.cpp.

References QV4::Heap::InternalClass::addMember(), arg, QList< T >::at(), QV4::Attr_NotConfigurable, QV4::EngineBase::Class_CallContext, QV4::FunctionData::compilationUnit, compiledFunction, engine, QString::fromUtf8(), i, internalClass, j, QV4::CompiledData::Function::localsTable(), nFormals, QV4::CompiledData::Function::nLocals, QString::number(), QV4::CompiledData::CompilationUnitBase::runtimeStrings, and QList< T >::size().

Referenced by QQmlBoundSignal_callback().

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

Member Data Documentation

◆ [union]

union { ... } QV4::Function

◆ aotCompiledFunction

const QQmlPrivate::AOTCompiledFunction* QV4::Function::aotCompiledFunction = nullptr

Definition at line 83 of file qv4function_p.h.

Referenced by call(), QQmlBinding::doUpdate(), and QV4::ArrowFunction::virtualCall().

◆ codeData

const char* QV4::Function::codeData

Definition at line 77 of file qv4function_p.h.

Referenced by QV4::GeneratorFunction::virtualCall().

◆ codeRef

JSC::MacroAssemblerCodeRef* QV4::Function::codeRef

Definition at line 81 of file qv4function_p.h.

Referenced by ~Function().

◆ compiledFunction

◆ detectedInjectedParameters

bool QV4::Function::detectedInjectedParameters = false

Definition at line 93 of file qv4function_p.h.

◆ internalClass

Heap::InternalClass* QV4::Function::internalClass

Definition at line 88 of file qv4function_p.h.

Referenced by Function(), and updateInternalClass().

◆ interpreterCallCount

int QV4::Function::interpreterCallCount = 0

Definition at line 89 of file qv4function_p.h.

◆ jittedCode

JittedCode QV4::Function::jittedCode

Definition at line 80 of file qv4function_p.h.

◆ jsTypedFunction

const JSTypedFunction* QV4::Function::jsTypedFunction

Definition at line 84 of file qv4function_p.h.

Referenced by Function(), ~Function(), call(), and QV4::ArrowFunction::virtualCall().

◆ kind

◆ nFormals

quint16 QV4::Function::nFormals

Definition at line 90 of file qv4function_p.h.

Referenced by Function(), and updateInternalClass().


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