aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4script.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-06-12 10:27:54 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-06-19 12:50:37 +0000
commit56f29d005c2c6eb028e3ed2d1ef8edd6d03d1403 (patch)
treee8a2503ba9f50c7797e16eeb96e444617b54ec18 /src/qml/jsruntime/qv4script.cpp
parent6f2bdb816dc816461cf3888eb732f71904b6a7ab (diff)
Pass the JSUnitGenerator into the codegen
Allow registering all the required data to generate the proper compilationunit already in the codegenerator. Change-Id: I36345cc01927b3f8dc3ba6d91da175bd6abe124a Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4script.cpp')
-rw-r--r--src/qml/jsruntime/qv4script.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index 62145f36cc..c0b38bd7ef 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -126,12 +126,12 @@ void Script::parse()
}
}
- RuntimeCodegen cg(v4, strictMode);
+ QV4::Compiler::JSUnitGenerator jsGenerator(&module);
+ RuntimeCodegen cg(v4, &jsGenerator, strictMode);
cg.generateFromProgram(sourceFile, sourceCode, program, &module, QQmlJS::Codegen::EvalCode, inheritedLocals);
if (v4->hasException)
return;
- QV4::Compiler::JSUnitGenerator jsGenerator(&module);
QScopedPointer<EvalInstructionSelection> isel(v4->iselFactory->create(QQmlEnginePrivate::get(v4), v4->executableAllocator, &module, &jsGenerator));
if (inheritContext)
isel->setUseFastLookups(false);
@@ -230,7 +230,7 @@ QQmlRefPointer<QV4::CompiledData::CompilationUnit> Script::precompile(IR::Module
return 0;
}
- QQmlJS::Codegen cg(/*strict mode*/false);
+ QQmlJS::Codegen cg(unitGenerator, /*strict mode*/false);
cg.generateFromProgram(url.toString(), source, program, module, QQmlJS::Codegen::EvalCode);
errors = cg.qmlErrors();
if (!errors.isEmpty()) {