diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-09-01 13:11:00 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-05 20:26:42 +0200 |
commit | c5694ba5739527c016893079ef659fa8d19161e8 (patch) | |
tree | 2db13e88045d01adde48cde19eadca6cd0bdbb79 /src/qml/compiler/qv4isel_moth.cpp | |
parent | 87ccf530772caa5d388d97b556183fb20930ef38 (diff) |
Make it possible to supply an external JS unit generator to the isel
This is needed for QML unit generation, when we share the JS generator
for QML types/strings and JS code.
Change-Id: I50f0c1fa6721d6e3e59417c6c256c82aec124e8f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4isel_moth.cpp')
-rw-r--r-- | src/qml/compiler/qv4isel_moth.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp index 3e7b1911e9..bef2f64c3e 100644 --- a/src/qml/compiler/qv4isel_moth.cpp +++ b/src/qml/compiler/qv4isel_moth.cpp @@ -188,8 +188,8 @@ private: } }; -InstructionSelection::InstructionSelection(QV4::ExecutableAllocator *execAllocator, V4IR::Module *module) - : EvalInstructionSelection(execAllocator, module) +InstructionSelection::InstructionSelection(QV4::ExecutableAllocator *execAllocator, V4IR::Module *module, QV4::Compiler::JSUnitGenerator *jsGenerator) + : EvalInstructionSelection(execAllocator, module, jsGenerator) , _function(0) , _block(0) , _codeStart(0) @@ -276,7 +276,7 @@ void InstructionSelection::run(V4IR::Function *function) } } - registerLineNumberMapping(_function, lineNumberMappings); + jsGenerator->registerLineNumberMapping(_function, lineNumberMappings); // TODO: patch stack size (the push instruction) patchJumpAddresses(); @@ -300,7 +300,8 @@ void InstructionSelection::run(V4IR::Function *function) QV4::CompiledData::CompilationUnit *InstructionSelection::backendCompileStep() { - compilationUnit->data = generateUnit(); + compilationUnit->data = jsGenerator->generateUnit(); + compilationUnit->ownsData = true; compilationUnit->codeRefs.resize(irModule->functions.size()); int i = 0; foreach (V4IR::Function *irFunction, irModule->functions) |