| OLD | NEW |
| 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 js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A function element that represents a closure call. The signature is copied | 8 * A function element that represents a closure call. The signature is copied |
| 9 * from the given element. | 9 * from the given element. |
| 10 */ | 10 */ |
| (...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1995 } | 1995 } |
| 1996 } | 1996 } |
| 1997 }); | 1997 }); |
| 1998 } | 1998 } |
| 1999 | 1999 |
| 2000 /** | 2000 /** |
| 2001 * Return a function that returns true if its argument is a class | 2001 * Return a function that returns true if its argument is a class |
| 2002 * that needs to be emitted. | 2002 * that needs to be emitted. |
| 2003 */ | 2003 */ |
| 2004 Function computeClassFilter() { | 2004 Function computeClassFilter() { |
| 2005 if (backend.isTreeShakingDisabled) return (ClassElement cls) => true; |
| 2006 |
| 2005 Set<ClassElement> unneededClasses = new Set<ClassElement>(); | 2007 Set<ClassElement> unneededClasses = new Set<ClassElement>(); |
| 2006 // The [Bool] class is not marked as abstract, but has a factory | 2008 // The [Bool] class is not marked as abstract, but has a factory |
| 2007 // constructor that always throws. We never need to emit it. | 2009 // constructor that always throws. We never need to emit it. |
| 2008 unneededClasses.add(compiler.boolClass); | 2010 unneededClasses.add(compiler.boolClass); |
| 2009 | 2011 |
| 2010 // Go over specialized interceptors and then constants to know which | 2012 // Go over specialized interceptors and then constants to know which |
| 2011 // interceptors are needed. | 2013 // interceptors are needed. |
| 2012 Set<ClassElement> needed = new Set<ClassElement>(); | 2014 Set<ClassElement> needed = new Set<ClassElement>(); |
| 2013 backend.specializedGetInterceptors.forEach( | 2015 backend.specializedGetInterceptors.forEach( |
| 2014 (_, Iterable<ClassElement> elements) { | 2016 (_, Iterable<ClassElement> elements) { |
| (...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3745 | 3747 |
| 3746 const String HOOKS_API_USAGE = """ | 3748 const String HOOKS_API_USAGE = """ |
| 3747 // The code supports the following hooks: | 3749 // The code supports the following hooks: |
| 3748 // dartPrint(message) - if this function is defined it is called | 3750 // dartPrint(message) - if this function is defined it is called |
| 3749 // instead of the Dart [print] method. | 3751 // instead of the Dart [print] method. |
| 3750 // dartMainRunner(main) - if this function is defined, the Dart [main] | 3752 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 3751 // method will not be invoked directly. | 3753 // method will not be invoked directly. |
| 3752 // Instead, a closure that will invoke [main] is | 3754 // Instead, a closure that will invoke [main] is |
| 3753 // passed to [dartMainRunner]. | 3755 // passed to [dartMainRunner]. |
| 3754 """; | 3756 """; |
| OLD | NEW |