Chromium Code Reviews| 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 dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Generates the code for all used classes in the program. Static fields (even | 8 * Generates the code for all used classes in the program. Static fields (even |
| 9 * in classes) are ignored, since they can be treated as non-class elements. | 9 * in classes) are ignored, since they can be treated as non-class elements. |
| 10 * | 10 * |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 654 /// starts with 'new '. | 654 /// starts with 'new '. |
| 655 /// The reflection name of class 'C' is 'C'. | 655 /// The reflection name of class 'C' is 'C'. |
| 656 /// An anonymous mixin application has no reflection name. | 656 /// An anonymous mixin application has no reflection name. |
| 657 /// This is used by js_mirrors.dart. | 657 /// This is used by js_mirrors.dart. |
| 658 String getReflectionName(elementOrSelector, String mangledName) { | 658 String getReflectionName(elementOrSelector, String mangledName) { |
| 659 String name = elementOrSelector.name; | 659 String name = elementOrSelector.name; |
| 660 if (backend.shouldRetainName(name) || | 660 if (backend.shouldRetainName(name) || |
| 661 elementOrSelector is Element && | 661 elementOrSelector is Element && |
| 662 // Make sure to retain names of unnamed constructors, and | 662 // Make sure to retain names of unnamed constructors, and |
| 663 // for common native types. | 663 // for common native types. |
| 664 (name == '' && backend.isNeededForReflection(elementOrSelector) || | 664 (name == '' && |
|
Johnni Winther
2014/06/27 07:43:01
Add parentheses around 'name == ... isAccess...(..
herhut
2014/06/27 12:34:38
Done.
| |
| 665 backend.isAccessibleByReflection(elementOrSelector) || | |
| 665 _isNativeTypeNeedingReflectionName(elementOrSelector))) { | 666 _isNativeTypeNeedingReflectionName(elementOrSelector))) { |
| 666 | 667 |
| 667 // TODO(ahe): Enable the next line when I can tell the difference between | 668 // TODO(ahe): Enable the next line when I can tell the difference between |
| 668 // an instance method and a global. They may have the same mangled name. | 669 // an instance method and a global. They may have the same mangled name. |
| 669 // if (recordedMangledNames.contains(mangledName)) return null; | 670 // if (recordedMangledNames.contains(mangledName)) return null; |
| 670 recordedMangledNames.add(mangledName); | 671 recordedMangledNames.add(mangledName); |
| 671 return getReflectionNameInternal(elementOrSelector, mangledName); | 672 return getReflectionNameInternal(elementOrSelector, mangledName); |
| 672 } | 673 } |
| 673 return null; | 674 return null; |
| 674 } | 675 } |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1800 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 1801 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
| 1801 if (element.isInstanceMember) { | 1802 if (element.isInstanceMember) { |
| 1802 cachedClassBuilders.remove(element.enclosingClass); | 1803 cachedClassBuilders.remove(element.enclosingClass); |
| 1803 | 1804 |
| 1804 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 1805 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
| 1805 | 1806 |
| 1806 } | 1807 } |
| 1807 } | 1808 } |
| 1808 } | 1809 } |
| 1809 } | 1810 } |
| OLD | NEW |