Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Side by Side Diff: pkg/compiler/lib/src/compiler.dart

Issue 2220333007: Fix Resolution.getResolvedAst for serialization in production mode (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/analysis3_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1974 matching lines...) Expand 10 before | Expand all | Expand 10 after
1985 return hasBeenResolved(element.memberContext.declaration) && 1985 return hasBeenResolved(element.memberContext.declaration) &&
1986 element.hasResolvedAst; 1986 element.hasResolvedAst;
1987 } 1987 }
1988 1988
1989 @override 1989 @override
1990 ResolvedAst getResolvedAst(ExecutableElement element) { 1990 ResolvedAst getResolvedAst(ExecutableElement element) {
1991 assert(invariant(element, element.isDeclaration, 1991 assert(invariant(element, element.isDeclaration,
1992 message: "Element $element must be the declaration.")); 1992 message: "Element $element must be the declaration."));
1993 assert(invariant(element, hasResolvedAst(element), 1993 assert(invariant(element, hasResolvedAst(element),
1994 message: "ResolvedAst not available for $element.")); 1994 message: "ResolvedAst not available for $element."));
1995 if (compiler.serialization.isDeserialized(element)) {
1996 return compiler.serialization.getResolvedAst(element);
1997 }
1995 return element.resolvedAst; 1998 return element.resolvedAst;
1996 } 1999 }
1997 2000
1998 @override 2001 @override
1999 ResolvedAst computeResolvedAst(Element element) { 2002 ResolvedAst computeResolvedAst(Element element) {
2000 ensureResolved(element); 2003 ensureResolved(element);
2001 return getResolvedAst(element); 2004 return getResolvedAst(element);
2002 } 2005 }
2003 2006
2004 @override 2007 @override
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
2167 _ElementScanner(this.scanner); 2170 _ElementScanner(this.scanner);
2168 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); 2171 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library);
2169 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); 2172 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit);
2170 } 2173 }
2171 2174
2172 class _EmptyEnvironment implements Environment { 2175 class _EmptyEnvironment implements Environment {
2173 const _EmptyEnvironment(); 2176 const _EmptyEnvironment();
2174 2177
2175 String valueOf(String key) => null; 2178 String valueOf(String key) => null;
2176 } 2179 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/analysis3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698