#include <qv4isel_p.h>
#include <qv4engine_p.h>
-QV4::Compiler::JSUnitGenerator::JSUnitGenerator(QV4::ExecutionEngine *engine, QQmlJS::V4IR::Module *module)
+QV4::Compiler::JSUnitGenerator::JSUnitGenerator(QQmlJS::V4IR::Module *module)
: irModule(module)
, stringDataSize(0)
, jsClassDataSize(0)
namespace Compiler {
struct JSUnitGenerator {
- JSUnitGenerator(QV4::ExecutionEngine *engine, QQmlJS::V4IR::Module *module);
+ JSUnitGenerator(QQmlJS::V4IR::Module *module);
QQmlJS::V4IR::Module *irModule;
return codeRef;
}
-InstructionSelection::InstructionSelection(QV4::ExecutionEngine *engine, V4IR::Module *module)
- : EvalInstructionSelection(engine, module)
+InstructionSelection::InstructionSelection(QV4::ExecutableAllocator *execAllocator, V4IR::Module *module)
+ : EvalInstructionSelection(execAllocator, module)
, _block(0)
, _function(0)
, _as(0)
qSwap(_function, function);
qSwap(_reentryBlocks, reentryBlocks);
Assembler* oldAssembler = _as;
- _as = new Assembler(this, _function, engine()->executableAllocator);
+ _as = new Assembler(this, _function, executableAllocator);
V4IR::Optimizer opt(_function);
opt.run();
public EvalInstructionSelection
{
public:
- InstructionSelection(QV4::ExecutionEngine *engine, V4IR::Module *module);
+ InstructionSelection(QV4::ExecutableAllocator *execAllocator, V4IR::Module *module);
~InstructionSelection();
virtual void run(V4IR::Function *function);
{
public:
virtual ~ISelFactory() {}
- virtual EvalInstructionSelection *create(QV4::ExecutionEngine *engine, V4IR::Module *module)
- { return new InstructionSelection(engine, module); }
+ virtual EvalInstructionSelection *create(QV4::ExecutableAllocator *execAllocator, V4IR::Module *module)
+ { return new InstructionSelection(execAllocator, module); }
virtual bool jitCompileRegexps() const
{ return true; }
};
}
};
-InstructionSelection::InstructionSelection(QV4::ExecutionEngine *engine, V4IR::Module *module)
- : EvalInstructionSelection(engine, module)
+InstructionSelection::InstructionSelection(QV4::ExecutableAllocator *execAllocator, V4IR::Module *module)
+ : EvalInstructionSelection(execAllocator, module)
, _function(0)
, _block(0)
, _codeStart(0)
public EvalInstructionSelection
{
public:
- InstructionSelection(QV4::ExecutionEngine *engine, V4IR::Module *module);
+ InstructionSelection(QV4::ExecutableAllocator *execAllocator, V4IR::Module *module);
~InstructionSelection();
virtual void run(V4IR::Function *function);
{
public:
virtual ~ISelFactory() {}
- virtual EvalInstructionSelection *create(QV4::ExecutionEngine *engine, V4IR::Module *module)
- { return new InstructionSelection(engine, module); }
+ virtual EvalInstructionSelection *create(QV4::ExecutableAllocator *execAllocator, V4IR::Module *module)
+ { return new InstructionSelection(execAllocator, module); }
virtual bool jitCompileRegexps() const
{ return false; }
};
using namespace QQmlJS;
using namespace QQmlJS::V4IR;
-EvalInstructionSelection::EvalInstructionSelection(QV4::ExecutionEngine *engine, Module *module)
- : _engine(engine)
- , useFastLookups(true)
- , jsUnitGenerator(engine, module)
+EvalInstructionSelection::EvalInstructionSelection(QV4::ExecutableAllocator *execAllocator, Module *module)
+ : useFastLookups(true)
+ , executableAllocator(execAllocator)
+ , jsUnitGenerator(module)
{
- assert(engine);
+ assert(execAllocator);
assert(module);
}
QT_BEGIN_NAMESPACE
namespace QV4 {
-struct ExecutionEngine;
+struct ExecutableAllocator;
struct Function;
}
class Q_QML_EXPORT EvalInstructionSelection
{
public:
- EvalInstructionSelection(QV4::ExecutionEngine *engine, V4IR::Module *module);
+ EvalInstructionSelection(QV4::ExecutableAllocator *execAllocator, V4IR::Module *module);
virtual ~EvalInstructionSelection() = 0;
QV4::CompiledData::CompilationUnit *compile();
int registerJSClass(QQmlJS::V4IR::ExprList *args) { return jsUnitGenerator.registerJSClass(args); }
protected:
- QV4::ExecutionEngine *engine() const { return _engine; }
virtual void run(V4IR::Function *function) = 0;
virtual QV4::CompiledData::CompilationUnit *backendCompileStep() = 0;
-private:
- QV4::ExecutionEngine *_engine;
protected:
bool useFastLookups;
+ QV4::ExecutableAllocator *executableAllocator;
QV4::Compiler::JSUnitGenerator jsUnitGenerator;
};
{
public:
virtual ~EvalISelFactory() = 0;
- virtual EvalInstructionSelection *create(QV4::ExecutionEngine *engine, V4IR::Module *module) = 0;
+ virtual EvalInstructionSelection *create(QV4::ExecutableAllocator *execAllocator, V4IR::Module *module) = 0;
virtual bool jitCompileRegexps() const = 0;
};
QQmlJS::Codegen cg(v4->current, f->strictMode);
cg(QString(), function, fe, &module);
- QScopedPointer<QQmlJS::EvalInstructionSelection> isel(v4->iselFactory->create(v4, &module));
+ QScopedPointer<QQmlJS::EvalInstructionSelection> isel(v4->iselFactory->create(v4->executableAllocator, &module));
QV4::CompiledData::CompilationUnit *compilationUnit = isel->compile();
QV4::Function *vmf = compilationUnit->linkToEngine(v4);
Codegen cg(scope, strictMode);
cg(sourceFile, sourceCode, program, &module,
parseAsBinding ? QQmlJS::Codegen::QmlBinding : QQmlJS::Codegen::EvalCode, inheritedLocals);
- QScopedPointer<EvalInstructionSelection> isel(v4->iselFactory->create(v4, &module));
+ QScopedPointer<EvalInstructionSelection> isel(v4->iselFactory->create(v4->executableAllocator, &module));
if (inheritContext)
isel->setUseFastLookups(false);
QV4::CompiledData::CompilationUnit *compilationUnit = isel->compile();