| 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 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 7 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
| 8 final Set<HInstruction> boundsChecked; | 8 final Set<HInstruction> boundsChecked; |
| 9 | 9 |
| 10 JavaScriptItemCompilationContext() | 10 JavaScriptItemCompilationContext() |
| (...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1488 if (mustRetainMetadata) hasRetainedMetadata = true; | 1488 if (mustRetainMetadata) hasRetainedMetadata = true; |
| 1489 if (mustRetainMetadata && isNeededForReflection(element)) { | 1489 if (mustRetainMetadata && isNeededForReflection(element)) { |
| 1490 for (MetadataAnnotation metadata in element.metadata) { | 1490 for (MetadataAnnotation metadata in element.metadata) { |
| 1491 metadata.value.accept(new ConstantCopier(compiler.constantHandler)); | 1491 metadata.value.accept(new ConstantCopier(compiler.constantHandler)); |
| 1492 } | 1492 } |
| 1493 return true; | 1493 return true; |
| 1494 } | 1494 } |
| 1495 return false; | 1495 return false; |
| 1496 } | 1496 } |
| 1497 | 1497 |
| 1498 void onLibraryLoaded(LibraryElement library, Uri uri) { | 1498 Future onLibraryLoaded(LibraryElement library, Uri uri) { |
| 1499 if (uri == Uri.parse('dart:_js_mirrors')) { | 1499 if (uri == Uri.parse('dart:_js_mirrors')) { |
| 1500 disableTreeShakingMarker = | 1500 disableTreeShakingMarker = |
| 1501 library.find(const SourceString('disableTreeShaking')); | 1501 library.find(const SourceString('disableTreeShaking')); |
| 1502 preserveMetadataMarker = | 1502 preserveMetadataMarker = |
| 1503 library.find(const SourceString('preserveMetadata')); | 1503 library.find(const SourceString('preserveMetadata')); |
| 1504 } else if (uri == Uri.parse('dart:_js_names')) { | 1504 } else if (uri == Uri.parse('dart:_js_names')) { |
| 1505 preserveNamesMarker = | 1505 preserveNamesMarker = |
| 1506 library.find(const SourceString('preserveNames')); | 1506 library.find(const SourceString('preserveNames')); |
| 1507 } | 1507 } |
| 1508 return new Future.value(); |
| 1508 } | 1509 } |
| 1509 | 1510 |
| 1510 void registerMetadataInstantiatedType(DartType type, TreeElements elements) { | 1511 void registerMetadataInstantiatedType(DartType type, TreeElements elements) { |
| 1511 if (mustRetainMetadata) { | 1512 if (mustRetainMetadata) { |
| 1512 compiler.constantHandler.registerInstantiatedType(type, elements); | 1513 compiler.constantHandler.registerInstantiatedType(type, elements); |
| 1513 } else { | 1514 } else { |
| 1514 metadataInstantiatedTypes.add(new Dependency(type, elements)); | 1515 metadataInstantiatedTypes.add(new Dependency(type, elements)); |
| 1515 } | 1516 } |
| 1516 } | 1517 } |
| 1517 | 1518 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1642 copy(constant.values); | 1643 copy(constant.values); |
| 1643 copy(constant.protoValue); | 1644 copy(constant.protoValue); |
| 1644 copy(constant); | 1645 copy(constant); |
| 1645 } | 1646 } |
| 1646 | 1647 |
| 1647 void visitConstructed(ConstructedConstant constant) { | 1648 void visitConstructed(ConstructedConstant constant) { |
| 1648 copy(constant.fields); | 1649 copy(constant.fields); |
| 1649 copy(constant); | 1650 copy(constant); |
| 1650 } | 1651 } |
| 1651 } | 1652 } |
| OLD | NEW |