diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-03-12 14:57:24 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-03-17 13:10:16 +0100 |
commit | b0e9c83f99aa7090c82b7c55894f5e264b74608a (patch) | |
tree | 39a11795b7d17483ce05be5b23c380864eb9bb29 /src/qml/jsruntime/qv4runtime.cpp | |
parent | 2fab46e711abfc04edd1791d050722d1fbfbc7d2 (diff) |
Don't store the scope in JSCallData
We only need it when generating CallData, or when filling in any
thisObject or arguments that weren't provided. Provide a constructor
that expects thisObject and arguments to be pre-allocated and one that
allocates them in a scope passed as argument.
Change-Id: Iddfba63f4dbc5b09e2b33fb22a94eea88f515902
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 393f99dd8f..2ea54a3512 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -802,7 +802,7 @@ ReturnedValue Runtime::GetIterator::call(ExecutionEngine *engine, const Value &i ScopedFunctionObject f(scope, o->get(engine->symbol_iterator())); if (!f) return engine->throwTypeError(); - JSCallData cData(scope, 0, nullptr, o); + JSCallData cData(o, scope.alloc(0), 0); ScopedObject it(scope, f->call(cData)); if (engine->hasException) return Encode::undefined(); @@ -825,7 +825,7 @@ ReturnedValue Runtime::IteratorNext::call(ExecutionEngine *engine, const Value & engine->throwTypeError(); return Encode(true); } - JSCallData cData(scope, 0, nullptr, &iterator); + JSCallData cData(&iterator, scope.alloc(0), 0); ScopedObject o(scope, f->call(cData)); if (scope.hasException()) return Encode(true); |