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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/optimize_interceptors.dart

Issue 2239193002: Rerun formatter (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart2js.cps_ir.optimize_interceptors; 5 library dart2js.cps_ir.optimize_interceptors;
6 6
7 import '../constants/values.dart'; 7 import '../constants/values.dart';
8 import '../elements/elements.dart'; 8 import '../elements/elements.dart';
9 import '../io/source_information.dart' show SourceInformation; 9 import '../io/source_information.dart' show SourceInformation;
10 import '../js_backend/backend_helpers.dart' show BackendHelpers; 10 import '../js_backend/backend_helpers.dart' show BackendHelpers;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 intercepted.clear(); 103 intercepted.clear();
104 for (Reference ref = interceptor.firstRef; ref != null; ref = ref.next) { 104 for (Reference ref = interceptor.firstRef; ref != null; ref = ref.next) {
105 Node use = ref.parent; 105 Node use = ref.parent;
106 if (use is InvokeMethod) { 106 if (use is InvokeMethod) {
107 TypeMask type = use.receiver.type; 107 TypeMask type = use.receiver.type;
108 bool canOccurAsReceiver(ClassElement elem) { 108 bool canOccurAsReceiver(ClassElement elem) {
109 return classWorld.isInstantiated(elem) && 109 return classWorld.isInstantiated(elem) &&
110 !typeSystem.areDisjoint( 110 !typeSystem.areDisjoint(
111 type, typeSystem.getInterceptorSubtypes(elem)); 111 type, typeSystem.getInterceptorSubtypes(elem));
112 } 112 }
113
113 Iterable<ClassElement> classes = 114 Iterable<ClassElement> classes =
114 backend.getInterceptedClassesOn(use.selector.name); 115 backend.getInterceptedClassesOn(use.selector.name);
115 intercepted.addAll(classes.where(canOccurAsReceiver)); 116 intercepted.addAll(classes.where(canOccurAsReceiver));
116 } else { 117 } else {
117 intercepted.clear(); 118 intercepted.clear();
118 intercepted.add(backend.helpers.jsInterceptorClass); 119 intercepted.add(backend.helpers.jsInterceptorClass);
119 break; 120 break;
120 } 121 }
121 } 122 }
122 if (intercepted.contains(backend.helpers.jsInterceptorClass) || 123 if (intercepted.contains(backend.helpers.jsInterceptorClass) ||
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 sharedConstantFor.remove(prim.value); 319 sharedConstantFor.remove(prim.value);
319 }); 320 });
320 } 321 }
321 return next; 322 return next;
322 } 323 }
323 324
324 bool shouldShareConstant(Constant constant) { 325 bool shouldShareConstant(Constant constant) {
325 return constant.value.isInterceptor; 326 return constant.value.isInterceptor;
326 } 327 }
327 } 328 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/octagon.dart ('k') | pkg/compiler/lib/src/cps_ir/type_mask_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698