OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library dart2js.cps_ir.type_propagation; | 4 library dart2js.cps_ir.type_propagation; |
5 | 5 |
6 import 'optimizers.dart'; | 6 import 'optimizers.dart'; |
7 | 7 |
8 import '../closure.dart' show | 8 import '../closure.dart' show |
9 ClosureClassElement; | 9 ClosureClassElement; |
10 import '../common/names.dart' show | 10 import '../common/names.dart' show |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 final CpsFunctionCompiler _functionCompiler; | 348 final CpsFunctionCompiler _functionCompiler; |
349 final ConstantPropagationLattice _lattice; | 349 final ConstantPropagationLattice _lattice; |
350 final dart2js.InternalErrorFunction _internalError; | 350 final dart2js.InternalErrorFunction _internalError; |
351 final Map<Variable, ConstantValue> _values = <Variable, ConstantValue>{}; | 351 final Map<Variable, ConstantValue> _values = <Variable, ConstantValue>{}; |
352 final TypeMaskSystem _typeSystem; | 352 final TypeMaskSystem _typeSystem; |
353 | 353 |
354 TypePropagator(dart2js.Compiler compiler, | 354 TypePropagator(dart2js.Compiler compiler, |
355 TypeMaskSystem typeSystem, | 355 TypeMaskSystem typeSystem, |
356 this._functionCompiler) | 356 this._functionCompiler) |
357 : _compiler = compiler, | 357 : _compiler = compiler, |
358 _internalError = compiler.internalError, | 358 _internalError = compiler.reporter.internalError, |
359 _typeSystem = typeSystem, | 359 _typeSystem = typeSystem, |
360 _lattice = new ConstantPropagationLattice( | 360 _lattice = new ConstantPropagationLattice( |
361 typeSystem, | 361 typeSystem, |
362 compiler.backend.constantSystem, | 362 compiler.backend.constantSystem, |
363 compiler.types); | 363 compiler.types); |
364 | 364 |
365 @override | 365 @override |
366 void rewrite(FunctionDefinition root) { | 366 void rewrite(FunctionDefinition root) { |
367 // Set all parent pointers. | 367 // Set all parent pointers. |
368 new ParentVisitor().visit(root); | 368 new ParentVisitor().visit(root); |
(...skipping 2277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2646 processLetPrim(LetPrim node) { | 2646 processLetPrim(LetPrim node) { |
2647 node.primitive.type = null; | 2647 node.primitive.type = null; |
2648 values[node.primitive] = null; | 2648 values[node.primitive] = null; |
2649 } | 2649 } |
2650 | 2650 |
2651 processLetMutable(LetMutable node) { | 2651 processLetMutable(LetMutable node) { |
2652 node.variable.type = null; | 2652 node.variable.type = null; |
2653 values[node.variable] = null; | 2653 values[node.variable] = null; |
2654 } | 2654 } |
2655 } | 2655 } |
OLD | NEW |