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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart

Issue 131403007: Version 1.1.0-dev.5.6 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: dart/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart
===================================================================
--- dart/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart (revision 31659)
+++ dart/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart (working copy)
@@ -376,6 +376,33 @@
}
}
+ bool canTearOff(Element function) {
+ if (!function.isFunction() ||
+ function.isConstructor() ||
+ function.isAccessor()) {
+ return false;
+ } else if (function.isInstanceMember()) {
+ if (!function.getEnclosingClass().isClosure()) {
+ return compiler.codegenWorld.hasInvokedGetter(function, compiler);
+ }
+ }
+ return false;
+ }
+
+ backend.generatedCode.keys.where((element) {
+ return element is FunctionElement &&
+ element is! ConstructorBodyElement &&
+ (canTearOff(element) || backend.isAccessibleByReflection(element));
+ }).forEach((FunctionElement function) {
+ DartType type = function.computeType(compiler);
+ for (ClassElement cls in backend.rti.getReferencedClasses(type)) {
+ while (cls != null) {
+ rtiNeededClasses.add(cls);
+ cls = cls.superclass;
+ }
+ }
+ });
+
return rtiNeededClasses;
}

Powered by Google App Engine
This is Rietveld 408576698