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

Side by Side Diff: pkg/analyzer/lib/src/generated/error_verifier.dart

Issue 2015513003: Optimize more megamorphic dispatch sites (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.generated.error_verifier; 5 library analyzer.src.generated.error_verifier;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import "dart:math" as math; 8 import "dart:math" as math;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 3795 matching lines...) Expand 10 before | Expand all | Expand 10 after
3806 _errorReporter.reportErrorForNode( 3806 _errorReporter.reportErrorForNode(
3807 StaticWarningCode 3807 StaticWarningCode
3808 .INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC, 3808 .INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC,
3809 errorNameTarget, 3809 errorNameTarget,
3810 [executableElementName, fieldElt.enclosingElement.displayName]); 3810 [executableElementName, fieldElt.enclosingElement.displayName]);
3811 return true; 3811 return true;
3812 } 3812 }
3813 } 3813 }
3814 // Check methods. 3814 // Check methods.
3815 List<MethodElement> methodElements = superclassElement.methods; 3815 List<MethodElement> methodElements = superclassElement.methods;
3816 for (MethodElement methodElement in methodElements) { 3816 int length = methodElements.length;
3817 for (int i = 0; i < length; i++) {
3818 MethodElement methodElement = methodElements[i];
3817 // We need the same name. 3819 // We need the same name.
3818 if (methodElement.name != executableElementName) { 3820 if (methodElement.name != executableElementName) {
3819 continue; 3821 continue;
3820 } 3822 }
3821 // Ignore if private in a different library - cannot collide. 3823 // Ignore if private in a different library - cannot collide.
3822 if (executableElementPrivate && 3824 if (executableElementPrivate &&
3823 _currentLibrary != superclassLibrary) { 3825 _currentLibrary != superclassLibrary) {
3824 continue; 3826 continue;
3825 } 3827 }
3826 // instance vs. static 3828 // instance vs. static
(...skipping 2444 matching lines...) Expand 10 before | Expand all | Expand 10 after
6271 class _InvocationCollector extends RecursiveAstVisitor { 6273 class _InvocationCollector extends RecursiveAstVisitor {
6272 final List<String> superCalls = <String>[]; 6274 final List<String> superCalls = <String>[];
6273 6275
6274 @override 6276 @override
6275 visitMethodInvocation(MethodInvocation node) { 6277 visitMethodInvocation(MethodInvocation node) {
6276 if (node.target is SuperExpression) { 6278 if (node.target is SuperExpression) {
6277 superCalls.add(node.methodName.name); 6279 superCalls.add(node.methodName.name);
6278 } 6280 }
6279 } 6281 }
6280 } 6282 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698