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 library js_backend.backend; | 5 library js_backend.backend; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; | 9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; |
| 10 | 10 |
| (...skipping 2291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2302 | 2302 |
| 2303 if (mustPreserveNames) reporter.log('Preserving names.'); | 2303 if (mustPreserveNames) reporter.log('Preserving names.'); |
| 2304 | 2304 |
| 2305 if (mustRetainMetadata) { | 2305 if (mustRetainMetadata) { |
| 2306 reporter.log('Retaining metadata.'); | 2306 reporter.log('Retaining metadata.'); |
| 2307 | 2307 |
| 2308 compiler.libraryLoader.libraries.forEach(retainMetadataOf); | 2308 compiler.libraryLoader.libraries.forEach(retainMetadataOf); |
| 2309 | 2309 |
| 2310 StagedWorldImpactBuilder impactBuilder = enqueuer.isResolutionQueue | 2310 StagedWorldImpactBuilder impactBuilder = enqueuer.isResolutionQueue |
| 2311 ? constantImpactsForResolution | 2311 ? constantImpactsForResolution |
| 2312 : constantImpactsForResolution; | 2312 : constantImpactsForCodegen; |
|
Johnni Winther
2017/01/09 12:58:03
Latent error found while debugging the problem in
Siggi Cherem (dart-lang)
2017/01/11 19:24:01
ouch
| |
| 2313 if (enqueuer.isResolutionQueue && !enqueuer.queueIsClosed) { | 2313 if (enqueuer.isResolutionQueue && !enqueuer.queueIsClosed) { |
| 2314 /// Register the constant value of [metadata] as live in resolution. | 2314 /// Register the constant value of [metadata] as live in resolution. |
| 2315 void registerMetadataConstant(MetadataAnnotation metadata) { | 2315 void registerMetadataConstant(MetadataAnnotation metadata) { |
| 2316 ConstantValue constant = | 2316 ConstantValue constant = |
| 2317 constants.getConstantValueForMetadata(metadata); | 2317 constants.getConstantValueForMetadata(metadata); |
| 2318 Dependency dependency = | 2318 Dependency dependency = |
| 2319 new Dependency(constant, metadata.annotatedElement); | 2319 new Dependency(constant, metadata.annotatedElement); |
| 2320 metadataConstants.add(dependency); | 2320 metadataConstants.add(dependency); |
| 2321 computeImpactForCompileTimeConstant( | 2321 computeImpactForCompileTimeConstant( |
| 2322 dependency.constant, impactBuilder, enqueuer.isResolutionQueue); | 2322 dependency.constant, impactBuilder, enqueuer.isResolutionQueue); |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 2353 | 2353 |
| 2354 void processElementMetadata(Element element) { | 2354 void processElementMetadata(Element element) { |
| 2355 if (_registeredMetadata.add(element)) { | 2355 if (_registeredMetadata.add(element)) { |
| 2356 element.metadata.forEach(onMetadata); | 2356 element.metadata.forEach(onMetadata); |
| 2357 if (element.isFunction) { | 2357 if (element.isFunction) { |
| 2358 FunctionElement function = element; | 2358 FunctionElement function = element; |
| 2359 for (ParameterElement parameter in function.parameters) { | 2359 for (ParameterElement parameter in function.parameters) { |
| 2360 parameter.metadata.forEach(onMetadata); | 2360 parameter.metadata.forEach(onMetadata); |
| 2361 } | 2361 } |
| 2362 } | 2362 } |
| 2363 if (element.enclosingClass != null) { | 2363 if (element.enclosingElement is ClassElement) { |
| 2364 processElementMetadata(element.enclosingClass); | 2364 // Use [enclosingElement] to process patch class metadata for patch |
|
Siggi Cherem (dart-lang)
2017/01/11 19:24:02
nit: maybe highlight also that you are not using e
Johnni Winther
2017/01/12 09:56:56
Done.
| |
| 2365 // and injected members. | |
| 2366 processElementMetadata(element.enclosingElement); | |
| 2365 } else { | 2367 } else { |
| 2366 processLibraryMetadata(element.library); | 2368 processLibraryMetadata(element.library); |
| 2367 } | 2369 } |
| 2368 } | 2370 } |
| 2369 } | 2371 } |
| 2370 | 2372 |
| 2371 entities.forEach(processElementMetadata); | 2373 entities.forEach(processElementMetadata); |
| 2372 } | 2374 } |
| 2373 | 2375 |
| 2374 void onQueueClosed() { | 2376 void onQueueClosed() { |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3274 @override | 3276 @override |
| 3275 bool isNativeClass(ClassElement element) { | 3277 bool isNativeClass(ClassElement element) { |
| 3276 return helpers.backend.isNative(element); | 3278 return helpers.backend.isNative(element); |
| 3277 } | 3279 } |
| 3278 | 3280 |
| 3279 @override | 3281 @override |
| 3280 bool isNativeMember(MemberElement element) { | 3282 bool isNativeMember(MemberElement element) { |
| 3281 return helpers.backend.isNative(element); | 3283 return helpers.backend.isNative(element); |
| 3282 } | 3284 } |
| 3283 } | 3285 } |
| OLD | NEW |