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

Unified Diff: pkg/compiler/lib/src/ssa/types_propagation.dart

Issue 2814453005: Merge CommonElements and BackendHelpers! (Closed)
Patch Set: comments and re-merge, take two Created 3 years, 8 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/ssa/optimize.dart ('k') | pkg/compiler/lib/src/ssa/value_range_analyzer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/types_propagation.dart
diff --git a/pkg/compiler/lib/src/ssa/types_propagation.dart b/pkg/compiler/lib/src/ssa/types_propagation.dart
index 7db5f0521277a5914cb8028552fd1d8f315427c1..ce1b6d5d218ca96155091b8f9368874be583d32a 100644
--- a/pkg/compiler/lib/src/ssa/types_propagation.dart
+++ b/pkg/compiler/lib/src/ssa/types_propagation.dart
@@ -2,8 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import '../common_elements.dart' show CommonElements;
import '../elements/entities.dart';
-import '../js_backend/backend_helpers.dart';
import '../options.dart';
import '../types/types.dart';
import '../universe/selector.dart' show Selector;
@@ -19,11 +19,12 @@ class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase {
final GlobalTypeInferenceResults results;
final CompilerOptions options;
- final BackendHelpers helpers;
+ final CommonElements commonElements;
final ClosedWorld closedWorld;
String get name => 'type propagator';
- SsaTypePropagator(this.results, this.options, this.helpers, this.closedWorld);
+ SsaTypePropagator(
+ this.results, this.options, this.commonElements, this.closedWorld);
TypeMask computeType(HInstruction instruction) {
return instruction.accept(this);
@@ -285,7 +286,7 @@ class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase {
TypeMask type = new TypeMask.nonNullSubclass(cls, closedWorld);
// TODO(ngeoffray): We currently only optimize on primitive
// types.
- if (!type.satisfies(helpers.jsIndexableClass, closedWorld) &&
+ if (!type.satisfies(commonElements.jsIndexableClass, closedWorld) &&
!type.containsOnlyNum(closedWorld) &&
!type.containsOnlyBool(closedWorld)) {
return false;
@@ -418,7 +419,7 @@ class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase {
}
}
- return instruction.specializer.computeTypeFromInputTypes(
- instruction, results, options, helpers, closedWorld);
+ return instruction.specializer
+ .computeTypeFromInputTypes(instruction, results, options, closedWorld);
}
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | pkg/compiler/lib/src/ssa/value_range_analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698