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

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

Issue 11413219: Canonicalize raw type (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comment Created 8 years 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
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 library native; 5 library native;
6 6
7 import 'dart:uri'; 7 import 'dart:uri';
8 import 'dart2jslib.dart' hide SourceString; 8 import 'dart2jslib.dart' hide SourceString;
9 import 'elements/elements.dart'; 9 import 'elements/elements.dart';
10 import 'js_backend/js_backend.dart'; 10 import 'js_backend/js_backend.dart';
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 bool allUsedBefore = unusedClasses.isEmpty; 229 bool allUsedBefore = unusedClasses.isEmpty;
230 for (var type in behavior.typesInstantiated) { 230 for (var type in behavior.typesInstantiated) {
231 if (matchedTypeConstraints.contains(type)) continue; 231 if (matchedTypeConstraints.contains(type)) continue;
232 matchedTypeConstraints.add(type); 232 matchedTypeConstraints.add(type);
233 if (type is SpecialType) { 233 if (type is SpecialType) {
234 // The two special types (=Object, =List) are always instantiated. 234 // The two special types (=Object, =List) are always instantiated.
235 continue; 235 continue;
236 } 236 }
237 assert(type is DartType); 237 assert(type is DartType);
238 enqueueUnusedClassesMatching( 238 enqueueUnusedClassesMatching(
239 (nativeClass) => compiler.types.isSubtype(nativeClass.type, type), 239 (nativeClass) => compiler.types.isSubtype(nativeClass.thisType, type),
240 cause, 240 cause,
241 'subtypeof($type)'); 241 'subtypeof($type)');
242 } 242 }
243 243
244 // Give an info so that library developers can compile with -v to find why 244 // Give an info so that library developers can compile with -v to find why
245 // all the native classes are included. 245 // all the native classes are included.
246 if (unusedClasses.isEmpty && !allUsedBefore) { 246 if (unusedClasses.isEmpty && !allUsedBefore) {
247 compiler.log('All native types marked as used due to $cause.'); 247 compiler.log('All native types marked as used due to $cause.');
248 } 248 }
249 } 249 }
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 String parameters) { 845 String parameters) {
846 buffer.add(" if (Object.getPrototypeOf(this).hasOwnProperty"); 846 buffer.add(" if (Object.getPrototypeOf(this).hasOwnProperty");
847 buffer.add("('$methodName')) {\n"); 847 buffer.add("('$methodName')) {\n");
848 buffer.add(" $code"); 848 buffer.add(" $code");
849 buffer.add(" } else {\n"); 849 buffer.add(" } else {\n");
850 buffer.add(" return Object.prototype.$methodName.call(this"); 850 buffer.add(" return Object.prototype.$methodName.call(this");
851 buffer.add(parameters == '' ? '' : ', $parameters'); 851 buffer.add(parameters == '' ? '' : ', $parameters');
852 buffer.add(");\n"); 852 buffer.add(");\n");
853 buffer.add(" }\n"); 853 buffer.add(" }\n");
854 } 854 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698