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::Function Struct Reference

#include <qv4function_p.h>

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

Classes

struct  AOTCompiledFunction
 
struct  JSTypedFunction
 

Public Types

enum  Kind : quint8 { JsUntyped , JsTyped , AotCompiled , Eval }
 
typedef ReturnedValue(* JittedCode) (CppStackFrame *, ExecutionEngine *)
 
typedef void(* AotCompiledCode) (const QQmlPrivate::AOTCompiledContext *context, void **argv)
 

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 mark (QV4::MarkStack *ms)
 
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 (EngineBase *engine, 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 = nullptr
 
const char * codeData = nullptr
 
JSC::MacroAssemblerCodeRef * codeRef = nullptr
 
union { 
 
   void *   noFunction = nullptr 
 
   JSTypedFunction   jsTypedFunction 
 
   AOTCompiledFunction   aotCompiledFunction 
 
};  
 
union { 
 
   JittedCode   jittedCode = nullptr 
 
   AotCompiledCode   aotCompiledCode 
 
};  
 
QV4::WriteBarrier::Pointer< Heap::InternalClassinternalClass
 
int interpreterCallCount = 0
 
quint16 nFormals = 0
 
Kind kind = JsUntyped
 
bool detectedInjectedParameters = false
 
- Public Attributes inherited from QV4::FunctionData
WriteBarrier::HeapObjectWrapper< CompilationUnitRuntimeData, 1 > compilationUnit
 

Protected Member Functions

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

Detailed Description

Definition at line 46 of file qv4function_p.h.

Member Typedef Documentation

◆ AotCompiledCode

typedef void(* QV4::Function::AotCompiledCode) (const QQmlPrivate::AOTCompiledContext *context, void **argv)

Definition at line 82 of file qv4function_p.h.

◆ JittedCode

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

Definition at line 81 of file qv4function_p.h.

Member Enumeration Documentation

◆ Kind

Enumerator
JsUntyped 
JsTyped 
AotCompiled 
Eval 

Definition at line 99 of file qv4function_p.h.

Constructor & Destructor Documentation

◆ Function()

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

◆ ~Function()

Function::~Function ( )
protected

Definition at line 177 of file qv4function.cpp.

References AotCompiled, aotCompiledFunction, codeRef, QV4::destroyFunctionTable(), Eval, JsTyped, jsTypedFunction, JsUntyped, 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 QQmlJavaScriptExpression::evaluate(), and QQmlJavaScriptExpression::evaluate().

+ 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 Function(), and engine.

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

+ Here is the call graph for this function:
+ 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 120 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 123 of file qv4function_p.h.

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

Referenced by QV4::getSuperBase().

+ Here is the caller graph for this function:

◆ isClosureWrapper()

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

Definition at line 125 of file qv4function_p.h.

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

◆ isGenerator()

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

Definition at line 124 of file qv4function_p.h.

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

◆ isStrict()

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

Definition at line 122 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:

◆ mark()

void Function::mark ( QV4::MarkStack * ms)

Definition at line 94 of file qv4function.cpp.

References internalClass.

◆ name()

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

Definition at line 113 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 129 of file qv4function_p.h.

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

◆ prettyName()

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

Definition at line 245 of file qv4function.cpp.

References QString::number(), 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 119 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 256 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 197 of file qv4function.cpp.

References arg, 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, and QString::number().

+ Here is the call graph for this function:

Member Data Documentation

◆ [union]

union { ... } QV4::Function

◆ [union]

union { ... } QV4::Function

◆ aotCompiledCode

AotCompiledCode QV4::Function::aotCompiledCode

Definition at line 92 of file qv4function_p.h.

Referenced by Function().

◆ aotCompiledFunction

AOTCompiledFunction QV4::Function::aotCompiledFunction

Definition at line 87 of file qv4function_p.h.

Referenced by Function(), ~Function(), call(), and QQmlBinding::doUpdate().

◆ codeData

const char* QV4::Function::codeData = nullptr

Definition at line 78 of file qv4function_p.h.

◆ codeRef

JSC::MacroAssemblerCodeRef* QV4::Function::codeRef = nullptr

Definition at line 79 of file qv4function_p.h.

Referenced by ~Function().

◆ compiledFunction

const CompiledData::Function* QV4::Function::compiledFunction = nullptr

◆ detectedInjectedParameters

bool QV4::Function::detectedInjectedParameters = false

Definition at line 101 of file qv4function_p.h.

◆ internalClass

QV4::WriteBarrier::Pointer<Heap::InternalClass> QV4::Function::internalClass

Definition at line 96 of file qv4function_p.h.

Referenced by Function(), mark(), and updateInternalClass().

◆ interpreterCallCount

int QV4::Function::interpreterCallCount = 0

Definition at line 97 of file qv4function_p.h.

◆ jittedCode

JittedCode QV4::Function::jittedCode = nullptr

Definition at line 91 of file qv4function_p.h.

◆ jsTypedFunction

JSTypedFunction QV4::Function::jsTypedFunction

Definition at line 86 of file qv4function_p.h.

Referenced by Function(), ~Function(), and call().

◆ kind

Kind QV4::Function::kind = JsUntyped

◆ nFormals

quint16 QV4::Function::nFormals = 0

Definition at line 98 of file qv4function_p.h.

Referenced by Function(), and updateInternalClass().

◆ noFunction

void* QV4::Function::noFunction = nullptr

Definition at line 85 of file qv4function_p.h.


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