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

Side by Side Diff: pkg/compiler/lib/src/native/enqueue.dart

Issue 1148343004: Remove ConstantExpression.value (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update comments. Created 5 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/native/behavior.dart ('k') | pkg/compiler/lib/src/patch_parser.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) 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 part of native; 5 part of native;
6 6
7 /** 7 /**
8 * This could be an abstract class but we use it as a stub for the dart_backend. 8 * This could be an abstract class but we use it as a stub for the dart_backend.
9 */ 9 */
10 class NativeEnqueuer { 10 class NativeEnqueuer {
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 312
313 /// Returns the JSName annotation string or `null` if no JSName annotation is 313 /// Returns the JSName annotation string or `null` if no JSName annotation is
314 /// present. 314 /// present.
315 String findJsNameFromAnnotation(Element element) { 315 String findJsNameFromAnnotation(Element element) {
316 String name = null; 316 String name = null;
317 ClassElement annotationClass = annotationJsNameClass; 317 ClassElement annotationClass = annotationJsNameClass;
318 for (Link<MetadataAnnotation> link = element.metadata; 318 for (Link<MetadataAnnotation> link = element.metadata;
319 !link.isEmpty; 319 !link.isEmpty;
320 link = link.tail) { 320 link = link.tail) {
321 MetadataAnnotation annotation = link.head.ensureResolved(compiler); 321 MetadataAnnotation annotation = link.head.ensureResolved(compiler);
322 ConstantValue value = annotation.constant.value; 322 ConstantValue value =
323 compiler.constants.getConstantValue(annotation.constant);
323 if (!value.isConstructedObject) continue; 324 if (!value.isConstructedObject) continue;
324 ConstructedConstantValue constructedObject = value; 325 ConstructedConstantValue constructedObject = value;
325 if (constructedObject.type.element != annotationClass) continue; 326 if (constructedObject.type.element != annotationClass) continue;
326 327
327 Iterable<ConstantValue> fields = constructedObject.fields.values; 328 Iterable<ConstantValue> fields = constructedObject.fields.values;
328 // TODO(sra): Better validation of the constant. 329 // TODO(sra): Better validation of the constant.
329 if (fields.length != 1 || fields.single is! StringConstantValue) { 330 if (fields.length != 1 || fields.single is! StringConstantValue) {
330 PartialMetadataAnnotation partial = annotation; 331 PartialMetadataAnnotation partial = annotation;
331 compiler.internalError(annotation, 332 compiler.internalError(annotation,
332 'Annotations needs one string: ${partial.parseNode(compiler)}'); 333 'Annotations needs one string: ${partial.parseNode(compiler)}');
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 superclass, 689 superclass,
689 () => <ClassElement>[]); 690 () => <ClassElement>[]);
690 directSubtypes.add(cls); 691 directSubtypes.add(cls);
691 } 692 }
692 693
693 void logSummary(log(message)) { 694 void logSummary(log(message)) {
694 log('Compiled ${registeredClasses.length} native classes, ' 695 log('Compiled ${registeredClasses.length} native classes, '
695 '${unusedClasses.length} native classes omitted.'); 696 '${unusedClasses.length} native classes omitted.');
696 } 697 }
697 } 698 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/native/behavior.dart ('k') | pkg/compiler/lib/src/patch_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698