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

Unified Diff: pkg/compiler/lib/src/js_model/js_strategy.dart

Issue 2972523002: Implement JsKernelToElementMap through KernelToElementMapBase (Closed)
Patch Set: Updated cf. comments Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/js_model/elements.dart ('k') | pkg/compiler/lib/src/kernel/element_map_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_model/js_strategy.dart
diff --git a/pkg/compiler/lib/src/js_model/js_strategy.dart b/pkg/compiler/lib/src/js_model/js_strategy.dart
index ad2679edabdc73c53be5d70395a1d5785045a850..138c6cc3f3496604ecd845ad337e39a3f4591e04 100644
--- a/pkg/compiler/lib/src/js_model/js_strategy.dart
+++ b/pkg/compiler/lib/src/js_model/js_strategy.dart
@@ -34,10 +34,9 @@ import 'locals.dart';
class JsBackendStrategy implements KernelBackendStrategy {
final Compiler _compiler;
- final JsToFrontendMap _map = new JsToFrontendMapImpl();
ElementEnvironment _elementEnvironment;
CommonElements _commonElements;
- KernelToElementMapForBuilding _elementMap;
+ JsKernelToElementMap _elementMap;
ClosureConversionTask _closureDataLookup;
final GlobalLocalsMap _globalLocalsMap = new GlobalLocalsMap();
Sorter _sorter;
@@ -45,17 +44,8 @@ class JsBackendStrategy implements KernelBackendStrategy {
JsBackendStrategy(this._compiler);
KernelToElementMapForBuilding get elementMap {
- if (_elementMap == null) {
- KernelFrontEndStrategy strategy = _compiler.frontendStrategy;
- KernelToElementMapForImpact elementMap = strategy.elementMap;
- _elementMap = new JsKernelToElementMap(
- _compiler.reporter,
- _compiler.environment,
- _map,
- _elementEnvironment,
- _commonElements,
- elementMap);
- }
+ assert(_elementMap != null,
+ "JsBackendStrategy.elementMap has not been created yet.");
return _elementMap;
}
@@ -63,9 +53,13 @@ class JsBackendStrategy implements KernelBackendStrategy {
@override
ClosedWorldRefiner createClosedWorldRefiner(ClosedWorld closedWorld) {
- _elementEnvironment =
- new JsElementEnvironment(_map, closedWorld.elementEnvironment);
- _commonElements = new JsCommonElements(_map, closedWorld.commonElements);
+ KernelFrontEndStrategy strategy = _compiler.frontendStrategy;
+ KernelToElementMapForImpact elementMap = strategy.elementMap;
+ _elementMap = new JsKernelToElementMap(
+ _compiler.reporter, _compiler.environment, elementMap);
+ _elementEnvironment = _elementMap.elementEnvironment;
+ _commonElements = _elementMap.commonElements;
+ JsToFrontendMap _map = _elementMap.jsToFrontendMap;
BackendUsage backendUsage =
new JsBackendUsage(_map, closedWorld.backendUsage);
NativeData nativeData = new JsNativeData(_map, closedWorld.nativeData);
« no previous file with comments | « pkg/compiler/lib/src/js_model/elements.dart ('k') | pkg/compiler/lib/src/kernel/element_map_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698