: EvalInstructionSelection(engine, module)
, _block(0)
, _function(0)
+ , _vmFunction(0)
, _asm(0)
{
}
void InstructionSelection::run(VM::Function *vmFunction, IR::Function *function)
{
qSwap(_function, function);
+ qSwap(_vmFunction, vmFunction);
Assembler* oldAssembler = _asm;
_asm = new Assembler(_function);
#endif
_asm->ret();
- _asm->link(vmFunction);
+ _asm->link(_vmFunction);
+ qSwap(_vmFunction, vmFunction);
qSwap(_function, function);
delete _asm;
_asm = oldAssembler;
{
Value v = Value::fromObject(engine()->newRegExpObject(*sourceRegexp->value,
sourceRegexp->flags));
+ _vmFunction->generatedValues.append(v);
_asm->storeValue(v, targetTemp);
}
roots.append(it->object);
}
+ for (int i = 0; i < m_d->engine->functions.size(); ++i) {
+ Function* f = m_d->engine->functions.at(i);
+ for (int k = 0; k < f->generatedValues.count(); ++k)
+ add(roots, f->generatedValues.at(k));
+ }
+
collectRootsOnStack(roots);
}