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.compiler_base; | 5 library dart2js.compiler_base; |
6 | 6 |
7 import 'dart:async' show EventSink, Future; | 7 import 'dart:async' show EventSink, Future; |
8 | 8 |
9 import '../compiler_new.dart' as api; | 9 import '../compiler_new.dart' as api; |
10 import 'cache_strategy.dart' show CacheStrategy; | 10 import 'cache_strategy.dart' show CacheStrategy; |
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1843 | 1843 |
1844 @override | 1844 @override |
1845 DartType resolveTypeAnnotation(Element element, TypeAnnotation node) { | 1845 DartType resolveTypeAnnotation(Element element, TypeAnnotation node) { |
1846 return compiler.resolver.resolveTypeAnnotation(element, node); | 1846 return compiler.resolver.resolveTypeAnnotation(element, node); |
1847 } | 1847 } |
1848 | 1848 |
1849 @override | 1849 @override |
1850 bool hasResolvedAst(Element element) { | 1850 bool hasResolvedAst(Element element) { |
1851 assert(invariant(element, element.isDeclaration, | 1851 assert(invariant(element, element.isDeclaration, |
1852 message: "Element $element must be the declaration.")); | 1852 message: "Element $element must be the declaration.")); |
1853 if (compiler.serialization.isDeserialized(element)) { | |
Siggi Cherem (dart-lang)
2016/04/19 20:58:02
Could this be a possible cause of the regression?
Johnni Winther
2016/04/20 10:40:21
For swarm SerializationTask.isDeserialized is call
Siggi Cherem (dart-lang)
2016/04/20 18:58:40
Yeah - I'm not sure, but this and the other change
| |
1854 return compiler.serialization.hasResolvedAst(element); | |
1855 } | |
1853 return element is AstElement && | 1856 return element is AstElement && |
1854 hasBeenResolved(element) && | 1857 hasBeenResolved(element) && |
1855 element.hasResolvedAst; | 1858 element.hasResolvedAst; |
1856 } | 1859 } |
1857 | 1860 |
1858 @override | 1861 @override |
1859 ResolvedAst getResolvedAst(Element element) { | 1862 ResolvedAst getResolvedAst(Element element) { |
1860 assert(invariant(element, element.isDeclaration, | 1863 assert(invariant(element, element.isDeclaration, |
1861 message: "Element $element must be the declaration.")); | 1864 message: "Element $element must be the declaration.")); |
1862 if (hasResolvedAst(element)) { | 1865 if (hasResolvedAst(element)) { |
1866 if (compiler.serialization.isDeserialized(element)) { | |
1867 return compiler.serialization.getResolvedAst(element); | |
1868 } | |
1863 AstElement astElement = element; | 1869 AstElement astElement = element; |
1864 return astElement.resolvedAst; | 1870 return astElement.resolvedAst; |
1865 } | 1871 } |
1866 assert(invariant(element, hasResolvedAst(element), | 1872 assert(invariant(element, hasResolvedAst(element), |
1867 message: "ResolvedAst not available for $element.")); | 1873 message: "ResolvedAst not available for $element.")); |
1868 return null; | 1874 return null; |
1869 } | 1875 } |
1870 | 1876 |
1871 @override | 1877 @override |
1872 bool hasResolutionImpact(Element element) { | 1878 bool hasResolutionImpact(Element element) { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2028 _ElementScanner(this.scanner); | 2034 _ElementScanner(this.scanner); |
2029 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); | 2035 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); |
2030 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); | 2036 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); |
2031 } | 2037 } |
2032 | 2038 |
2033 class _EmptyEnvironment implements Environment { | 2039 class _EmptyEnvironment implements Environment { |
2034 const _EmptyEnvironment(); | 2040 const _EmptyEnvironment(); |
2035 | 2041 |
2036 String valueOf(String key) => null; | 2042 String valueOf(String key) => null; |
2037 } | 2043 } |
OLD | NEW |