diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-01-27 14:20:35 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-01-31 18:30:10 +0000 |
commit | 8b7d48d99c256182992104eaca5fd630bf41830b (patch) | |
tree | fd83907aaa9e0996b3bd3e341f70d96333448933 /src/qml/jit | |
parent | 998fe28408429814fa0cd69195d02192f88790f6 (diff) |
Make the JIT ISelFactory a template
That way qmldevtools can - in the future - instantiate that also for the
cross-compilation targets.
Change-Id: If15b195f24e54226dc4f2fd9f0ad6874f44cb5af
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jit')
-rw-r--r-- | src/qml/jit/qv4isel_masm.cpp | 10 | ||||
-rw-r--r-- | src/qml/jit/qv4isel_masm_p.h | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp index 69b1193b4a..dcb10f95a2 100644 --- a/src/qml/jit/qv4isel_masm.cpp +++ b/src/qml/jit/qv4isel_masm.cpp @@ -1825,11 +1825,19 @@ void InstructionSelection<JITAssembler>::visitCJumpEqual(IR::Binop *binop, IR::B _block, trueBlock, falseBlock); } -QQmlRefPointer<CompiledData::CompilationUnit> ISelFactory::createUnitForLoading() +template <typename JITAssembler> +QQmlRefPointer<CompiledData::CompilationUnit> ISelFactory<JITAssembler>::createUnitForLoading() { QQmlRefPointer<CompiledData::CompilationUnit> result; result.adopt(new JIT::CompilationUnit); return result; } +QT_BEGIN_NAMESPACE +namespace QV4 { namespace JIT { +template class Q_QML_EXPORT InstructionSelection<>; +template class Q_QML_EXPORT ISelFactory<>; +} } +QT_END_NAMESPACE + #endif // ENABLE(ASSEMBLER) diff --git a/src/qml/jit/qv4isel_masm_p.h b/src/qml/jit/qv4isel_masm_p.h index 1e5fde4502..6ae50c3260 100644 --- a/src/qml/jit/qv4isel_masm_p.h +++ b/src/qml/jit/qv4isel_masm_p.h @@ -292,13 +292,14 @@ private: RegisterInformation fpRegistersToSave; }; +template <typename JITAssembler = Assembler<DefaultAssemblerTargetConfiguration>> class Q_QML_EXPORT ISelFactory: public EvalISelFactory { public: ISelFactory() : EvalISelFactory(QStringLiteral("jit")) {} virtual ~ISelFactory() {} EvalInstructionSelection *create(QQmlEnginePrivate *qmlEngine, QV4::ExecutableAllocator *execAllocator, IR::Module *module, QV4::Compiler::JSUnitGenerator *jsGenerator) Q_DECL_OVERRIDE Q_DECL_FINAL - { return new InstructionSelection<>(qmlEngine, execAllocator, module, jsGenerator, this); } + { return new InstructionSelection<JITAssembler>(qmlEngine, execAllocator, module, jsGenerator, this); } bool jitCompileRegexps() const Q_DECL_OVERRIDE Q_DECL_FINAL { return true; } QQmlRefPointer<CompiledData::CompilationUnit> createUnitForLoading() Q_DECL_OVERRIDE Q_DECL_FINAL; |