Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1196433002: Create and test source mapping for invocations. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update comments. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 6c2e126ca890bd53239698b05f65c12321daea08..1ddb3d632f829bdf07d48d0228f350c5c3b2c97f 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -616,8 +616,9 @@ class JavaScriptBackend extends Backend {
bool enabledNoSuchMethod = false;
+ final SourceInformationStrategy sourceInformationStrategy;
+
JavaScriptBackend(Compiler compiler,
- SourceInformationFactory sourceInformationFactory,
{bool generateSourceMap: true})
: namer = determineNamer(compiler),
oneShotInterceptors = new Map<String, Selector>(),
@@ -625,6 +626,12 @@ class JavaScriptBackend extends Backend {
rti = new RuntimeTypes(compiler),
specializedGetInterceptors = new Map<String, Set<ClassElement>>(),
annotations = new Annotations(compiler),
+ this.sourceInformationStrategy =
+ generateSourceMap
+ ? (USE_NEW_SOURCE_INFO
+ ? const PositionSourceInformationStrategy()
+ : const StartEndSourceInformationStrategy())
+ : const JavaScriptSourceInformationStrategy(),
super(compiler) {
emitter = new CodeEmitterTask(compiler, namer, generateSourceMap);
typeVariableHandler = new TypeVariableHandler(compiler);
@@ -635,8 +642,8 @@ class JavaScriptBackend extends Backend {
patchResolverTask = new PatchResolverTask(compiler);
functionCompiler = compiler.useCpsIr
? new CpsFunctionCompiler(
- compiler, this, sourceInformationFactory)
- : new SsaFunctionCompiler(this, sourceInformationFactory);
+ compiler, this, sourceInformationStrategy)
+ : new SsaFunctionCompiler(this, sourceInformationStrategy);
}
ConstantSystem get constantSystem => constants.constantSystem;

Powered by Google App Engine
This is Rietveld 408576698