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

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

Issue 12753003: Recognize const/fixed/growable arrays in simple types inferrer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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/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 part of dart2js; 5 part of dart2js;
6 6
7 /** 7 /**
8 * If true, print a warning for each method that was resolved, but not 8 * If true, print a warning for each method that was resolved, but not
9 * compiled. 9 * compiled.
10 */ 10 */
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 void registerRuntimeType() {} 153 void registerRuntimeType() {}
154 154
155 bool isNullImplementation(ClassElement cls) { 155 bool isNullImplementation(ClassElement cls) {
156 return cls == compiler.nullClass; 156 return cls == compiler.nullClass;
157 } 157 }
158 ClassElement get intImplementation => compiler.intClass; 158 ClassElement get intImplementation => compiler.intClass;
159 ClassElement get doubleImplementation => compiler.doubleClass; 159 ClassElement get doubleImplementation => compiler.doubleClass;
160 ClassElement get numImplementation => compiler.numClass; 160 ClassElement get numImplementation => compiler.numClass;
161 ClassElement get stringImplementation => compiler.stringClass; 161 ClassElement get stringImplementation => compiler.stringClass;
162 ClassElement get listImplementation => compiler.listClass; 162 ClassElement get listImplementation => compiler.listClass;
163 ClassElement get growableListImplementation => compiler.listClass;
164 ClassElement get fixedListImplementation => compiler.listClass;
165 ClassElement get constListImplementation => compiler.listClass;
163 ClassElement get mapImplementation => compiler.mapClass; 166 ClassElement get mapImplementation => compiler.mapClass;
164 ClassElement get constMapImplementation => compiler.mapClass; 167 ClassElement get constMapImplementation => compiler.mapClass;
165 ClassElement get functionImplementation => compiler.functionClass; 168 ClassElement get functionImplementation => compiler.functionClass;
166 ClassElement get typeImplementation => compiler.typeClass; 169 ClassElement get typeImplementation => compiler.typeClass;
167 ClassElement get boolImplementation => compiler.boolClass; 170 ClassElement get boolImplementation => compiler.boolClass;
168 ClassElement get nullImplementation => compiler.nullClass; 171 ClassElement get nullImplementation => compiler.nullClass;
169 } 172 }
170 173
171 /** 174 /**
172 * Key class used in [TokenMap] in which the hash code for a token is based 175 * Key class used in [TokenMap] in which the hash code for a token is based
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 if (!missingHelperClasses.isEmpty) { 595 if (!missingHelperClasses.isEmpty) {
593 internalErrorOnElement(jsHelperLibrary, 596 internalErrorOnElement(jsHelperLibrary,
594 'dart:_js_helper library does not contain required classes: ' 597 'dart:_js_helper library does not contain required classes: '
595 '$missingHelperClasses'); 598 '$missingHelperClasses');
596 } 599 }
597 600
598 types = new Types(this, dynamicClass); 601 types = new Types(this, dynamicClass);
599 backend.initializeHelperClasses(); 602 backend.initializeHelperClasses();
600 } 603 }
601 604
605 Element _unnamedListConstructor;
606 Element get unnamedListConstructor {
607 if (_unnamedListConstructor != null) return _unnamedListConstructor;
608 Selector callConstructor = new Selector.callConstructor(
609 const SourceString(""), listClass.getLibrary());
610 return _unnamedListConstructor =
611 listClass.lookupConstructor(callConstructor);
612 }
613
602 void scanBuiltinLibraries() { 614 void scanBuiltinLibraries() {
603 jsHelperLibrary = scanBuiltinLibrary('_js_helper'); 615 jsHelperLibrary = scanBuiltinLibrary('_js_helper');
604 interceptorsLibrary = scanBuiltinLibrary('_interceptors'); 616 interceptorsLibrary = scanBuiltinLibrary('_interceptors');
605 foreignLibrary = scanBuiltinLibrary('_foreign_helper'); 617 foreignLibrary = scanBuiltinLibrary('_foreign_helper');
606 isolateHelperLibrary = scanBuiltinLibrary('_isolate_helper'); 618 isolateHelperLibrary = scanBuiltinLibrary('_isolate_helper');
607 // The helper library does not use the native language extension, 619 // The helper library does not use the native language extension,
608 // so we manually set the native classes this library defines. 620 // so we manually set the native classes this library defines.
609 // TODO(ngeoffray): Enable annotations on these classes. 621 // TODO(ngeoffray): Enable annotations on these classes.
610 ClassElement cls = 622 ClassElement cls =
611 isolateHelperLibrary.find(const SourceString('_WorkerStub')); 623 isolateHelperLibrary.find(const SourceString('_WorkerStub'));
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 1193
1182 void close() {} 1194 void close() {}
1183 1195
1184 toString() => name; 1196 toString() => name;
1185 1197
1186 /// Convenience method for getting an [api.CompilerOutputProvider]. 1198 /// Convenience method for getting an [api.CompilerOutputProvider].
1187 static NullSink outputProvider(String name, String extension) { 1199 static NullSink outputProvider(String name, String extension) {
1188 return new NullSink('$name.$extension'); 1200 return new NullSink('$name.$extension');
1189 } 1201 }
1190 } 1202 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698