From ee430036fbc32ccb1e026faa0582f1fba7dd0e58 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 16 Jan 2013 16:55:42 +0100 Subject: [PATCH] Changed signature of constructActivationProperty. Change-Id: Ic4aa2b85dec0a732382dd5ae5a7e37d54476db3a Reviewed-by: Simon Hausmann --- moth/qv4isel_moth.cpp | 8 +++++--- moth/qv4isel_moth_p.h | 2 +- qv4isel_llvm.cpp | 4 +++- qv4isel_llvm_p.h | 2 +- qv4isel_masm.cpp | 7 +++---- qv4isel_masm_p.h | 2 +- qv4isel_p.cpp | 4 ++-- qv4isel_p.h | 2 +- 8 files changed, 17 insertions(+), 14 deletions(-) diff --git a/moth/qv4isel_moth.cpp b/moth/qv4isel_moth.cpp index db5d774..50c4c2b 100644 --- a/moth/qv4isel_moth.cpp +++ b/moth/qv4isel_moth.cpp @@ -353,11 +353,13 @@ void InstructionSelection::callProperty(IR::Call *c, IR::Temp *result) addInstruction(call); } -void InstructionSelection::constructActivationProperty(IR::New *call, IR::Temp *result) +void InstructionSelection::constructActivationProperty(IR::Name *func, + IR::ExprList *args, + IR::Temp *result) { Instruction::CreateActivationProperty create; - create.name = engine()->newString(*call->base->asName()->id); - prepareCallArgs(call->args, create.argc, create.args); + create.name = engine()->newString(*func->id); + prepareCallArgs(args, create.argc, create.args); create.targetTempIndex = result->index; addInstruction(create); } diff --git a/moth/qv4isel_moth_p.h b/moth/qv4isel_moth_p.h index 9a893a2..f02914f 100644 --- a/moth/qv4isel_moth_p.h +++ b/moth/qv4isel_moth_p.h @@ -47,7 +47,7 @@ protected: virtual void callBuiltinDefineProperty(IR::Temp *object, const QString &name, IR::Temp *value); virtual void callValue(IR::Call *c, IR::Temp *result); virtual void callProperty(IR::Call *c, IR::Temp *result); - virtual void constructActivationProperty(IR::New *call, IR::Temp *result); + virtual void constructActivationProperty(IR::Name *func, IR::ExprList *args, IR::Temp *result); virtual void constructProperty(IR::New *call, IR::Temp *result); virtual void constructValue(IR::New *call, IR::Temp *result); virtual void loadThisObject(IR::Temp *temp); diff --git a/qv4isel_llvm.cpp b/qv4isel_llvm.cpp index cc39ed8..a4a20a5 100644 --- a/qv4isel_llvm.cpp +++ b/qv4isel_llvm.cpp @@ -462,7 +462,9 @@ void InstructionSelection::callProperty(IR::Call *c, IR::Temp *temp) Q_UNREACHABLE(); } -void InstructionSelection::constructActivationProperty(IR::New *call, IR::Temp *result) +void InstructionSelection::constructActivationProperty(IR::Name *func, + IR::ExprList *args, + IR::Temp *result) { // TODO assert(!"TODO!"); diff --git a/qv4isel_llvm_p.h b/qv4isel_llvm_p.h index c41eead..777bfcd 100644 --- a/qv4isel_llvm_p.h +++ b/qv4isel_llvm_p.h @@ -93,7 +93,7 @@ public: // methods from InstructionSelection: virtual void callBuiltinDefineProperty(IR::Temp *object, const QString &name, IR::Temp *value); virtual void callValue(IR::Call *c, IR::Temp *temp); virtual void callProperty(IR::Call *c, IR::Temp *temp); - virtual void constructActivationProperty(IR::New *call, IR::Temp *result); + virtual void constructActivationProperty(IR::Name *func, IR::ExprList *args, IR::Temp *result); virtual void constructProperty(IR::New *call, IR::Temp *result); virtual void constructValue(IR::New *call, IR::Temp *result); virtual void loadThisObject(IR::Temp *temp); diff --git a/qv4isel_masm.cpp b/qv4isel_masm.cpp index cbaf24c..73a8c62 100644 --- a/qv4isel_masm.cpp +++ b/qv4isel_masm.cpp @@ -735,12 +735,11 @@ String *InstructionSelection::identifier(const QString &s) return engine()->identifier(s); } -void InstructionSelection::constructActivationProperty(IR::New *call, IR::Temp *result) +void InstructionSelection::constructActivationProperty(IR::Name *func, IR::ExprList *args, IR::Temp *result) { - IR::Name *baseName = call->base->asName(); - assert(baseName != 0); + assert(func != 0); - callRuntimeMethod(result, __qmljs_construct_activation_property, call->base, call->args); + callRuntimeMethod(result, __qmljs_construct_activation_property, func, args); } void InstructionSelection::constructProperty(IR::New *call, IR::Temp *result) diff --git a/qv4isel_masm_p.h b/qv4isel_masm_p.h index bf78cfc..6bc0420 100644 --- a/qv4isel_masm_p.h +++ b/qv4isel_masm_p.h @@ -722,7 +722,7 @@ protected: } VM::String *identifier(const QString &s); - virtual void constructActivationProperty(IR::New *call, IR::Temp *result); + virtual void constructActivationProperty(IR::Name *func, IR::ExprList *args, IR::Temp *result); virtual void constructProperty(IR::New *ctor, IR::Temp *result); virtual void constructValue(IR::New *call, IR::Temp *result); diff --git a/qv4isel_p.cpp b/qv4isel_p.cpp index 42ffbcf..1f564ef 100644 --- a/qv4isel_p.cpp +++ b/qv4isel_p.cpp @@ -98,8 +98,8 @@ void InstructionSelection::visitMove(IR::Move *s) initClosure(clos, t); return; } else if (IR::New *ctor = s->source->asNew()) { - if (ctor->base->asName()) { - constructActivationProperty(ctor, t); + if (Name *func = ctor->base->asName()) { + constructActivationProperty(func, ctor->args, t); return; } else if (ctor->base->asMember()) { constructProperty(ctor, t); diff --git a/qv4isel_p.h b/qv4isel_p.h index 810443c..ca5eb69 100644 --- a/qv4isel_p.h +++ b/qv4isel_p.h @@ -103,7 +103,7 @@ public: // to implement by subclasses: virtual void callBuiltinDefineProperty(IR::Temp *object, const QString &name, IR::Temp *value) = 0; virtual void callValue(IR::Call *c, IR::Temp *temp) = 0; virtual void callProperty(IR::Call *c, IR::Temp *temp) = 0; - virtual void constructActivationProperty(IR::New *call, IR::Temp *result) = 0; + virtual void constructActivationProperty(IR::Name *func, IR::ExprList *args, IR::Temp *result) = 0; virtual void constructProperty(IR::New *ctor, IR::Temp *result) = 0; virtual void constructValue(IR::New *call, IR::Temp *result) = 0; virtual void loadThisObject(IR::Temp *temp) = 0; -- 2.7.4