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

Side by Side Diff: pkg/compiler/lib/src/js_backend/interceptor_data.dart

Issue 2898983005: Add ClosureClassMaps super interface for ClosureTask (Closed)
Patch Set: Updated cf. comments Created 3 years, 6 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
« no previous file with comments | « pkg/compiler/lib/src/closure.dart ('k') | pkg/compiler/lib/src/kernel/element_map_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 js_backend.interceptor_data; 5 library js_backend.interceptor_data;
6 6
7 import '../common/names.dart' show Identifiers; 7 import '../common/names.dart' show Identifiers;
8 import '../common_elements.dart' show CommonElements, ElementEnvironment; 8 import '../common_elements.dart' show CommonElements, ElementEnvironment;
9 import '../elements/elements.dart' show MemberElement; 9 import '../elements/elements.dart' show ConstructorBodyElement;
10 import '../elements/entities.dart'; 10 import '../elements/entities.dart';
11 import '../elements/types.dart'; 11 import '../elements/types.dart';
12 import '../js/js.dart' as jsAst; 12 import '../js/js.dart' as jsAst;
13 import '../types/types.dart' show TypeMask; 13 import '../types/types.dart' show TypeMask;
14 import '../universe/selector.dart'; 14 import '../universe/selector.dart';
15 import '../world.dart' show ClosedWorld; 15 import '../world.dart' show ClosedWorld;
16 import 'namer.dart'; 16 import 'namer.dart';
17 import 'native_data.dart'; 17 import 'native_data.dart';
18 18
19 abstract class InterceptorData { 19 abstract class InterceptorData {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 final Set<ClassEntity> _noClasses = new Set<ClassEntity>(); 83 final Set<ClassEntity> _noClasses = new Set<ClassEntity>();
84 84
85 InterceptorDataImpl( 85 InterceptorDataImpl(
86 this._nativeData, 86 this._nativeData,
87 this._commonElements, 87 this._commonElements,
88 this._interceptedElements, 88 this._interceptedElements,
89 this._interceptedClasses, 89 this._interceptedClasses,
90 this._classesMixedIntoInterceptedClasses); 90 this._classesMixedIntoInterceptedClasses);
91 91
92 bool isInterceptedMethod(MemberElement element) { 92 bool isInterceptedMethod(MemberEntity element) {
93 if (!element.isInstanceMember) return false; 93 if (!element.isInstanceMember) return false;
94 if (element.isGenerativeConstructorBody) { 94 // TODO(johnniwinther): Avoid this hack.
95 if (element is ConstructorBodyElement) {
95 return _nativeData.isNativeOrExtendsNative(element.enclosingClass); 96 return _nativeData.isNativeOrExtendsNative(element.enclosingClass);
96 } 97 }
97 return _interceptedElements[element.name] != null; 98 return _interceptedElements[element.name] != null;
98 } 99 }
99 100
100 bool fieldHasInterceptedGetter(FieldEntity element) { 101 bool fieldHasInterceptedGetter(FieldEntity element) {
101 return _interceptedElements[element.name] != null; 102 return _interceptedElements[element.name] != null;
102 } 103 }
103 104
104 bool fieldHasInterceptedSetter(FieldEntity element) { 105 bool fieldHasInterceptedSetter(FieldEntity element) {
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 jsAst.Name name = namer.nameForGetInterceptor(classes); 335 jsAst.Name name = namer.nameForGetInterceptor(classes);
335 if (classes.contains(_commonElements.jsInterceptorClass)) { 336 if (classes.contains(_commonElements.jsInterceptorClass)) {
336 // We can't use a specialized [getInterceptorMethod], so we make 337 // We can't use a specialized [getInterceptorMethod], so we make
337 // sure we emit the one with all checks. 338 // sure we emit the one with all checks.
338 _specializedGetInterceptors[name] = _interceptorData.interceptedClasses; 339 _specializedGetInterceptors[name] = _interceptorData.interceptedClasses;
339 } else { 340 } else {
340 _specializedGetInterceptors[name] = classes; 341 _specializedGetInterceptors[name] = classes;
341 } 342 }
342 } 343 }
343 } 344 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/closure.dart ('k') | pkg/compiler/lib/src/kernel/element_map_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698