| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 '../closure.dart'; | |
| 6 import '../common.dart'; | |
| 7 import '../common/codegen.dart' show CodegenRegistry; | 5 import '../common/codegen.dart' show CodegenRegistry; |
| 8 import '../compiler.dart'; | 6 import '../compiler.dart'; |
| 9 import '../constants/constant_system.dart'; | |
| 10 import '../elements/resolution_types.dart'; | 7 import '../elements/resolution_types.dart'; |
| 11 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
| 12 import '../io/source_information.dart'; | |
| 13 import '../js_backend/js_backend.dart'; | 9 import '../js_backend/js_backend.dart'; |
| 14 import '../resolution/tree_elements.dart'; | 10 import '../resolution/tree_elements.dart'; |
| 15 import '../tree/tree.dart' as ast; | 11 import '../tree/tree.dart' as ast; |
| 16 import '../types/types.dart'; | 12 import '../types/types.dart'; |
| 17 import '../universe/call_structure.dart' show CallStructure; | |
| 18 import '../universe/use.dart' show TypeUse; | |
| 19 import '../world.dart' show ClosedWorld; | 13 import '../world.dart' show ClosedWorld; |
| 20 import 'jump_handler.dart'; | 14 import 'jump_handler.dart'; |
| 21 import 'locals_handler.dart'; | 15 import 'locals_handler.dart'; |
| 22 import 'nodes.dart'; | 16 import 'nodes.dart'; |
| 23 import 'ssa_branch_builder.dart'; | |
| 24 import 'type_builder.dart'; | 17 import 'type_builder.dart'; |
| 25 | 18 |
| 26 /// Base class for objects that build up an SSA graph. | 19 /// Base class for objects that build up an SSA graph. |
| 27 /// | 20 /// |
| 28 /// This contains helpers for building the graph and tracking information about | 21 /// This contains helpers for building the graph and tracking information about |
| 29 /// the current state of the graph being built. | 22 /// the current state of the graph being built. |
| 30 abstract class GraphBuilder { | 23 abstract class GraphBuilder { |
| 31 /// Holds the resulting SSA graph. | 24 /// Holds the resulting SSA graph. |
| 32 final HGraph graph = new HGraph(); | 25 final HGraph graph = new HGraph(); |
| 33 | 26 |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 if (unaliased is ResolutionTypedefType) throw 'unable to unalias $type'; | 328 if (unaliased is ResolutionTypedefType) throw 'unable to unalias $type'; |
| 336 unaliased.accept(this, builder); | 329 unaliased.accept(this, builder); |
| 337 } | 330 } |
| 338 | 331 |
| 339 void visitDynamicType(ResolutionDynamicType type, GraphBuilder builder) { | 332 void visitDynamicType(ResolutionDynamicType type, GraphBuilder builder) { |
| 340 JavaScriptBackend backend = builder.compiler.backend; | 333 JavaScriptBackend backend = builder.compiler.backend; |
| 341 ClassElement cls = backend.helpers.DynamicRuntimeType; | 334 ClassElement cls = backend.helpers.DynamicRuntimeType; |
| 342 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld))); | 335 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld))); |
| 343 } | 336 } |
| 344 } | 337 } |
| OLD | NEW |