diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-10-20 17:19:25 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-11-07 09:00:48 +0000 |
commit | e72306a6f2aeb2bddbb462c205db8fad2fb5a1a4 (patch) | |
tree | 3b83e1cead58d97c2b055283487500472ca7d698 /src/qml/jsruntime/qv4arrayobject.cpp | |
parent | bc5ff76e5afe6356bebb344c9a5d8b304e852f3c (diff) |
Further cleanup JSCallData
Avoid allocations on the JS stack if possible
Change-Id: I344cd6dceb6264314f9d22c94db22b22d1d24d14
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4arrayobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4arrayobject.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp index eef9ac0820..206e3a9fc3 100644 --- a/src/qml/jsruntime/qv4arrayobject.cpp +++ b/src/qml/jsruntime/qv4arrayobject.cpp @@ -199,7 +199,7 @@ ReturnedValue ArrayPrototype::method_find(const BuiltinFunction *b, CallData *ca THROW_TYPE_ERROR(); JSCallData jsCallData(scope, 3); - jsCallData->thisObject = callData->argument(1); + *jsCallData->thisObject = callData->argument(1); ScopedValue v(scope); ScopedValue result(scope); @@ -235,7 +235,7 @@ ReturnedValue ArrayPrototype::method_findIndex(const BuiltinFunction *b, CallDat THROW_TYPE_ERROR(); JSCallData jsCallData(scope, 3); - jsCallData->thisObject = callData->argument(1); + *jsCallData->thisObject = callData->argument(1); ScopedValue v(scope); ScopedValue result(scope); @@ -794,7 +794,7 @@ ReturnedValue ArrayPrototype::method_every(const BuiltinFunction *b, CallData *c ScopedValue r(scope); ScopedValue v(scope); JSCallData jsCallData(scope, 3); - jsCallData->thisObject = callData->argument(1); + *jsCallData->thisObject = callData->argument(1); bool ok = true; for (uint k = 0; ok && k < len; ++k) { @@ -828,7 +828,7 @@ ReturnedValue ArrayPrototype::method_some(const BuiltinFunction *b, CallData *ca ScopedValue v(scope); ScopedValue result(scope); JSCallData jsCallData(scope, 3); - jsCallData->thisObject = callData->argument(1); + *jsCallData->thisObject = callData->argument(1); for (uint k = 0; k < len; ++k) { bool exists; @@ -861,7 +861,7 @@ ReturnedValue ArrayPrototype::method_forEach(const BuiltinFunction *b, CallData ScopedValue v(scope); JSCallData jsCallData(scope, 3); - jsCallData->thisObject = callData->argument(1); + *jsCallData->thisObject = callData->argument(1); for (uint k = 0; k < len; ++k) { bool exists; @@ -897,7 +897,7 @@ ReturnedValue ArrayPrototype::method_map(const BuiltinFunction *b, CallData *cal ScopedValue v(scope); ScopedValue mapped(scope); JSCallData jsCallData(scope, 3); - jsCallData->thisObject = callData->argument(1); + *jsCallData->thisObject = callData->argument(1); for (uint k = 0; k < len; ++k) { bool exists; @@ -933,7 +933,7 @@ ReturnedValue ArrayPrototype::method_filter(const BuiltinFunction *b, CallData * ScopedValue selected(scope); ScopedValue v(scope); JSCallData jsCallData(scope, 3); - jsCallData->thisObject = callData->argument(1); + *jsCallData->thisObject = callData->argument(1); uint to = 0; for (uint k = 0; k < len; ++k) { @@ -1039,7 +1039,7 @@ ReturnedValue ArrayPrototype::method_reduceRight(const BuiltinFunction *b, CallD } JSCallData jsCallData(scope, 4); - jsCallData->thisObject = Primitive::undefinedValue(); + *jsCallData->thisObject = Primitive::undefinedValue(); while (k > 0) { bool kPresent; |