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

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

Issue 10115026: Address the remaining review comments on http://chromiumcodereview.appspot.com/9431029. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | lib/compiler/implementation/elements/elements.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 class Constant implements Hashable { 5 class Constant implements Hashable {
6 const Constant(); 6 const Constant();
7 7
8 bool isNull() => false; 8 bool isNull() => false;
9 bool isBool() => false; 9 bool isBool() => false;
10 bool isTrue() => false; 10 bool isTrue() => false;
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 // TODO(floitsch): this should be a List<String> type. 768 // TODO(floitsch): this should be a List<String> type.
769 Type keysType = null; 769 Type keysType = null;
770 ListConstant keysList = new ListConstant(keysType, keys); 770 ListConstant keysList = new ListConstant(keysType, keys);
771 compiler.constantHandler.registerCompileTimeConstant(keysList); 771 compiler.constantHandler.registerCompileTimeConstant(keysList);
772 SourceString className = hasProtoKey 772 SourceString className = hasProtoKey
773 ? MapConstant.DART_PROTO_CLASS 773 ? MapConstant.DART_PROTO_CLASS
774 : MapConstant.DART_CLASS; 774 : MapConstant.DART_CLASS;
775 ClassElement classElement = compiler.jsHelperLibrary.find(className); 775 ClassElement classElement = compiler.jsHelperLibrary.find(className);
776 classElement.ensureResolved(compiler); 776 classElement.ensureResolved(compiler);
777 // TODO(floitsch): copy over the generic type. 777 // TODO(floitsch): copy over the generic type.
778 Type type = new InterfaceType(classElement.name, classElement); 778 Type type = new InterfaceType(classElement);
779 compiler.registerInstantiatedClass(classElement); 779 compiler.registerInstantiatedClass(classElement);
780 Constant constant = new MapConstant(type, keysList, values, protoValue); 780 Constant constant = new MapConstant(type, keysList, values, protoValue);
781 compiler.constantHandler.registerCompileTimeConstant(constant); 781 compiler.constantHandler.registerCompileTimeConstant(constant);
782 return constant; 782 return constant;
783 } 783 }
784 784
785 Constant visitLiteralNull(LiteralNull node) { 785 Constant visitLiteralNull(LiteralNull node) {
786 return new NullConstant(); 786 return new NullConstant();
787 } 787 }
788 788
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 Constant fieldValue = fieldValues[field]; 1147 Constant fieldValue = fieldValues[field];
1148 if (fieldValue === null) { 1148 if (fieldValue === null) {
1149 // Use the default value. 1149 // Use the default value.
1150 fieldValue = compiler.compileVariable(field); 1150 fieldValue = compiler.compileVariable(field);
1151 } 1151 }
1152 jsNewArguments.add(fieldValue); 1152 jsNewArguments.add(fieldValue);
1153 }); 1153 });
1154 return jsNewArguments; 1154 return jsNewArguments;
1155 } 1155 }
1156 } 1156 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698