From a003a7916a7608a81075f058e35c5ca113d9ec08 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 21 Aug 2018 12:04:40 +0200 Subject: V4: Conform method_objectLiteral arguments to equal other methods This runtime function was the only one taking argc before arguments. Change-Id: If0b049697f7fcc2746e8d287193a5b1230a6ea56 Reviewed-by: Lars Knoll --- src/qml/jit/qv4baselinejit.cpp | 4 ++-- src/qml/jsruntime/qv4runtime.cpp | 2 +- src/qml/jsruntime/qv4runtimeapi_p.h | 2 +- src/qml/jsruntime/qv4vme_moth.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qml/jit/qv4baselinejit.cpp b/src/qml/jit/qv4baselinejit.cpp index bbbe0c69c5..6bc1ca6e45 100644 --- a/src/qml/jit/qv4baselinejit.cpp +++ b/src/qml/jit/qv4baselinejit.cpp @@ -800,8 +800,8 @@ void BaselineJIT::generate_DefineArray(int argc, int args) void BaselineJIT::generate_DefineObjectLiteral(int internalClassId, int argc, int args) { as->prepareCallWithArgCount(4); - as->passJSSlotAsArg(args, 3); - as->passInt32AsArg(argc, 2); + as->passInt32AsArg(argc, 3); + as->passJSSlotAsArg(args, 2); as->passInt32AsArg(internalClassId, 1); as->passEngineAsArg(0); BASELINEJIT_GENERATE_RUNTIME_CALL(Runtime::method_objectLiteral, CallResultDestination::InAccumulator); diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 66cd06ee1f..b576bb4d87 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -1677,7 +1677,7 @@ ReturnedValue Runtime::method_arrayLiteral(ExecutionEngine *engine, Value *value return engine->newArrayObject(values, length)->asReturnedValue(); } -ReturnedValue Runtime::method_objectLiteral(ExecutionEngine *engine, int classId, int argc, const QV4::Value *args) +ReturnedValue Runtime::method_objectLiteral(ExecutionEngine *engine, int classId, const QV4::Value *args, int argc) { Scope scope(engine); Scoped klass(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeClasses[classId]); diff --git a/src/qml/jsruntime/qv4runtimeapi_p.h b/src/qml/jsruntime/qv4runtimeapi_p.h index d64178a72f..06e8a8a960 100644 --- a/src/qml/jsruntime/qv4runtimeapi_p.h +++ b/src/qml/jsruntime/qv4runtimeapi_p.h @@ -148,7 +148,7 @@ struct ExceptionCheck { \ /* literals */ \ F(ReturnedValue, arrayLiteral, (ExecutionEngine *engine, Value *values, uint length)) \ - F(ReturnedValue, objectLiteral, (ExecutionEngine *engine, int classId, int argc, const Value *args)) \ + F(ReturnedValue, objectLiteral, (ExecutionEngine *engine, int classId, const Value *args, int argc)) \ F(ReturnedValue, createClass, (ExecutionEngine *engine, int classIndex, const Value &heritage, const Value *computedNames)) \ \ /* for-in, for-of and array destructuring */ \ diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index 5d95c8c2ab..77dc222df7 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -961,7 +961,7 @@ QV4::ReturnedValue VME::interpret(CppStackFrame *frame, ExecutionEngine *engine, MOTH_BEGIN_INSTR(DefineObjectLiteral) QV4::Value *arguments = stack + args; - acc = Runtime::method_objectLiteral(engine, internalClassId, argc, arguments); + acc = Runtime::method_objectLiteral(engine, internalClassId, arguments, argc); MOTH_END_INSTR(DefineObjectLiteral) MOTH_BEGIN_INSTR(CreateClass) -- cgit v1.2.3