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

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

Issue 2616653003: Use elements/types.dart in codegen.dart (Closed)
Patch Set: Created 3 years, 11 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 js_backend.backend; 5 library js_backend.backend;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; 9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames;
10 10
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 registerBackendUse(helpers.createRuntimeType); 1092 registerBackendUse(helpers.createRuntimeType);
1093 } 1093 }
1094 impactBuilder.registerTypeUse( 1094 impactBuilder.registerTypeUse(
1095 new TypeUse.instantiation(backendClasses.typeImplementation.rawType)); 1095 new TypeUse.instantiation(backendClasses.typeImplementation.rawType));
1096 } 1096 }
1097 lookupMapAnalysis.registerConstantKey(constant); 1097 lookupMapAnalysis.registerConstantKey(constant);
1098 } 1098 }
1099 1099
1100 void computeImpactForInstantiatedConstantType( 1100 void computeImpactForInstantiatedConstantType(
1101 DartType type, WorldImpactBuilder impactBuilder) { 1101 DartType type, WorldImpactBuilder impactBuilder) {
1102 DartType instantiatedType =
1103 type.isFunctionType ? commonElements.functionType : type;
1104 if (type is InterfaceType) { 1102 if (type is InterfaceType) {
1105 impactBuilder 1103 impactBuilder
1106 .registerTypeUse(new TypeUse.instantiation(instantiatedType)); 1104 .registerTypeUse(new TypeUse.instantiation(type));
1107 if (classNeedsRtiField(type.element)) { 1105 if (classNeedsRtiField(type.element)) {
1108 impactBuilder.registerStaticUse(new StaticUse.staticInvoke( 1106 impactBuilder.registerStaticUse(new StaticUse.staticInvoke(
1109 // TODO(johnniwinther): Find the right [CallStructure]. 1107 // TODO(johnniwinther): Find the right [CallStructure].
1110 helpers.setRuntimeTypeInfo, 1108 helpers.setRuntimeTypeInfo,
1111 null)); 1109 null));
1112 } 1110 }
1113 if (type.element == backendClasses.typeImplementation) { 1111 if (type.element == backendClasses.typeImplementation) {
1114 // If we use a type literal in a constant, the compile time 1112 // If we use a type literal in a constant, the compile time
1115 // constant emitter will generate a call to the createRuntimeType 1113 // constant emitter will generate a call to the createRuntimeType
1116 // helper so we register a use of that. 1114 // helper so we register a use of that.
(...skipping 2156 matching lines...) Expand 10 before | Expand all | Expand 10 after
3273 @override 3271 @override
3274 bool isNativeClass(ClassElement element) { 3272 bool isNativeClass(ClassElement element) {
3275 return helpers.backend.isNative(element); 3273 return helpers.backend.isNative(element);
3276 } 3274 }
3277 3275
3278 @override 3276 @override
3279 bool isNativeMember(MemberElement element) { 3277 bool isNativeMember(MemberElement element) {
3280 return helpers.backend.isNative(element); 3278 return helpers.backend.isNative(element);
3281 } 3279 }
3282 } 3280 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698