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

Issue 10836128: A visitor that builds a map from node to "Usage". (Closed)

Created:
8 years, 4 months ago by Roman
Modified:
8 years, 4 months ago
Reviewers:
Anton Muhin
CC:
reviews_dartlang.org
Visibility:
Public.

Description

A visitor that builds a map from node to "Usage". A renamer just renames "usages" according to its type. This allows us to split various send-guessing logic and renaming. No scopes yet. Committed: https://code.google.com/p/dart/source/detail?r=10433

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 26

Patch Set 4 : #

Total comments: 21

Patch Set 5 : #

Total comments: 32

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Total comments: 9

Patch Set 9 : #

Patch Set 10 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+269 lines, -227 lines) Patch
M lib/compiler/implementation/dart_backend/backend.dart View 1 2 3 4 5 1 chunk +9 lines, -1 line 0 comments Download
M lib/compiler/implementation/dart_backend/dart_backend.dart View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M lib/compiler/implementation/dart_backend/emitter.dart View 1 2 3 4 3 chunks +3 lines, -7 lines 0 comments Download
A lib/compiler/implementation/dart_backend/placeholder.dart View 1 2 3 4 5 6 7 8 1 chunk +28 lines, -0 lines 0 comments Download
A lib/compiler/implementation/dart_backend/placeholder_collector.dart View 1 2 3 4 5 6 7 8 1 chunk +182 lines, -0 lines 0 comments Download
M lib/compiler/implementation/dart_backend/renamer.dart View 1 2 3 4 5 6 7 1 chunk +13 lines, -153 lines 0 comments Download
M lib/compiler/implementation/tree/renamer.dart View 1 2 3 4 1 chunk +0 lines, -27 lines 0 comments Download
M lib/compiler/implementation/tree/tree.dart View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M lib/compiler/implementation/tree/unparser.dart View 1 2 3 4 5 6 chunks +23 lines, -26 lines 0 comments Download
M tests/language/language.status View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -11 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Roman
8 years, 4 months ago (2012-08-07 09:38:58 UTC) #1
Anton Muhin
Overall looks neat, 1st round of comments https://chromiumcodereview.appspot.com/10836128/diff/3001/lib/compiler/implementation/dart_backend/backend.dart File lib/compiler/implementation/dart_backend/backend.dart (right): https://chromiumcodereview.appspot.com/10836128/diff/3001/lib/compiler/implementation/dart_backend/backend.dart#newcode76 lib/compiler/implementation/dart_backend/backend.dart:76: || element ...
8 years, 4 months ago (2012-08-07 12:32:10 UTC) #2
Roman
Changed significant visitor parts to your approach. https://chromiumcodereview.appspot.com/10836128/diff/3001/lib/compiler/implementation/dart_backend/backend.dart File lib/compiler/implementation/dart_backend/backend.dart (right): https://chromiumcodereview.appspot.com/10836128/diff/3001/lib/compiler/implementation/dart_backend/backend.dart#newcode76 lib/compiler/implementation/dart_backend/backend.dart:76: || element ...
8 years, 4 months ago (2012-08-07 15:44:03 UTC) #3
Anton Muhin
Interrupted review, I'll finish later. But you may want to address some of my comments ...
8 years, 4 months ago (2012-08-07 16:00:30 UTC) #4
Anton Muhin
https://chromiumcodereview.appspot.com/10836128/diff/3001/lib/compiler/implementation/tree/unparser.dart File lib/compiler/implementation/tree/unparser.dart (right): https://chromiumcodereview.appspot.com/10836128/diff/3001/lib/compiler/implementation/tree/unparser.dart#newcode317 lib/compiler/implementation/tree/unparser.dart:317: visit(node.typeName); TODO here and a fix for visitChildren in ...
8 years, 4 months ago (2012-08-07 16:24:08 UTC) #5
Roman
https://chromiumcodereview.appspot.com/10836128/diff/8001/lib/compiler/implementation/dart_backend/renamer.dart File lib/compiler/implementation/dart_backend/renamer.dart (right): https://chromiumcodereview.appspot.com/10836128/diff/8001/lib/compiler/implementation/dart_backend/renamer.dart#newcode9 lib/compiler/implementation/dart_backend/renamer.dart:9: class ConflictingRenamer extends Renamer { On 2012/08/07 16:00:30, Anton ...
8 years, 4 months ago (2012-08-08 06:46:14 UTC) #6
Anton Muhin
getting really close https://chromiumcodereview.appspot.com/10836128/diff/3003/lib/compiler/implementation/dart_backend/backend.dart File lib/compiler/implementation/dart_backend/backend.dart (right): https://chromiumcodereview.appspot.com/10836128/diff/3003/lib/compiler/implementation/dart_backend/backend.dart#newcode76 lib/compiler/implementation/dart_backend/backend.dart:76: || element is SynthesizedConstructorElement can we ...
8 years, 4 months ago (2012-08-08 08:27:19 UTC) #7
Roman
I merged your latest change on privates into this CL too. Unfortunately I could not ...
8 years, 4 months ago (2012-08-09 05:02:35 UTC) #8
Anton Muhin
lgtm once we resolve the issue w/ privates. Nice work! https://chromiumcodereview.appspot.com/10836128/diff/5012/lib/compiler/implementation/dart_backend/placeholder.dart File lib/compiler/implementation/dart_backend/placeholder.dart (right): https://chromiumcodereview.appspot.com/10836128/diff/5012/lib/compiler/implementation/dart_backend/placeholder.dart#newcode20 ...
8 years, 4 months ago (2012-08-09 06:34:52 UTC) #9
Roman
8 years, 4 months ago (2012-08-09 07:34:03 UTC) #10
https://chromiumcodereview.appspot.com/10836128/diff/5012/lib/compiler/implem...
File lib/compiler/implementation/dart_backend/placeholder.dart (right):

https://chromiumcodereview.appspot.com/10836128/diff/5012/lib/compiler/implem...
lib/compiler/implementation/dart_backend/placeholder.dart:20: String toString()
=> 'private[node($node), library($library)]';
On 2012/08/09 06:34:52, Anton Mukhin wrote:
> nit: not sure if you really need this node/library markers, I believe elements
> toString has this information already.  You may want to add 'placeholder' bit
> though.

This is just for debugging when I want to print out a placeholder.
Node.toString() just unparses it, no "node" string. Removed "library" and
"element" markers

https://chromiumcodereview.appspot.com/10836128/diff/5012/lib/compiler/implem...
File lib/compiler/implementation/dart_backend/placeholder_collector.dart
(right):

https://chromiumcodereview.appspot.com/10836128/diff/5012/lib/compiler/implem...
lib/compiler/implementation/dart_backend/placeholder_collector.dart:15: String
visitDynamicSend(Send node) => tryRenamePrivateId(node);
On 2012/08/09 06:34:52, Anton Mukhin wrote:
> nit: this method doesn't return String any more, please, remove return type
and
> do not use => syntax.
> 
> BTW, why haven't you got a warning when running unparser test in checked mode?

Done. I don't know why, probably returning nothing is not a problem.

https://chromiumcodereview.appspot.com/10836128/diff/5012/lib/compiler/implem...
lib/compiler/implementation/dart_backend/placeholder_collector.dart:17: String
tryRenamePrivateId(Send node) {
On 2012/08/09 06:34:52, Anton Mukhin wrote:
> ditto for return type.

Done.

https://chromiumcodereview.appspot.com/10836128/diff/5012/lib/compiler/implem...
lib/compiler/implementation/dart_backend/placeholder_collector.dart:178:
visit(node.typeArguments);
On 2012/08/09 06:34:52, Anton Mukhin wrote:
> super.visit?

I can't! If I use super.visit, we will get into identifier inside type
annotation and may rename top level class.

Powered by Google App Engine
This is Rietveld 408576698