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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart

Issue 12513006: Fix warnings in dart2js code and re-enable analyzer coverage. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/emitter.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) 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 part of dart2js; 5 part of dart2js;
6 6
7 /** 7 /**
8 * The [ConstantHandler] keeps track of compile-time constants, 8 * The [ConstantHandler] keeps track of compile-time constants,
9 * initializations of global and static fields, and default values of 9 * initializations of global and static fields, and default values of
10 * optional parameters. 10 * optional parameters.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 String get name => 'ConstantHandler'; 43 String get name => 'ConstantHandler';
44 44
45 void registerCompileTimeConstant(Constant constant) { 45 void registerCompileTimeConstant(Constant constant) {
46 registerInstantiatedClass(constant.computeType(compiler).element); 46 registerInstantiatedClass(constant.computeType(compiler).element);
47 if (constant.isFunction()) { 47 if (constant.isFunction()) {
48 FunctionConstant function = constant; 48 FunctionConstant function = constant;
49 registerGetOfStaticFunction(function.element); 49 registerGetOfStaticFunction(function.element);
50 } else if (constant.isInterceptor()) { 50 } else if (constant.isInterceptor()) {
51 // An interceptor constant references the class's prototype chain. 51 // An interceptor constant references the class's prototype chain.
52 registerInstantiatedClass(constant.dispatchedType.element); 52 InterceptorConstant interceptor = constant;
53 registerInstantiatedClass(interceptor.dispatchedType.element);
53 } 54 }
54 compiledConstants.add(constant); 55 compiledConstants.add(constant);
55 } 56 }
56 57
57 void registerInstantiatedClass(ClassElement element) { 58 void registerInstantiatedClass(ClassElement element) {
58 if (isMetadata) return; 59 if (isMetadata) return;
59 compiler.enqueuer.codegen.registerInstantiatedClass(element); 60 compiler.enqueuer.codegen.registerInstantiatedClass(element);
60 } 61 }
61 62
62 void registerStaticUse(Element element) { 63 void registerStaticUse(Element element) {
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 // Use the default value. 886 // Use the default value.
886 fieldValue = handler.compileConstant(field); 887 fieldValue = handler.compileConstant(field);
887 } 888 }
888 jsNewArguments.add(fieldValue); 889 jsNewArguments.add(fieldValue);
889 }, 890 },
890 includeBackendMembers: true, 891 includeBackendMembers: true,
891 includeSuperMembers: true); 892 includeSuperMembers: true);
892 return jsNewArguments; 893 return jsNewArguments;
893 } 894 }
894 } 895 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698