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

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

Issue 10105027: Remove SimpleType. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 // TODO(floitsch): this should be a List<String> type. 760 // TODO(floitsch): this should be a List<String> type.
761 Type keysType = null; 761 Type keysType = null;
762 ListConstant keysList = new ListConstant(keysType, keys); 762 ListConstant keysList = new ListConstant(keysType, keys);
763 compiler.constantHandler.registerCompileTimeConstant(keysList); 763 compiler.constantHandler.registerCompileTimeConstant(keysList);
764 SourceString className = hasProtoKey 764 SourceString className = hasProtoKey
765 ? MapConstant.DART_PROTO_CLASS 765 ? MapConstant.DART_PROTO_CLASS
766 : MapConstant.DART_CLASS; 766 : MapConstant.DART_CLASS;
767 ClassElement classElement = compiler.jsHelperLibrary.find(className); 767 ClassElement classElement = compiler.jsHelperLibrary.find(className);
768 classElement.ensureResolved(compiler); 768 classElement.ensureResolved(compiler);
769 // TODO(floitsch): copy over the generic type. 769 // TODO(floitsch): copy over the generic type.
770 Type type = new SimpleType(classElement.name, classElement); 770 Type type = new InterfaceType(classElement.name, classElement);
771 compiler.registerInstantiatedClass(classElement); 771 compiler.registerInstantiatedClass(classElement);
772 Constant constant = new MapConstant(type, keysList, values, protoValue); 772 Constant constant = new MapConstant(type, keysList, values, protoValue);
773 compiler.constantHandler.registerCompileTimeConstant(constant); 773 compiler.constantHandler.registerCompileTimeConstant(constant);
774 return constant; 774 return constant;
775 } 775 }
776 776
777 Constant visitLiteralNull(LiteralNull node) { 777 Constant visitLiteralNull(LiteralNull node) {
778 return new NullConstant(); 778 return new NullConstant();
779 } 779 }
780 780
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 Constant fieldValue = fieldValues[field]; 1137 Constant fieldValue = fieldValues[field];
1138 if (fieldValue === null) { 1138 if (fieldValue === null) {
1139 // Use the default value. 1139 // Use the default value.
1140 fieldValue = compiler.compileVariable(field); 1140 fieldValue = compiler.compileVariable(field);
1141 } 1141 }
1142 jsNewArguments.add(fieldValue); 1142 jsNewArguments.add(fieldValue);
1143 }); 1143 });
1144 return jsNewArguments; 1144 return jsNewArguments;
1145 } 1145 }
1146 } 1146 }
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