diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-09 16:02:55 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-10 08:19:59 +0000 |
commit | 6a91dcba2e4fa85dc345c2d403c757ab7676e28c (patch) | |
tree | 502b483cd437f4a1a039717af0a59e493d40f7a2 /src/qml/jsruntime/qv4function_p.h | |
parent | 5571b666e6b9534a55347adcd249fa07b2e25c01 (diff) |
Always create a valid CallData object for interpreter calls
This will allow removing a few more special cases and to simplify
the code further.
Change-Id: I3a958e9f68e3c103ea4f2ee6825f893e5931b11d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4function_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4function_p.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h index 0976d22550..750db8c496 100644 --- a/src/qml/jsruntime/qv4function_p.h +++ b/src/qml/jsruntime/qv4function_p.h @@ -63,7 +63,15 @@ struct Q_QML_EXPORT Function { const CompiledData::Function *compiledFunction; CompiledData::CompilationUnit *compilationUnit; - typedef ReturnedValue (*Code)(Heap::ExecutionContext *c, Function *, const FunctionObject *); + ReturnedValue execute(Heap::ExecutionContext *c, CallData *callData, const FunctionObject *f = 0) { + return code(f, callData, c, this); + } + ReturnedValue call(Heap::ExecutionContext *c, CallData *callData, const FunctionObject *f = 0) { + return call(f, callData, c, this); + } + + + typedef ReturnedValue (*Code)(const FunctionObject *, CallData *, Heap::ExecutionContext *c, Function *); Code code; const uchar *codeData; @@ -95,6 +103,8 @@ struct Q_QML_EXPORT Function { return QQmlSourceLocation(sourceFile(), compiledFunction->location.line, compiledFunction->location.column); } +private: + static ReturnedValue call(const FunctionObject *f, CallData *callData, Heap::ExecutionContext *context, Function *function); }; |