diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-10-24 14:57:53 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-11-13 08:56:11 +0000 |
commit | 831ddc54932d2681712ca9fa3e94484ae11d59f7 (patch) | |
tree | 0cf4ad8756d9cae65f3c57f1c77c946eaf1f5749 /src/qml/jsruntime/qv4vme_moth_p.h | |
parent | d9b0878595e7ee2698ddc8c724657574d5fe4d4c (diff) |
Cut out one more C++ layer when doing JS function calls
Change-Id: I0e2ac30b7e6d77fe41deb84a97b0a7f220437c6a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4vme_moth_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth_p.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth_p.h b/src/qml/jsruntime/qv4vme_moth_p.h index 3a1e7b6637..dbf9ed3550 100644 --- a/src/qml/jsruntime/qv4vme_moth_p.h +++ b/src/qml/jsruntime/qv4vme_moth_p.h @@ -52,8 +52,6 @@ // #include <private/qv4global_p.h> -#include <private/qv4runtime_p.h> -#include <private/qv4instr_moth_p.h> QT_REQUIRE_CONFIG(qml_interpreter); @@ -65,7 +63,17 @@ namespace Moth { class VME { public: - static QV4::ReturnedValue exec(CallData *callData, QV4::Function *); + struct ExecData { + QV4::Function *function; + const QV4::ExecutionContext *scope; + }; + static inline + QV4::ReturnedValue exec(Function *v4Function, const Value *thisObject, const Value *argv, int argc, const ExecutionContext *context) { + ExecData data{v4Function, context}; + quintptr d = reinterpret_cast<quintptr>(&data) | 0x1; + return exec(reinterpret_cast<const FunctionObject *>(d), thisObject, argv, argc); + } + static QV4::ReturnedValue exec(const FunctionObject *fo, const Value *thisObject, const Value *argv, int argc); }; } // namespace Moth |