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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/type_test_registry.dart

Issue 2894893002: Add ElementCodegenWorldBuilder (Closed)
Patch Set: Updated cf. comments. Created 3 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 dart2js.js_emitter.type_test_registry; 5 library dart2js.js_emitter.type_test_registry;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common_elements.dart'; 8 import '../common_elements.dart';
9 import '../elements/elements.dart' 9 import '../elements/elements.dart'
10 show ClassElement, Element, ElementKind, MemberElement, MethodElement; 10 show ClassElement, ElementKind, MemberElement, MethodElement;
11 import '../elements/entities.dart'; 11 import '../elements/entities.dart';
12 import '../elements/resolution_types.dart' 12 import '../elements/resolution_types.dart'
13 show 13 show
14 ResolutionDartType, 14 ResolutionDartType,
15 ResolutionFunctionType, 15 ResolutionFunctionType,
16 ResolutionInterfaceType, 16 ResolutionInterfaceType,
17 Types, 17 Types,
18 ResolutionTypeVariableType; 18 ResolutionTypeVariableType;
19 import '../elements/types.dart'; 19 import '../elements/types.dart';
20 import '../js_backend/runtime_types.dart' 20 import '../js_backend/runtime_types.dart'
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 // 3. Add classes that contain checked generic function types. These are 132 // 3. Add classes that contain checked generic function types. These are
133 // needed to store the signature encoding. 133 // needed to store the signature encoding.
134 for (ResolutionFunctionType type in checkedFunctionTypes) { 134 for (ResolutionFunctionType type in checkedFunctionTypes) {
135 ClassElement contextClass = Types.getClassContext(type); 135 ClassElement contextClass = Types.getClassContext(type);
136 if (contextClass != null) { 136 if (contextClass != null) {
137 _rtiNeededClasses.add(contextClass); 137 _rtiNeededClasses.add(contextClass);
138 } 138 }
139 } 139 }
140 140
141 bool canTearOff(Element function) { 141 bool canTearOff(MemberElement function) {
142 if (!function.isFunction || 142 if (!function.isFunction ||
143 function.isConstructor || 143 function.isConstructor ||
144 function.isAccessor) { 144 function.isAccessor) {
145 return false; 145 return false;
146 } else if (function.isInstanceMember) { 146 } else if (function.isInstanceMember) {
147 if (!function.enclosingClass.isClosure) { 147 if (!function.enclosingClass.isClosure) {
148 return _codegenWorldBuilder.hasInvokedGetter(function, _closedWorld); 148 return _codegenWorldBuilder.hasInvokedGetter(function, _closedWorld);
149 } 149 }
150 } 150 }
151 return false; 151 return false;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 checkedFunctionTypes = new Set<ResolutionFunctionType>(); 189 checkedFunctionTypes = new Set<ResolutionFunctionType>();
190 _codegenWorldBuilder.isChecks.forEach((ResolutionDartType t) { 190 _codegenWorldBuilder.isChecks.forEach((ResolutionDartType t) {
191 if (t is ResolutionInterfaceType) { 191 if (t is ResolutionInterfaceType) {
192 checkedClasses.add(t.element); 192 checkedClasses.add(t.element);
193 } else if (t is ResolutionFunctionType) { 193 } else if (t is ResolutionFunctionType) {
194 checkedFunctionTypes.add(t); 194 checkedFunctionTypes.add(t);
195 } 195 }
196 }); 196 });
197 } 197 }
198 } 198 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/program_builder/collector.dart ('k') | pkg/compiler/lib/src/kernel/kernel_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698