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

Issue 1635063003: Stop precomputing ClassElement.isValidMixin. (Closed)

Created:
4 years, 11 months ago by Paul Berry
Modified:
4 years, 11 months ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Stop precomputing ClassElement.isValidMixin. Previously, we would precompute the value of ClassElement.isValidMixin and store it in the Modifier.MIXIN. But this didn't really save any time, because (a) isValidMixin isn't used inside analyzer, and (b) it is easily derivable from other information already present in the element model. Also, we were computing it incorrectly when the `--supermixin` flag was present. This CL replaces the precomputation logic with a direct implementation in ClassElement.isValidMixin which is correct regardless of the presence of the `--supermixin` flag. The tests are beefed up so that (a) they validate correct behavior for both states of the flag, (b) they validate correct behavior in the presence of factory constructors, and (c) they validate that the behavior of `isValidMixin` is consistent with the error messages produced by the analyzer. In addition to fixing bugs, the removal of Modifier.MIXIN means we have one less piece of information to store in summaries. R=brianwilkerson@google.com Committed: https://github.com/dart-lang/sdk/commit/4e86a006db963f3e335734202abcc02a2ea7e705

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+140 lines, -58 lines) Patch
M pkg/analyzer/lib/dart/element/element.dart View 3 chunks +7 lines, -13 lines 4 comments Download
M pkg/analyzer/lib/src/dart/element/element.dart View 2 chunks +16 lines, -8 lines 0 comments Download
M pkg/analyzer/lib/src/generated/resolver.dart View 6 chunks +0 lines, -17 lines 0 comments Download
M pkg/analyzer/test/generated/resolver_test.dart View 3 chunks +117 lines, -16 lines 0 comments Download
M pkg/analyzer/test/src/summary/resynthesize_test.dart View 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
Paul Berry
4 years, 11 months ago (2016-01-26 13:48:49 UTC) #2
Brian Wilkerson
LGTM https://codereview.chromium.org/1635063003/diff/1/pkg/analyzer/lib/dart/element/element.dart File pkg/analyzer/lib/dart/element/element.dart (left): https://codereview.chromium.org/1635063003/diff/1/pkg/analyzer/lib/dart/element/element.dart#oldcode1553 pkg/analyzer/lib/dart/element/element.dart:1553: static const Modifier MIXIN = const Modifier('MIXIN', 12); ...
4 years, 11 months ago (2016-01-26 15:03:21 UTC) #3
Paul Berry
https://codereview.chromium.org/1635063003/diff/1/pkg/analyzer/lib/dart/element/element.dart File pkg/analyzer/lib/dart/element/element.dart (left): https://codereview.chromium.org/1635063003/diff/1/pkg/analyzer/lib/dart/element/element.dart#oldcode1553 pkg/analyzer/lib/dart/element/element.dart:1553: static const Modifier MIXIN = const Modifier('MIXIN', 12); On ...
4 years, 11 months ago (2016-01-26 15:27:10 UTC) #4
Paul Berry
Committed patchset #1 (id:1) manually as 4e86a006db963f3e335734202abcc02a2ea7e705 (presubmit successful).
4 years, 11 months ago (2016-01-26 15:29:54 UTC) #6
Brian Wilkerson
https://codereview.chromium.org/1635063003/diff/1/pkg/analyzer/lib/dart/element/element.dart File pkg/analyzer/lib/dart/element/element.dart (left): https://codereview.chromium.org/1635063003/diff/1/pkg/analyzer/lib/dart/element/element.dart#oldcode1553 pkg/analyzer/lib/dart/element/element.dart:1553: static const Modifier MIXIN = const Modifier('MIXIN', 12); > ...
4 years, 11 months ago (2016-01-26 15:33:50 UTC) #7
Paul Berry
4 years, 11 months ago (2016-01-26 16:35:09 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/1635063003/diff/1/pkg/analyzer/lib/dart/eleme...
File pkg/analyzer/lib/dart/element/element.dart (left):

https://codereview.chromium.org/1635063003/diff/1/pkg/analyzer/lib/dart/eleme...
pkg/analyzer/lib/dart/element/element.dart:1553: static const Modifier MIXIN =
const Modifier('MIXIN', 12);
On 2016/01/26 15:33:50, Brian Wilkerson wrote:
> > How would you feel if I submitted a follow-up CL that moved the class
> > Modifier into lib/src ...
> 
> I wondered, when I reviewed this CL, why I had included it in the public API
in
> the first place. I need to take a closer look, but I suspect that would be a
> good plan. I'd also be happy to move it so you don't get distracted.

Ok, thanks!  I'll leave the ball in your court, then.

Powered by Google App Engine
This is Rietveld 408576698