diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-08-20 16:54:29 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-08-20 16:54:29 +0200 |
commit | 461892e492e0bef399714557498380703b3e029b (patch) | |
tree | ad82e1ae8286bbe650b2ee19ad393a4ab8996bb1 /src/qml/compiler/qv4isel_moth_p.h | |
parent | a71e35a95c9f352db91fb82d8a564d01ba961341 (diff) | |
parent | 90aaff37be419ca1f1da40df64424c0d88bfaf19 (diff) |
Merge branch 'wip/v4' of ssh://codereview.qt-project.org/qt/qtdeclarative into dev
Conflicts:
src/qml/compiler/qv4codegen.cpp
src/qml/compiler/qv4codegen_p.h
src/qml/compiler/qv4isel_moth.cpp
src/qml/jsruntime/qv4context_p.h
src/qml/jsruntime/qv4functionobject.cpp
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4runtime_p.h
src/qml/jsruntime/qv4script.cpp
sync.profile
Change-Id: I1d785e2134bffac9553a1c16eed12816cbd1ad2c
Diffstat (limited to 'src/qml/compiler/qv4isel_moth_p.h')
-rw-r--r-- | src/qml/compiler/qv4isel_moth_p.h | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h index b6e4b43582..c88db6f759 100644 --- a/src/qml/compiler/qv4isel_moth_p.h +++ b/src/qml/compiler/qv4isel_moth_p.h @@ -56,17 +56,28 @@ namespace Moth { class StackSlotAllocator; +struct CompilationUnit : public QV4::CompiledData::CompilationUnit +{ + virtual void linkBackendToEngine(QV4::ExecutionEngine *engine); + + QVector<QByteArray> codeRefs; + +}; + + class Q_QML_EXPORT InstructionSelection: public V4IR::IRDecoder, public EvalInstructionSelection { public: - InstructionSelection(QV4::ExecutionEngine *engine, V4IR::Module *module); + InstructionSelection(QV4::ExecutableAllocator *execAllocator, V4IR::Module *module); ~InstructionSelection(); - virtual void run(QV4::Function *vmFunction, V4IR::Function *function); + virtual void run(V4IR::Function *function); protected: + virtual QV4::CompiledData::CompilationUnit *backendCompileStep(); + virtual void visitJump(V4IR::Jump *); virtual void visitCJump(V4IR::CJump *); virtual void visitRet(V4IR::Ret *); @@ -158,12 +169,9 @@ private: inline ptrdiff_t addInstruction(const InstrData<Instr> &data); ptrdiff_t addInstructionHelper(Instr::Type type, Instr &instr); void patchJumpAddresses(); - uchar *squeezeCode() const; - - QV4::String *identifier(const QString &s); + QByteArray squeezeCode() const; V4IR::Function *_function; - QV4::Function *_vmFunction; V4IR::BasicBlock *_block; V4IR::BasicBlock *_nextBlock; @@ -176,14 +184,17 @@ private: StackSlotAllocator *_stackSlotAllocator; V4IR::Stmt *_currentStatement; + + CompilationUnit *compilationUnit; + QHash<V4IR::Function *, QByteArray> codeRefs; }; class Q_QML_EXPORT ISelFactory: public EvalISelFactory { 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; } }; |