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

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

Issue 1617083002: Base JavaScript code position computation on JavaScript tracer. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 5a467f5515caa27cf5ef87bf27bd1ff76d74db69..699ec1dbdee8a7faeb69a6af3b279bf948c21e80 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -502,7 +502,7 @@ class JavaScriptBackend extends Backend {
bool enabledNoSuchMethod = false;
- final SourceInformationStrategy sourceInformationStrategy;
+ SourceInformationStrategy sourceInformationStrategy;
final BackendHelpers helpers;
final BackendImpacts impacts;
@@ -520,7 +520,7 @@ class JavaScriptBackend extends Backend {
this.sourceInformationStrategy =
generateSourceMap
? (useNewSourceInfo
- ? const PositionSourceInformationStrategy()
+ ? new PositionSourceInformationStrategy()
: const StartEndSourceInformationStrategy())
: const JavaScriptSourceInformationStrategy(),
helpers = new BackendHelpers(compiler),
@@ -1630,7 +1630,12 @@ class JavaScriptBackend extends Backend {
}
}
- generatedCode[element] = functionCompiler.compile(work);
+ jsAst.Fun function = functionCompiler.compile(work);
+ if (function.sourceInformation == null) {
+ function = function.withSourceInformation(
+ sourceInformationStrategy.buildPreambleMarker());
+ }
+ generatedCode[element] = function;
WorldImpact worldImpact =
impactTransformer.transformCodegenImpact(work.registry.worldImpact);
compiler.dumpInfoTask.registerImpact(element, worldImpact);

Powered by Google App Engine
This is Rietveld 408576698