diff options
author | Ulf Hermann <[email protected]> | 2022-11-03 17:09:29 +0100 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2022-11-07 15:49:10 +0100 |
commit | 872e91612fd83de6dd1193014b5e2a0f5e8c30af (patch) | |
tree | 98eb22f6203a5b8f81e4149f919cac0f553c202c /src/qml/jsruntime/qv4runtime.cpp | |
parent | 0b7374fefa1abf08e956bc5d34008352144bd9ae (diff) |
Replace CallElement with separate instructions
We need to do the subscript lookup before generating the arguments since
the arguments may change the array.
Fixes: QTBUG-106708
Change-Id: Ia3a0dd34c6ed8d39e86ad20911a632d691826322
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 65fada93b5..cdbddcee69 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -1487,24 +1487,6 @@ ReturnedValue Runtime::CallPropertyLookup::call(ExecutionEngine *engine, const V return checkedResult(engine, static_cast<FunctionObject &>(f).call(&base, argv, argc)); } -ReturnedValue Runtime::CallElement::call(ExecutionEngine *engine, const Value &baseRef, const Value &index, Value *argv, int argc) -{ - const Value *base = &baseRef; - Scope scope(engine); - ScopedValue thisObject(scope, base->toObject(engine)); - base = thisObject; - - ScopedPropertyKey str(scope, index.toPropertyKey(engine)); - if (engine->hasException) - return Encode::undefined(); - - ScopedFunctionObject f(scope, static_cast<const Object *>(base)->get(str)); - if (!f) - return engine->throwTypeError(); - - return checkedResult(engine, f->call(base, argv, argc)); -} - ReturnedValue Runtime::CallValue::call(ExecutionEngine *engine, const Value &func, Value *argv, int argc) { if (!func.isFunctionObject()) @@ -2389,7 +2371,6 @@ QHash<const void *, const char *> Runtime::symbolTable() {symbol<CallName>(), "CallName" }, {symbol<CallProperty>(), "CallProperty" }, {symbol<CallPropertyLookup>(), "CallPropertyLookup" }, - {symbol<CallElement>(), "CallElement" }, {symbol<CallValue>(), "CallValue" }, {symbol<CallWithReceiver>(), "CallWithReceiver" }, {symbol<CallPossiblyDirectEval>(), "CallPossiblyDirectEval" }, |