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

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

Issue 2777163002: Make codegen and optimizations depend more directly on data objects. (Closed)
Patch Set: Created 3 years, 9 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/variable_allocator.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 5b1473a762adc9f103ad32226529370853bdb82b..49aa6f99cf3d19f255376d32cdcc2a7465b6ea71 100644
--- a/pkg/compiler/lib/src/ssa/types_propagation.dart
+++ b/pkg/compiler/lib/src/ssa/types_propagation.dart
@@ -2,9 +2,9 @@
// 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 '../compiler.dart' show Compiler;
import '../elements/entities.dart';
-import '../js_backend/js_backend.dart';
+import '../js_backend/backend_helpers.dart';
+import '../options.dart';
import '../types/types.dart';
import '../universe/selector.dart' show Selector;
import '../world.dart' show ClosedWorld;
@@ -17,12 +17,13 @@ class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase {
final Map<HInstruction, Function> pendingOptimizations =
new Map<HInstruction, Function>();
- final Compiler compiler;
+ final GlobalTypeInferenceResults results;
+ final CompilerOptions options;
+ final BackendHelpers helpers;
final ClosedWorld closedWorld;
- JavaScriptBackend get backend => compiler.backend;
String get name => 'type propagator';
- SsaTypePropagator(this.compiler, this.closedWorld);
+ SsaTypePropagator(this.results, this.options, this.helpers, this.closedWorld);
TypeMask computeType(HInstruction instruction) {
return instruction.accept(this);
@@ -284,7 +285,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(backend.helpers.jsIndexableClass, closedWorld) &&
+ if (!type.satisfies(helpers.jsIndexableClass, closedWorld) &&
!type.containsOnlyNum(closedWorld) &&
!type.containsOnlyBool(closedWorld)) {
return false;
@@ -304,7 +305,7 @@ class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase {
// Return true if the argument type check was added.
bool checkArgument(HInvokeDynamic instruction) {
// We want the right error in checked mode.
- if (compiler.options.enableTypeAssertions) return false;
+ if (options.enableTypeAssertions) return false;
HInstruction left = instruction.inputs[1];
HInstruction right = instruction.inputs[2];
@@ -412,7 +413,7 @@ class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase {
}
}
- return instruction.specializer
- .computeTypeFromInputTypes(instruction, compiler, closedWorld);
+ return instruction.specializer.computeTypeFromInputTypes(
+ instruction, results, options, helpers, closedWorld);
}
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | pkg/compiler/lib/src/ssa/variable_allocator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698