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

Issue 10854158: Make selector registration in the resolver and code generator more explicit. (Closed)

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

Description

Make selector registration in the resolver and code generator more explicit. Get rid of registerFieldClosureInvocations() in the enqueuer by explicit registering the closure call selectors when we may be calling a getter in the resolver and the code generator. R=floitsch@google.com,ahe@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=10805

Patch Set 1 #

Patch Set 2 : Minor fixes. #

Patch Set 3 : Merge from master. #

Total comments: 13

Patch Set 4 : Merge and fix tests. #

Patch Set 5 : Address review comments. #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -198 lines) Patch
M lib/compiler/implementation/closure.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M lib/compiler/implementation/elements/elements.dart View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M lib/compiler/implementation/enqueue.dart View 1 2 3 4 3 chunks +2 lines, -31 lines 1 comment Download
M lib/compiler/implementation/js_backend/emitter.dart View 1 2 5 chunks +7 lines, -7 lines 0 comments Download
M lib/compiler/implementation/namer.dart View 1 1 chunk +2 lines, -1 line 0 comments Download
M lib/compiler/implementation/resolver.dart View 1 2 3 4 12 chunks +89 lines, -118 lines 5 comments Download
M lib/compiler/implementation/ssa/builder.dart View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 1 2 3 4 2 chunks +17 lines, -11 lines 0 comments Download
M lib/compiler/implementation/universe.dart View 1 2 3 4 6 chunks +23 lines, -23 lines 0 comments Download
M tests/compiler/dart2js/mock_compiler.dart View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M tests/compiler/dart2js/type_checker_test.dart View 1 2 3 2 chunks +4 lines, -1 line 0 comments Download
M tests/compiler/dart2js/unparser_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
kasperl
8 years, 4 months ago (2012-08-15 12:25:56 UTC) #1
floitsch
LGTM. https://chromiumcodereview.appspot.com/10854158/diff/3009/lib/compiler/implementation/enqueue.dart File lib/compiler/implementation/enqueue.dart (right): https://chromiumcodereview.appspot.com/10854158/diff/3009/lib/compiler/implementation/enqueue.dart#newcode327 lib/compiler/implementation/enqueue.dart:327: do { remove the inner loop. https://chromiumcodereview.appspot.com/10854158/diff/3009/lib/compiler/implementation/namer.dart File ...
8 years, 4 months ago (2012-08-15 14:14:04 UTC) #2
ahe
Comments so far. https://chromiumcodereview.appspot.com/10854158/diff/3009/lib/compiler/implementation/enqueue.dart File lib/compiler/implementation/enqueue.dart (left): https://chromiumcodereview.appspot.com/10854158/diff/3009/lib/compiler/implementation/enqueue.dart#oldcode356 lib/compiler/implementation/enqueue.dart:356: registerFieldClosureInvocations(); Yay! https://chromiumcodereview.appspot.com/10854158/diff/3009/lib/compiler/implementation/enqueue.dart File lib/compiler/implementation/enqueue.dart (right): ...
8 years, 4 months ago (2012-08-15 14:32:21 UTC) #3
kasperl
PTAL. I had to do some changes to the compiler mocking used by the resolver ...
8 years, 4 months ago (2012-08-16 10:35:47 UTC) #4
floitsch
Still LGTM. https://chromiumcodereview.appspot.com/10854158/diff/3022/lib/compiler/implementation/resolver.dart File lib/compiler/implementation/resolver.dart (right): https://chromiumcodereview.appspot.com/10854158/diff/3022/lib/compiler/implementation/resolver.dart#newcode967 lib/compiler/implementation/resolver.dart:967: return mapping[node] = element; I would prefer ...
8 years, 4 months ago (2012-08-16 11:49:53 UTC) #5
ahe
8 years, 4 months ago (2012-08-16 12:09:54 UTC) #6
LGTM!

https://chromiumcodereview.appspot.com/10854158/diff/3022/lib/compiler/implem...
File lib/compiler/implementation/enqueue.dart (right):

https://chromiumcodereview.appspot.com/10854158/diff/3022/lib/compiler/implem...
lib/compiler/implementation/enqueue.dart:327: f(queue.removeLast()); //
TODO(kasperl): Why isn't this removeFirst?
Main is added last and we want to process it first. LIFO (stack) behavior makes
the tests complete faster, and the user gets error messages faster for his code
(rather than waiting fo system classes).

https://chromiumcodereview.appspot.com/10854158/diff/3022/lib/compiler/implem...
File lib/compiler/implementation/resolver.dart (right):

https://chromiumcodereview.appspot.com/10854158/diff/3022/lib/compiler/implem...
lib/compiler/implementation/resolver.dart:1248: if (node.isOperator) {
You could write something like this:

if (node.isOperatorWithTypeExpression) {
  resolveTypeTest(node.arguments.head);
} else {
  resolveArguments(node.argumentsNode);
}

You could also change resolveTypeTest to resolveTypeExpression and have it take
node.argumentsNode.

https://chromiumcodereview.appspot.com/10854158/diff/3022/lib/compiler/implem...
lib/compiler/implementation/resolver.dart:1312: bool isCompound =
identifier.source.stringValue !== '=';
isCompound is not entirely correct as this also is true for ++ and --. Perhaps
the word "complex" is better?

https://chromiumcodereview.appspot.com/10854158/diff/3022/lib/compiler/implem...
lib/compiler/implementation/resolver.dart:1320: // register here. We should
consider using some notation of
Great idea.

https://chromiumcodereview.appspot.com/10854158/diff/3022/lib/compiler/implem...
lib/compiler/implementation/resolver.dart:1343: // the use of classes. Wouldn't
it be simpler if we just did?
I'm not so sure about that. There is a difference between using a class for
instantiation, or using a class for accessing a static.

Powered by Google App Engine
This is Rietveld 408576698