| 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'; | 5 import '../closure.dart'; |
| 6 import '../common.dart'; | 6 import '../common.dart'; |
| 7 import '../common/codegen.dart' show CodegenRegistry; | 7 import '../common/codegen.dart' show CodegenRegistry; |
| 8 import '../compiler.dart'; | 8 import '../compiler.dart'; |
| 9 import '../constants/constant_system.dart'; | 9 import '../constants/constant_system.dart'; |
| 10 import '../elements/resolution_types.dart'; | 10 import '../elements/resolution_types.dart'; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 /// This contains helpers for building the graph and tracking information about | 28 /// This contains helpers for building the graph and tracking information about |
| 29 /// the current state of the graph being built. | 29 /// the current state of the graph being built. |
| 30 abstract class GraphBuilder { | 30 abstract class GraphBuilder { |
| 31 /// Holds the resulting SSA graph. | 31 /// Holds the resulting SSA graph. |
| 32 final HGraph graph = new HGraph(); | 32 final HGraph graph = new HGraph(); |
| 33 | 33 |
| 34 // TODO(het): remove this | 34 // TODO(het): remove this |
| 35 /// A reference to the compiler. | 35 /// A reference to the compiler. |
| 36 Compiler compiler; | 36 Compiler compiler; |
| 37 | 37 |
| 38 /// The tree elements for the element being built into an SSA graph. |
| 39 TreeElements get elements; |
| 40 |
| 38 /// The JavaScript backend we are targeting in this compilation. | 41 /// The JavaScript backend we are targeting in this compilation. |
| 39 JavaScriptBackend get backend; | 42 JavaScriptBackend get backend; |
| 40 | 43 |
| 41 /// The tree elements for the element being built into an SSA graph. | |
| 42 TreeElements get elements; | |
| 43 | |
| 44 CodegenRegistry get registry; | 44 CodegenRegistry get registry; |
| 45 | 45 |
| 46 ClosedWorld get closedWorld; | 46 ClosedWorld get closedWorld; |
| 47 | 47 |
| 48 CommonMasks get commonMasks => closedWorld.commonMasks; | 48 CommonMasks get commonMasks => closedWorld.commonMasks; |
| 49 | 49 |
| 50 GlobalTypeInferenceResults get globalInferenceResults => | 50 GlobalTypeInferenceResults get globalInferenceResults => |
| 51 compiler.globalInference.results; | 51 compiler.globalInference.results; |
| 52 | 52 |
| 53 /// Used to track the locals while building the graph. | 53 /// Used to track the locals while building the graph. |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 if (unaliased is ResolutionTypedefType) throw 'unable to unalias $type'; | 339 if (unaliased is ResolutionTypedefType) throw 'unable to unalias $type'; |
| 340 unaliased.accept(this, builder); | 340 unaliased.accept(this, builder); |
| 341 } | 341 } |
| 342 | 342 |
| 343 void visitDynamicType(ResolutionDynamicType type, GraphBuilder builder) { | 343 void visitDynamicType(ResolutionDynamicType type, GraphBuilder builder) { |
| 344 JavaScriptBackend backend = builder.compiler.backend; | 344 JavaScriptBackend backend = builder.compiler.backend; |
| 345 ClassElement cls = backend.helpers.DynamicRuntimeType; | 345 ClassElement cls = backend.helpers.DynamicRuntimeType; |
| 346 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld))); | 346 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld))); |
| 347 } | 347 } |
| 348 } | 348 } |
| OLD | NEW |