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

Side by Side Diff: pkg/compiler/lib/src/elements/elements.dart

Issue 2675103003: Refactor BackendHelpers to be reusageable with KernelWorldBuilder (Closed)
Patch Set: Updated cf. comments Created 3 years, 10 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 elements; 5 library elements;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/resolution.dart' show Resolution; 8 import '../common/resolution.dart' show Resolution;
9 import '../constants/constructors.dart'; 9 import '../constants/constructors.dart';
10 import '../constants/expressions.dart'; 10 import '../constants/expressions.dart';
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 Uri aUri = a.script.readableUri; 736 Uri aUri = a.script.readableUri;
737 Uri bUri = b.script.readableUri; 737 Uri bUri = b.script.readableUri;
738 return '${aUri}'.compareTo('${bUri}'); 738 return '${aUri}'.compareTo('${bUri}');
739 } 739 }
740 740
741 static List<Element> sortedByPosition(Iterable<Element> elements) { 741 static List<Element> sortedByPosition(Iterable<Element> elements) {
742 return elements.toList()..sort(compareByPosition); 742 return elements.toList()..sort(compareByPosition);
743 } 743 }
744 744
745 static bool isFixedListConstructorCall( 745 static bool isFixedListConstructorCall(
746 Element element, Send node, CommonElements commonElements) { 746 ConstructorEntity element, Send node, CommonElements commonElements) {
747 return element == commonElements.unnamedListConstructor && 747 return commonElements.isUnnamedListConstructor(element) &&
748 node.isCall && 748 node.isCall &&
749 !node.arguments.isEmpty && 749 !node.arguments.isEmpty &&
750 node.arguments.tail.isEmpty; 750 node.arguments.tail.isEmpty;
751 } 751 }
752 752
753 static bool isGrowableListConstructorCall( 753 static bool isGrowableListConstructorCall(
754 Element element, Send node, CommonElements commonElements) { 754 ConstructorEntity element, Send node, CommonElements commonElements) {
755 return element == commonElements.unnamedListConstructor && 755 return commonElements.isUnnamedListConstructor(element) &&
756 node.isCall && 756 node.isCall &&
757 node.arguments.isEmpty; 757 node.arguments.isEmpty;
758 } 758 }
759 759
760 static bool isFilledListConstructorCall( 760 static bool isFilledListConstructorCall(
761 Element element, Send node, CommonElements commonElements) { 761 ConstructorEntity element, Send node, CommonElements commonElements) {
762 return element == commonElements.filledListConstructor && 762 return commonElements.isFilledListConstructor(element) &&
763 node.isCall && 763 node.isCall &&
764 !node.arguments.isEmpty && 764 !node.arguments.isEmpty &&
765 !node.arguments.tail.isEmpty && 765 !node.arguments.tail.isEmpty &&
766 node.arguments.tail.tail.isEmpty; 766 node.arguments.tail.tail.isEmpty;
767 } 767 }
768 768
769 static bool isConstructorOfTypedArraySubclass( 769 static bool isConstructorOfTypedArraySubclass(
770 Element element, ClosedWorld closedWorld) { 770 Element element, ClosedWorld closedWorld) {
771 if (closedWorld.commonElements.typedDataLibrary == null) return false; 771 if (closedWorld.commonElements.typedDataLibrary == null) return false;
772 if (!element.isConstructor) return false; 772 if (!element.isConstructor) return false;
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 /// by a field. 2015 /// by a field.
2016 bool get isDeclaredByField; 2016 bool get isDeclaredByField;
2017 2017
2018 /// Returns `true` if this member is abstract. 2018 /// Returns `true` if this member is abstract.
2019 bool get isAbstract; 2019 bool get isAbstract;
2020 2020
2021 /// If abstract, [implementation] points to the overridden concrete member, 2021 /// If abstract, [implementation] points to the overridden concrete member,
2022 /// if any. Otherwise [implementation] points to the member itself. 2022 /// if any. Otherwise [implementation] points to the member itself.
2023 Member get implementation; 2023 Member get implementation;
2024 } 2024 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/diagnostics/messages.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698