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

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

Issue 2937203002: Add J-elements (Closed)
Patch Set: Updated cf. comments Created 3 years, 6 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.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 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
« no previous file with comments | « pkg/compiler/lib/src/js_model/elements.dart ('k') | pkg/compiler/lib/src/kernel/element_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698