aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4isel_moth_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-08-16 15:57:50 +0200
committerLars Knoll <lars.knoll@digia.com>2013-08-16 19:13:02 +0200
commit0d4657cc172d8b3dbd491da10ff88912603b0024 (patch)
tree4cdaa5e7252555a06e45f7d4f73ac6d256659f3a /src/qml/compiler/qv4isel_moth_p.h
parent75cc05fcf472453fc33b262c70af46344adff666 (diff)
Initial port of moth to the new compile data structures
Change-Id: I2ead40c5c8c9b12b29c48c387ea424838d1f7d9e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4isel_moth_p.h')
-rw-r--r--src/qml/compiler/qv4isel_moth_p.h16
1 files changed, 15 insertions, 1 deletions
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<QByteArray> 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<Instr> &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<V4IR::Function *, QByteArray> codeRefs;
};
class Q_QML_EXPORT ISelFactory: public EvalISelFactory