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

Unified Diff: pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart

Issue 2951723002: Add closure_test for kernel based members (Closed)
Patch Set: Cleanup 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/kernel/closure.dart ('k') | pkg/compiler/lib/src/source_file_provider.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
diff --git a/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart b/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
index 361fce7153e13137244b96b5e630506065349f25..316108f604e6a52e4117a3238f12e2f0efc76014 100644
--- a/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
@@ -37,22 +37,30 @@ import 'closure.dart';
import 'element_map_impl.dart';
import 'kernel_strategy.dart';
+/// A backend strategy based on Kernel IR nodes.
+abstract class KernelBackendStrategy implements BackendStrategy {
+ KernelToElementMap get elementMap;
+ GlobalLocalsMap get globalLocalsMapForTesting;
+}
+
/// Backend strategy that uses the kernel elements as the backend model.
// TODO(johnniwinther): Replace this with a strategy based on the J-element
// model.
-class KernelBackendStrategy implements BackendStrategy {
+class KernelBackendStrategyImpl implements KernelBackendStrategy {
final Compiler _compiler;
Sorter _sorter;
ClosureConversionTask _closureDataLookup;
- GlobalLocalsMap _globalLocalsMap = new GlobalLocalsMap();
+ final GlobalLocalsMap _globalLocalsMap = new GlobalLocalsMap();
- KernelBackendStrategy(this._compiler);
+ KernelBackendStrategyImpl(this._compiler);
- KernelToElementMap get _elementMap {
+ KernelToElementMap get elementMap {
KernelFrontEndStrategy frontendStrategy = _compiler.frontendStrategy;
return frontendStrategy.elementMap;
}
+ GlobalLocalsMap get globalLocalsMapForTesting => _globalLocalsMap;
+
@override
ClosedWorldRefiner createClosedWorldRefiner(
covariant KernelClosedWorld closedWorld) {
@@ -62,8 +70,7 @@ class KernelBackendStrategy implements BackendStrategy {
@override
Sorter get sorter {
if (_sorter == null) {
- KernelFrontEndStrategy frontendStrategy = _compiler.frontendStrategy;
- _sorter = new KernelSorter(frontendStrategy.elementMap);
+ _sorter = new KernelSorter(elementMap);
}
return _sorter;
}
@@ -71,7 +78,7 @@ class KernelBackendStrategy implements BackendStrategy {
@override
ClosureConversionTask get closureDataLookup =>
_closureDataLookup ??= new KernelClosureConversionTask(
- _compiler.measurer, _elementMap, _globalLocalsMap);
+ _compiler.measurer, elementMap, _globalLocalsMap);
@override
WorkItemBuilder createCodegenWorkItemBuilder(ClosedWorld closedWorld) {
@@ -84,7 +91,7 @@ class KernelBackendStrategy implements BackendStrategy {
ClosedWorld closedWorld,
SelectorConstraintsStrategy selectorConstraintsStrategy) {
return new KernelCodegenWorldBuilder(
- _elementMap,
+ elementMap,
closedWorld.elementEnvironment,
nativeBasicData,
closedWorld,
@@ -95,7 +102,7 @@ class KernelBackendStrategy implements BackendStrategy {
SsaBuilder createSsaBuilder(CompilerTask task, JavaScriptBackend backend,
SourceInformationStrategy sourceInformationStrategy) {
return new KernelSsaBuilder(
- task, backend.compiler, _elementMap, _globalLocalsMap);
+ task, backend.compiler, elementMap, _globalLocalsMap);
}
@override
« no previous file with comments | « pkg/compiler/lib/src/kernel/closure.dart ('k') | pkg/compiler/lib/src/source_file_provider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698