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

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: Rebased 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
« no previous file with comments | « pkg/compiler/lib/src/js/js_source_mapping.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ddeacb436d9c74023857f1493bfb2e75427b4ca4..de1b40861663805142cfd7c890bb9253174d8b11 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -617,8 +617,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<jsAst.Name, Selector>(),
@@ -626,6 +627,12 @@ class JavaScriptBackend extends Backend {
rti = new RuntimeTypes(compiler),
specializedGetInterceptors = new Map<jsAst.Name, Set<ClassElement>>(),
annotations = new Annotations(compiler),
+ this.sourceInformationStrategy =
+ generateSourceMap
+ ? (useNewSourceInfo
+ ? const PositionSourceInformationStrategy()
+ : const StartEndSourceInformationStrategy())
+ : const JavaScriptSourceInformationStrategy(),
super(compiler) {
emitter = new CodeEmitterTask(compiler, namer, generateSourceMap);
typeVariableHandler = new TypeVariableHandler(compiler);
@@ -636,8 +643,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;
« no previous file with comments | « pkg/compiler/lib/src/js/js_source_mapping.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698