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

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 893963005: Refactor handling of source map information. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 43798cd7243067a82a320d3321048a8e36a8730b..6ef2b70b3b168b1441924aa16faf95f76e3e3c8c 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -2446,11 +2446,21 @@ class SsaBuilder extends ResolvedVisitor {
HInstruction attachPosition(HInstruction target, ast.Node node) {
if (generateSourceMap && node != null) {
- target.sourcePosition = sourceFileLocationForBeginToken(node);
+ target.sourceInformation = sourceInformationForBeginToken(node);
}
return target;
}
+ SourceInformation sourceInformationForBeginToken(ast.Node node) {
+ return new StartEndSourceInformation(sourceFileLocationForBeginToken(node));
+ }
+
+ SourceInformation sourceInformationForBeginEndToken(ast.Node node) {
+ return new StartEndSourceInformation(
+ sourceFileLocationForBeginToken(node),
+ sourceFileLocationForEndToken(node));
+ }
+
SourceFileLocation sourceFileLocationForBeginToken(ast.Node node) =>
sourceFileLocationForToken(node, node.getBeginToken());
@@ -2734,8 +2744,7 @@ class SsaBuilder extends ResolvedVisitor {
wrapExpressionGraph(updateGraph),
conditionBlock.loopInformation.target,
conditionBlock.loopInformation.labels,
- sourceFileLocationForBeginToken(loop),
- sourceFileLocationForEndToken(loop));
+ sourceInformationForBeginEndToken(loop));
startBlock.setBlockFlow(info, current);
loopInfo.loopBlockInformation = info;
@@ -2952,8 +2961,7 @@ class SsaBuilder extends ResolvedVisitor {
null,
loopEntryBlock.loopInformation.target,
loopEntryBlock.loopInformation.labels,
- sourceFileLocationForBeginToken(node),
- sourceFileLocationForEndToken(node));
+ sourceInformationForBeginEndToken(node));
loopEntryBlock.setBlockFlow(loopBlockInfo, current);
loopInfo.loopBlockInformation = loopBlockInfo;
} else {

Powered by Google App Engine
This is Rietveld 408576698