OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 dart2js.js_emitter.full_emitter; | 5 library dart2js.js_emitter.full_emitter; |
6 | 6 |
7 import 'dart:collection' show HashMap; | 7 import 'dart:collection' show HashMap; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 | 9 |
10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; | 10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; |
(...skipping 1873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1884 | 1884 |
1885 ClassBuilder getElementDescriptor(Element element, Fragment fragment) { | 1885 ClassBuilder getElementDescriptor(Element element, Fragment fragment) { |
1886 Element owner = element.library; | 1886 Element owner = element.library; |
1887 if (!element.isLibrary && | 1887 if (!element.isLibrary && |
1888 !element.isTopLevel && | 1888 !element.isTopLevel && |
1889 !backend.isNative(element)) { | 1889 !backend.isNative(element)) { |
1890 // For static (not top level) elements, record their code in a buffer | 1890 // For static (not top level) elements, record their code in a buffer |
1891 // specific to the class. For now, not supported for native classes and | 1891 // specific to the class. For now, not supported for native classes and |
1892 // native elements. | 1892 // native elements. |
1893 ClassElement cls = element.enclosingClassOrCompilationUnit.declaration; | 1893 ClassElement cls = element.enclosingClassOrCompilationUnit.declaration; |
1894 if (compiler.codegenWorld.directlyInstantiatedClasses.contains(cls) && | 1894 if (compiler.codegenWorldBuilder.directlyInstantiatedClasses |
| 1895 .contains(cls) && |
1895 !backend.isNative(cls) && | 1896 !backend.isNative(cls) && |
1896 compiler.deferredLoadTask.outputUnitForElement(element) == | 1897 compiler.deferredLoadTask.outputUnitForElement(element) == |
1897 compiler.deferredLoadTask.outputUnitForElement(cls)) { | 1898 compiler.deferredLoadTask.outputUnitForElement(cls)) { |
1898 owner = cls; | 1899 owner = cls; |
1899 } | 1900 } |
1900 } | 1901 } |
1901 if (owner == null) { | 1902 if (owner == null) { |
1902 reporter.internalError(element, 'Owner is null.'); | 1903 reporter.internalError(element, 'Owner is null.'); |
1903 } | 1904 } |
1904 return elementDescriptors | 1905 return elementDescriptors |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2180 if (cachedElements.isEmpty) return; | 2181 if (cachedElements.isEmpty) return; |
2181 for (Element element in backend.codegenEnqueuer.newlyEnqueuedElements) { | 2182 for (Element element in backend.codegenEnqueuer.newlyEnqueuedElements) { |
2182 if (element.isInstanceMember) { | 2183 if (element.isInstanceMember) { |
2183 cachedClassBuilders.remove(element.enclosingClass); | 2184 cachedClassBuilders.remove(element.enclosingClass); |
2184 | 2185 |
2185 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2186 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
2186 } | 2187 } |
2187 } | 2188 } |
2188 } | 2189 } |
2189 } | 2190 } |
OLD | NEW |