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

Issue 10809004: Attach source map positions to returns, sends, and some operators. (Closed)

Created:
8 years, 5 months ago by podivilov
Modified:
8 years, 4 months ago
Reviewers:
floitsch
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Attach source map positions to returns, sends, and some operators. R=floitsch@google.com Committed: https://code.google.com/p/dart/source/detail?r=9758

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -29 lines) Patch
M lib/compiler/implementation/ssa/builder.dart View 11 chunks +38 lines, -29 lines 0 comments Download
M tests/compiler/dart2js/source_mapping_test.dart View 2 chunks +25 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
podivilov
8 years, 5 months ago (2012-07-18 16:31:29 UTC) #1
floitsch
LGTM!
8 years, 5 months ago (2012-07-18 18:11:36 UTC) #2
ahe
This change was submitted an unreviewed change to lib/compiler/implementation/source_map_builder.dart: if (sourceFile === null || entry.sourceOffset ...
8 years, 4 months ago (2012-08-02 18:45:58 UTC) #3
podivilov
On 2012/08/02 18:45:58, ahe wrote: > This change was submitted an unreviewed change to > ...
8 years, 4 months ago (2012-08-22 14:59:10 UTC) #4
ahe
8 years, 4 months ago (2012-08-22 15:09:10 UTC) #5
On 2012/08/22 14:59:10, podivilov wrote:
> On 2012/08/02 18:45:58, ahe wrote:
> > This change was submitted an unreviewed change to
> > lib/compiler/implementation/source_map_builder.dart:
> > 
> > if (sourceFile === null || entry.sourceOffset >= sourceFile.text.length) {
> > ...
> > 
> > Unfortunately, this hides a bug in the compiler that will silently lead to
> wrong
> > offsets being recorded. If a too large offset can sneak through here, it
means
> > that there are other (undiagnosed) bad offsets that also sneak through.
> > 
> > Also, I don't see any tests.
> 
> Initially, I made an assumption that while we are processing a single work
item,
> all the source tokens belong to the same compilation unit. This assumption is
> wrong because of the patches.

Johnni is working on fixing positions of patch elements.

Unfortunately, the assumption is wrong in general. We may inline methods into
other methods.

> The check in source_map_builder.dart is just a
> temporary workaround, we should probably store SourceFile reference on each
> Token, or find some other way to propagate source info for patches.

If we were to add another field to tokens, we would consume a lot of memory. The
backend needs to track the current element for each instruction. This can be
accomplished in several ways. The simplest way is to associate both an
originating element and token with each HInstruction.

Cheers,
Peter

Powered by Google App Engine
This is Rietveld 408576698