diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-10-20 09:32:51 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-11-07 07:24:25 +0000 |
commit | 9ac383f8a5c33b1dba2e5226ebe8d540fcf2cb34 (patch) | |
tree | 269919a0b77854e0ae23121926c2882a8ba6fb38 /src/qml/jsruntime/qv4jscall_p.h | |
parent | 957de0c8fb109ad6938d7a8673164cc94f346ecc (diff) |
Move the construction of the JSCall frame into the runtime
The VME shouldn't have to care about this part
Change-Id: I9e49353dce29912f5a222b7ed1b42ace2aa8cebd
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4jscall_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4jscall_p.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4jscall_p.h b/src/qml/jsruntime/qv4jscall_p.h index 18dfdc102b..bf85d75fdf 100644 --- a/src/qml/jsruntime/qv4jscall_p.h +++ b/src/qml/jsruntime/qv4jscall_p.h @@ -93,6 +93,18 @@ struct JSCall { ptr->setArgc(argc); memcpy(ptr->args, argv, argc*sizeof(Value)); } + JSCall(const Scope &scope, ReturnedValue function, Value *argv, int argc, Value *thisObject = 0) + { + int size = int(offsetof(QV4::CallData, args)/sizeof(QV4::Value)) + argc; + ptr = reinterpret_cast<CallData *>(scope.engine->jsStackTop); + scope.engine->jsStackTop += size; + ptr->function = function; + ptr->context = Encode::undefined(); + ptr->accumulator = Encode::undefined(); + ptr->thisObject = thisObject ? thisObject->asReturnedValue() : Encode::undefined(); + ptr->setArgc(argc); + memcpy(ptr->args, argv, argc*sizeof(Value)); + } CallData *operator->() { return ptr; |