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 e3ea0863a755de386a432efbaf661f685e57d648..076f616eea1dfb910ebda322a58d4d4664473392 100644 |
--- a/pkg/compiler/lib/src/js_model/js_strategy.dart |
+++ b/pkg/compiler/lib/src/js_model/js_strategy.dart |
@@ -5,6 +5,7 @@ |
library dart2js.js_model.strategy; |
import '../backend_strategy.dart'; |
+import '../common/tasks.dart'; |
import '../common_elements.dart'; |
import '../compiler.dart'; |
import '../elements/elements.dart' show TypedefElement; |
@@ -18,7 +19,10 @@ import '../js_backend/backend_usage.dart'; |
import '../js_backend/constant_system_javascript.dart'; |
import '../js_backend/interceptor_data.dart'; |
import '../js_backend/native_data.dart'; |
+import '../kernel/element_map.dart'; |
+import '../kernel/element_map_impl.dart'; |
import '../kernel/kernel_backend_strategy.dart'; |
+import '../kernel/kernel_strategy.dart'; |
import '../ssa/ssa.dart'; |
import '../universe/class_set.dart'; |
import '../universe/world_builder.dart'; |
@@ -28,20 +32,23 @@ import 'elements.dart'; |
class JsBackendStrategy implements BackendStrategy { |
final Compiler _compiler; |
- final JsToFrontendMap _map = new JsToFrontendMap(); |
+ final JsToFrontendMap _map = new JsToFrontendMapImpl(); |
+ ElementEnvironment _elementEnvironment; |
+ CommonElements _commonElements; |
JsBackendStrategy(this._compiler); |
@override |
ClosedWorldRefiner createClosedWorldRefiner(ClosedWorld closedWorld) { |
- CommonElements commonElements = |
- new JsCommonElements(_map, closedWorld.commonElements); |
+ _elementEnvironment = |
+ new JsElementEnvironment(_map, closedWorld.elementEnvironment); |
+ _commonElements = new JsCommonElements(_map, closedWorld.commonElements); |
BackendUsage backendUsage = |
new JsBackendUsage(_map, closedWorld.backendUsage); |
NativeData nativeData = new JsNativeData(_map, closedWorld.nativeData); |
InterceptorData interceptorData = new InterceptorDataImpl( |
nativeData, |
- commonElements, |
+ _commonElements, |
// TODO(johnniwinther): Convert these. |
const {}, |
new Set(), |
@@ -89,9 +96,8 @@ class JsBackendStrategy implements BackendStrategy { |
}, ClassHierarchyNode.ALL); |
return new JsClosedWorld( |
- // TODO(johnniwinther): Create a JsElementEnvironment. |
- elementEnvironment: closedWorld.elementEnvironment, |
- commonElements: commonElements, |
+ elementEnvironment: _elementEnvironment, |
+ commonElements: _commonElements, |
constantSystem: const JavaScriptConstantSystem(), |
backendUsage: backendUsage, |
nativeData: nativeData, |
@@ -116,9 +122,13 @@ class JsBackendStrategy implements BackendStrategy { |
const JavaScriptSourceInformationStrategy(); |
@override |
- SsaBuilderTask createSsaBuilderTask(JavaScriptBackend backend, |
+ SsaBuilder createSsaBuilder(CompilerTask task, JavaScriptBackend backend, |
SourceInformationStrategy sourceInformationStrategy) { |
- return new KernelSsaBuilderTask(backend.compiler); |
+ KernelFrontEndStrategy strategy = backend.compiler.frontendStrategy; |
+ KernelToElementMap elementMap = strategy.elementMap; |
+ JsKernelToElementMap jsElementMap = new JsKernelToElementMap( |
+ _map, _elementEnvironment, _commonElements, elementMap); |
+ return new KernelSsaBuilder(task, backend.compiler, jsElementMap); |
} |
@override |