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 library dart2js.backend_api; | 5 library dart2js.backend_api; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../common/codegen.dart' show CodegenImpact; | 10 import '../common/codegen.dart' show CodegenImpact; |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 void registerStaticUse(Element element, Enqueuer enqueuer) {} | 266 void registerStaticUse(Element element, Enqueuer enqueuer) {} |
267 | 267 |
268 /// This method is called immediately after the [LibraryElement] [library] has | 268 /// This method is called immediately after the [LibraryElement] [library] has |
269 /// been created. | 269 /// been created. |
270 void onLibraryCreated(LibraryElement library) {} | 270 void onLibraryCreated(LibraryElement library) {} |
271 | 271 |
272 /// This method is called immediately after the [library] and its parts have | 272 /// This method is called immediately after the [library] and its parts have |
273 /// been scanned. | 273 /// been scanned. |
274 Future onLibraryScanned(LibraryElement library, LibraryLoader loader) { | 274 Future onLibraryScanned(LibraryElement library, LibraryLoader loader) { |
275 // TODO(johnniwinther): Move this to [JavaScriptBackend]. | 275 // TODO(johnniwinther): Move this to [JavaScriptBackend]. |
276 if (canLibraryUseNative(library)) { | 276 if (!compiler.serialization.isDeserialized(library)) { |
| 277 if (canLibraryUseNative(library)) { |
| 278 library.forEachLocalMember((Element element) { |
| 279 if (element.isClass) { |
| 280 checkNativeAnnotation(compiler, element); |
| 281 } |
| 282 }); |
| 283 } |
| 284 checkJsInteropAnnotation(compiler, library); |
277 library.forEachLocalMember((Element element) { | 285 library.forEachLocalMember((Element element) { |
278 if (element.isClass) { | 286 checkJsInteropAnnotation(compiler, element); |
279 checkNativeAnnotation(compiler, element); | 287 if (element.isClass && isJsInterop(element)) { |
| 288 ClassElement classElement = element; |
| 289 classElement.forEachMember((_, memberElement) { |
| 290 checkJsInteropAnnotation(compiler, memberElement); |
| 291 }); |
280 } | 292 } |
281 }); | 293 }); |
282 } | 294 } |
283 checkJsInteropAnnotation(compiler, library); | |
284 library.forEachLocalMember((Element element) { | |
285 checkJsInteropAnnotation(compiler, element); | |
286 if (element.isClass && isJsInterop(element)) { | |
287 ClassElement classElement = element; | |
288 classElement.forEachMember((_, memberElement) { | |
289 checkJsInteropAnnotation(compiler, memberElement); | |
290 }); | |
291 } | |
292 }); | |
293 return new Future.value(); | 295 return new Future.value(); |
294 } | 296 } |
295 | 297 |
296 /// This method is called when all new libraries loaded through | 298 /// This method is called when all new libraries loaded through |
297 /// [LibraryLoader.loadLibrary] has been loaded and their imports/exports | 299 /// [LibraryLoader.loadLibrary] has been loaded and their imports/exports |
298 /// have been computed. | 300 /// have been computed. |
299 Future onLibrariesLoaded(LoadedLibraries loadedLibraries) { | 301 Future onLibrariesLoaded(LoadedLibraries loadedLibraries) { |
300 return new Future.value(); | 302 return new Future.value(); |
301 } | 303 } |
302 | 304 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 } | 435 } |
434 } | 436 } |
435 | 437 |
436 /// Interface for serialization of backend specific data. | 438 /// Interface for serialization of backend specific data. |
437 class BackendSerialization { | 439 class BackendSerialization { |
438 const BackendSerialization(); | 440 const BackendSerialization(); |
439 | 441 |
440 SerializerPlugin get serializer => const SerializerPlugin(); | 442 SerializerPlugin get serializer => const SerializerPlugin(); |
441 DeserializerPlugin get deserializer => const DeserializerPlugin(); | 443 DeserializerPlugin get deserializer => const DeserializerPlugin(); |
442 } | 444 } |
OLD | NEW |