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

Issue 2815443003: Better DDC sourcemap generation for lambdas (Closed)

Created:
3 years, 8 months ago by Alan Knight
Modified:
3 years, 8 months ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Better DDC sourcemap generation for lambdas This doesn't fix the entire problem, there's still a Chrome issue that it's not clear we can work around, but it helps some. https://bugs.chromium.org/p/chromium/issues/detail?id=676388 There are three distinct issues here affecting Chrome sourcemap usage for DDC programs with single-line lambdas. 1 - We may introduce a synthetic "as SomeType" in a parameter. The synthetic token ends up with a large negative length, from its offset to the beginning of the file, which can confuse sourcemaps. 2 - We have no entry for the blank line following the lambda. The devtools asks for the mapping from (selectedLine, 0) to (selectedLine +1, 0) and if there's no mapping for either it refuses to set the breakpoint. So this artificially forces the mapping from the last character on the line to be to the beginning of the next line instead. 3 - With a lambda we introduce a constructed Return JS node and make a block. Those nodes weren't getting annotated, so they had no source information. BUG= R=jmesserly@google.com Committed: https://github.com/dart-lang/sdk/commit/04bb68bb09781f4c82f23f4941e4a461e66dfc28

Patch Set 1 #

Patch Set 2 : Merged and formatted #

Total comments: 4

Patch Set 3 : Skip synthetic nodes and method declarations #

Total comments: 1

Patch Set 4 : Added comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -5 lines) Patch
M pkg/dev_compiler/lib/src/compiler/code_generator.dart View 1 1 chunk +4 lines, -2 lines 0 comments Download
M pkg/dev_compiler/lib/src/compiler/source_map_printer.dart View 1 2 3 4 chunks +16 lines, -3 lines 0 comments Download

Messages

Total messages: 14 (4 generated)
Alan Knight
3 years, 8 months ago (2017-04-11 16:43:49 UTC) #4
vsm
https://codereview.chromium.org/2815443003/diff/20001/pkg/dev_compiler/lib/src/compiler/source_map_printer.dart File pkg/dev_compiler/lib/src/compiler/source_map_printer.dart (right): https://codereview.chromium.org/2815443003/diff/20001/pkg/dev_compiler/lib/src/compiler/source_map_printer.dart#newcode79 pkg/dev_compiler/lib/src/compiler/source_map_printer.dart:79: var next = unit.lineInfo.getLocation(offset + 1); Can you add ...
3 years, 8 months ago (2017-04-11 18:39:51 UTC) #5
vsm
3 years, 8 months ago (2017-04-11 18:39:53 UTC) #6
Brian Wilkerson
https://codereview.chromium.org/2815443003/diff/20001/pkg/analyzer/lib/src/dart/ast/ast.dart File pkg/analyzer/lib/src/dart/ast/ast.dart (right): https://codereview.chromium.org/2815443003/diff/20001/pkg/analyzer/lib/src/dart/ast/ast.dart#newcode521 pkg/analyzer/lib/src/dart/ast/ast.dart:521: get length { I think this is the wrong ...
3 years, 8 months ago (2017-04-11 19:07:51 UTC) #7
Brian Wilkerson
https://codereview.chromium.org/2815443003/diff/20001/pkg/analyzer/lib/src/dart/ast/ast.dart File pkg/analyzer/lib/src/dart/ast/ast.dart (right): https://codereview.chromium.org/2815443003/diff/20001/pkg/analyzer/lib/src/dart/ast/ast.dart#newcode521 pkg/analyzer/lib/src/dart/ast/ast.dart:521: get length { I think this is the wrong ...
3 years, 8 months ago (2017-04-11 19:07:51 UTC) #8
Jennifer Messerly
FYI -- I think you should be able to fix the synthetic node issue in ...
3 years, 8 months ago (2017-04-11 19:24:10 UTC) #9
Alan Knight
On 2017/04/11 19:24:10, Jennifer Messerly wrote: > FYI -- I think you should be able ...
3 years, 8 months ago (2017-04-11 20:31:58 UTC) #10
Alan Knight
https://codereview.chromium.org/2815443003/diff/20001/pkg/analyzer/lib/src/dart/ast/ast.dart File pkg/analyzer/lib/src/dart/ast/ast.dart (right): https://codereview.chromium.org/2815443003/diff/20001/pkg/analyzer/lib/src/dart/ast/ast.dart#newcode521 pkg/analyzer/lib/src/dart/ast/ast.dart:521: get length { On 2017/04/11 19:07:51, Brian Wilkerson wrote: ...
3 years, 8 months ago (2017-04-11 20:32:06 UTC) #11
Jennifer Messerly
LGTM! https://codereview.chromium.org/2815443003/diff/40001/pkg/dev_compiler/lib/src/compiler/source_map_printer.dart File pkg/dev_compiler/lib/src/compiler/source_map_printer.dart (right): https://codereview.chromium.org/2815443003/diff/40001/pkg/dev_compiler/lib/src/compiler/source_map_printer.dart#newcode64 pkg/dev_compiler/lib/src/compiler/source_map_printer.dart:64: if (node is! MethodDeclaration) { Add a comment ...
3 years, 8 months ago (2017-04-12 16:11:23 UTC) #12
Alan Knight
3 years, 8 months ago (2017-04-12 18:31:25 UTC) #14
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
04bb68bb09781f4c82f23f4941e4a461e66dfc28 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698