From: Erik Verbruggen Date: Sun, 3 Feb 2013 11:19:15 +0000 (+0100) Subject: MOTH: have the VM::Function hold on to regexps. X-Git-Tag: upstream/5.2.1~669^2~659^2~314 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9162f48ddb1a4f280b17bf40c32068dcc6f4dd89;p=platform%2Fupstream%2Fqtdeclarative.git MOTH: have the VM::Function hold on to regexps. When regexps were created, they were not added to the VM::Function's generatedValues, resulting in premature collection. Change-Id: Idac2202e3040c6311c6f1ceead641e51a8de9729 Reviewed-by: Lars Knoll --- diff --git a/src/v4/moth/qv4isel_moth.cpp b/src/v4/moth/qv4isel_moth.cpp index f3c5b6b..f31153a 100644 --- a/src/v4/moth/qv4isel_moth.cpp +++ b/src/v4/moth/qv4isel_moth.cpp @@ -400,11 +400,13 @@ void InstructionSelection::loadString(const QString &str, IR::Temp *targetTemp) void InstructionSelection::loadRegexp(IR::RegExp *sourceRegexp, IR::Temp *targetTemp) { + VM::Value v = VM::Value::fromObject(engine()->newRegExpObject( + *sourceRegexp->value, + sourceRegexp->flags)); + _vmFunction->generatedValues.append(v); + Instruction::LoadValue load; - load.value = Instr::Param::createValue( - VM::Value::fromObject(engine()->newRegExpObject( - *sourceRegexp->value, - sourceRegexp->flags))); + load.value = Instr::Param::createValue(v); load.result = getResultParam(targetTemp); addInstruction(load); } diff --git a/src/v4/moth/qv4vme_moth.cpp b/src/v4/moth/qv4vme_moth.cpp index a3ab1de..e9889fc 100644 --- a/src/v4/moth/qv4vme_moth.cpp +++ b/src/v4/moth/qv4vme_moth.cpp @@ -225,7 +225,7 @@ VM::Value VME::operator()(QQmlJS::VM::ExecutionContext *context, const uchar *co MOTH_END_INSTR(CallValue) MOTH_BEGIN_INSTR(CallProperty) - TRACE(property name, "%s", qPrintable(instr.name->toQString())); + TRACE(property name, "%s, args=%u, argc=%u", qPrintable(instr.name->toQString()), instr.args, instr.argc); Q_ASSERT(instr.args + instr.argc < stackSize); VM::Value *args = stack + instr.args; VALUE(instr.result) = __qmljs_call_property(context, VALUE(instr.base), instr.name, args, instr.argc);