From 0d4657cc172d8b3dbd491da10ff88912603b0024 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 16 Aug 2013 15:57:50 +0200 Subject: Initial port of moth to the new compile data structures Change-Id: I2ead40c5c8c9b12b29c48c387ea424838d1f7d9e Reviewed-by: Lars Knoll --- src/qml/compiler/qv4isel_moth_p.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/qml/compiler/qv4isel_moth_p.h') diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h index 57fc9644ad..b32fba43f5 100644 --- a/src/qml/compiler/qv4isel_moth_p.h +++ b/src/qml/compiler/qv4isel_moth_p.h @@ -56,6 +56,15 @@ namespace Moth { class StackSlotAllocator; +struct CompilationUnit : public QV4::CompiledData::CompilationUnit +{ + virtual QV4::Function *linkBackendToEngine(QV4::ExecutionEngine *engine); + + QVector codeRefs; + +}; + + class Q_QML_EXPORT InstructionSelection: public V4IR::IRDecoder, public EvalInstructionSelection @@ -67,6 +76,8 @@ public: virtual void run(QV4::Function *vmFunction, V4IR::Function *function); protected: + virtual QV4::CompiledData::CompilationUnit *backendCompileStep(); + virtual void visitJump(V4IR::Jump *); virtual void visitCJump(V4IR::CJump *); virtual void visitRet(V4IR::Ret *); @@ -157,7 +168,7 @@ private: inline ptrdiff_t addInstruction(const InstrData &data); ptrdiff_t addInstructionHelper(Instr::Type type, Instr &instr); void patchJumpAddresses(); - uchar *squeezeCode() const; + QByteArray squeezeCode() const; QV4::String *identifier(const QString &s); @@ -175,6 +186,9 @@ private: StackSlotAllocator *_stackSlotAllocator; V4IR::Stmt *_currentStatement; + + CompilationUnit *compilationUnit; + QHash codeRefs; }; class Q_QML_EXPORT ISelFactory: public EvalISelFactory -- cgit v1.2.3 From 5ef4dd00f93d12a59cb01fa6ff44e2f01e3f71a1 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 16 Aug 2013 16:35:05 +0200 Subject: Ported identifiers in moth to use runtime strings Change-Id: I09f04994a2ebe631b12fa76b77a622711de31926 Reviewed-by: Lars Knoll --- src/qml/compiler/qv4isel_moth_p.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/qml/compiler/qv4isel_moth_p.h') diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h index b32fba43f5..4c0d96c4f5 100644 --- a/src/qml/compiler/qv4isel_moth_p.h +++ b/src/qml/compiler/qv4isel_moth_p.h @@ -170,8 +170,6 @@ private: void patchJumpAddresses(); QByteArray squeezeCode() const; - QV4::String *identifier(const QString &s); - V4IR::Function *_function; QV4::Function *_vmFunction; V4IR::BasicBlock *_block; -- cgit v1.2.3 From 33149123187fda2bc96bd0288502cca97016791d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 16 Aug 2013 21:25:39 +0200 Subject: Eliminate all vm functions on the isel side Change-Id: I7c0e50498c937ce554b019f98829fa8c5d96c18e Reviewed-by: Lars Knoll --- src/qml/compiler/qv4isel_moth_p.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/qml/compiler/qv4isel_moth_p.h') diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h index 4c0d96c4f5..b1755ef003 100644 --- a/src/qml/compiler/qv4isel_moth_p.h +++ b/src/qml/compiler/qv4isel_moth_p.h @@ -73,7 +73,7 @@ public: InstructionSelection(QV4::ExecutionEngine *engine, 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(); @@ -171,7 +171,6 @@ private: QByteArray squeezeCode() const; V4IR::Function *_function; - QV4::Function *_vmFunction; V4IR::BasicBlock *_block; V4IR::BasicBlock *_nextBlock; -- cgit v1.2.3 From 41cc5cca4ff95b59484ca66ba5e2eee10d95b7e1 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sat, 17 Aug 2013 20:48:56 +0200 Subject: Get rid of engine pointer in isel Change-Id: I58759712624713cd2215621dca4ccc86fa9a9194 Reviewed-by: Lars Knoll --- src/qml/compiler/qv4isel_moth_p.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/qml/compiler/qv4isel_moth_p.h') diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h index b1755ef003..484d7032de 100644 --- a/src/qml/compiler/qv4isel_moth_p.h +++ b/src/qml/compiler/qv4isel_moth_p.h @@ -70,7 +70,7 @@ class Q_QML_EXPORT InstructionSelection: public EvalInstructionSelection { public: - InstructionSelection(QV4::ExecutionEngine *engine, V4IR::Module *module); + InstructionSelection(QV4::ExecutableAllocator *execAllocator, V4IR::Module *module); ~InstructionSelection(); virtual void run(V4IR::Function *function); @@ -192,8 +192,8 @@ 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; } }; -- cgit v1.2.3 From 90aaff37be419ca1f1da40df64424c0d88bfaf19 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 19 Aug 2013 08:31:35 +0200 Subject: Cleanup: Determine the root/entry function in isel independent code Change-Id: I99004b872be9bd7d9dd0c798eb2d9bb4ddfa4cbd Reviewed-by: Lars Knoll --- src/qml/compiler/qv4isel_moth_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/compiler/qv4isel_moth_p.h') diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h index 484d7032de..7b701cf82d 100644 --- a/src/qml/compiler/qv4isel_moth_p.h +++ b/src/qml/compiler/qv4isel_moth_p.h @@ -58,7 +58,7 @@ class StackSlotAllocator; struct CompilationUnit : public QV4::CompiledData::CompilationUnit { - virtual QV4::Function *linkBackendToEngine(QV4::ExecutionEngine *engine); + virtual void linkBackendToEngine(QV4::ExecutionEngine *engine); QVector codeRefs; -- cgit v1.2.3