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

Side by Side Diff: pkg/compiler/lib/src/ssa/value_range_analyzer.dart

Issue 2302363003: No longer store the compilation-context in WorkItem. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import '../common/codegen.dart' show CodegenWorkItem;
6 import '../compiler.dart' show Compiler; 5 import '../compiler.dart' show Compiler;
7 import '../constant_system_dart.dart'; 6 import '../constant_system_dart.dart';
8 import '../constants/constant_system.dart'; 7 import '../constants/constant_system.dart';
9 import '../constants/values.dart'; 8 import '../constants/values.dart';
10 import '../js_backend/js_backend.dart'; 9 import '../js_backend/js_backend.dart';
11 import 'nodes.dart'; 10 import 'nodes.dart';
12 import 'optimize.dart'; 11 import 'optimize.dart';
13 12
14 class ValueRangeInfo { 13 class ValueRangeInfo {
15 final ConstantSystem constantSystem; 14 final ConstantSystem constantSystem;
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 * Value ranges for integer instructions. This map gets populated by 598 * Value ranges for integer instructions. This map gets populated by
600 * the dominator tree visit. 599 * the dominator tree visit.
601 */ 600 */
602 final Map<HInstruction, Range> ranges = new Map<HInstruction, Range>(); 601 final Map<HInstruction, Range> ranges = new Map<HInstruction, Range>();
603 602
604 final Compiler compiler; 603 final Compiler compiler;
605 final ConstantSystem constantSystem; 604 final ConstantSystem constantSystem;
606 final ValueRangeInfo info; 605 final ValueRangeInfo info;
607 final SsaOptimizerTask optimizer; 606 final SsaOptimizerTask optimizer;
608 607
609 CodegenWorkItem work;
610 HGraph graph; 608 HGraph graph;
611 609
612 SsaValueRangeAnalyzer( 610 SsaValueRangeAnalyzer(
613 this.compiler, constantSystem, this.optimizer, this.work) 611 this.compiler, constantSystem, this.optimizer)
614 : info = new ValueRangeInfo(constantSystem), 612 : info = new ValueRangeInfo(constantSystem),
615 this.constantSystem = constantSystem; 613 this.constantSystem = constantSystem;
616 614
617 void visitGraph(HGraph graph) { 615 void visitGraph(HGraph graph) {
618 this.graph = graph; 616 this.graph = graph;
619 visitDominatorTree(graph); 617 visitDominatorTree(graph);
620 // We remove the range conversions after visiting the graph so 618 // We remove the range conversions after visiting the graph so
621 // that the graph does not get polluted with these instructions 619 // that the graph does not get polluted with these instructions
622 // only necessary for this phase. 620 // only necessary for this phase.
623 removeRangeConversion(); 621 removeRangeConversion();
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 } 1080 }
1083 1081
1084 Range handleBinaryOperation(HBinaryArithmetic instruction) { 1082 Range handleBinaryOperation(HBinaryArithmetic instruction) {
1085 Range leftRange = visit(instruction.left); 1083 Range leftRange = visit(instruction.left);
1086 Range rightRange = visit(instruction.right); 1084 Range rightRange = visit(instruction.right);
1087 if (leftRange == null || rightRange == null) return null; 1085 if (leftRange == null || rightRange == null) return null;
1088 BinaryOperation operation = instruction.operation(info.constantSystem); 1086 BinaryOperation operation = instruction.operation(info.constantSystem);
1089 return operation.apply(leftRange, rightRange); 1087 return operation.apply(leftRange, rightRange);
1090 } 1088 }
1091 } 1089 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698