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

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

Issue 2684783003: Refactor ConstantSystem (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 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 3157 matching lines...) Expand 10 before | Expand all | Expand 10 after
3168 3168
3169 @override 3169 @override
3170 bool isNativeClass(ClassElement element) { 3170 bool isNativeClass(ClassElement element) {
3171 return _nativeData.isNative(element); 3171 return _nativeData.isNative(element);
3172 } 3172 }
3173 3173
3174 @override 3174 @override
3175 bool isNativeMember(MemberElement element) { 3175 bool isNativeMember(MemberElement element) {
3176 return _nativeData.isNative(element); 3176 return _nativeData.isNative(element);
3177 } 3177 }
3178
3179 InterfaceType getConstantMapTypeFor(InterfaceType sourceType,
3180 {bool hasProtoKey: false, bool onlyStringKeys: false}) {
3181 ClassElement classElement = onlyStringKeys
3182 ? (hasProtoKey
3183 ? helpers.constantProtoMapClass
3184 : helpers.constantStringMapClass)
3185 : helpers.generalConstantMapClass;
3186 List<DartType> typeArgument = sourceType.typeArguments;
3187 if (sourceType.treatAsRaw) {
3188 return _env.getRawType(classElement);
3189 } else {
3190 return _env.createInterfaceType(classElement, typeArgument);
3191 }
3192 }
3193
3194 @override
3195 FieldEntity get symbolField => helpers.symbolImplementationField;
3196
3197 @override
3198 InterfaceType get symbolType {
3199 return _env.getRawType(helpers.symbolImplementationClass);
3200 }
3178 } 3201 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/constants/expressions.dart ('k') | pkg/compiler/lib/src/js_backend/backend_helpers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698