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

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

Issue 1413213004: Move remaining helpers to BackendHelpers (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /// Analysis to determine how to generate code for `LookupMap`s. 5 /// Analysis to determine how to generate code for `LookupMap`s.
6 library compiler.src.js_backend.lookup_map_analysis; 6 library compiler.src.js_backend.lookup_map_analysis;
7 7
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/registry.dart' show Registry; 9 import '../common/registry.dart' show Registry;
10 import '../compiler.dart' show Compiler; 10 import '../compiler.dart' show Compiler;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 /// 61 ///
62 /// * Include all generic-type arguments, if the program uses type 62 /// * Include all generic-type arguments, if the program uses type
63 /// variables in expressions such as `class A<T> { Type get extract => T }`. 63 /// variables in expressions such as `class A<T> { Type get extract => T }`.
64 /// 64 ///
65 // TODO(sigmund): add support for const expressions, currently this 65 // TODO(sigmund): add support for const expressions, currently this
66 // implementation only supports Type literals. To support const expressions we 66 // implementation only supports Type literals. To support const expressions we
67 // need to change some of the invariants below (e.g. we can no longer use the 67 // need to change some of the invariants below (e.g. we can no longer use the
68 // ClassElement of a type to refer to keys we need to discover). 68 // ClassElement of a type to refer to keys we need to discover).
69 // TODO(sigmund): detect uses of mirrors 69 // TODO(sigmund): detect uses of mirrors
70 class LookupMapAnalysis { 70 class LookupMapAnalysis {
71 static final Uri PACKAGE_LOOKUP_MAP =
72 new Uri(scheme: 'package', path: 'lookup_map/lookup_map.dart');
73
71 /// Reference to [JavaScriptBackend] to be able to enqueue work when we 74 /// Reference to [JavaScriptBackend] to be able to enqueue work when we
72 /// discover that a key in a map is potentially used. 75 /// discover that a key in a map is potentially used.
73 final JavaScriptBackend backend; 76 final JavaScriptBackend backend;
74 77
75 /// Reference the diagnostic reporting system for logging and reporting issues 78 /// Reference the diagnostic reporting system for logging and reporting issues
76 /// to the end-user. 79 /// to the end-user.
77 final DiagnosticReporter reporter; 80 final DiagnosticReporter reporter;
78 81
79 /// The resolved [VariableElement] associated with the top-level `_version`. 82 /// The resolved [VariableElement] associated with the top-level `_version`.
80 VariableElement lookupMapVersionVariable; 83 VariableElement lookupMapVersionVariable;
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 } 435 }
433 } else { 436 } else {
434 original.fields[analysis.entriesField] = 437 original.fields[analysis.entriesField] =
435 new ListConstantValue(listType, keyValuePairs); 438 new ListConstantValue(listType, keyValuePairs);
436 } 439 }
437 } 440 }
438 } 441 }
439 442
440 final _validLookupMapVersionConstraint = 443 final _validLookupMapVersionConstraint =
441 new VersionConstraint.parse('^0.0.1'); 444 new VersionConstraint.parse('^0.0.1');
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/js_interop_analysis.dart ('k') | pkg/compiler/lib/src/js_backend/namer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698