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 '../constants/constant_system.dart'; | 6 import '../constants/constant_system.dart'; |
7 import '../common/codegen.dart' show CodegenRegistry; | 7 import '../common/codegen.dart' show CodegenRegistry; |
8 import '../common_elements.dart'; | 8 import '../common_elements.dart'; |
9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
| 10 import '../deferred_load.dart'; |
10 import '../diagnostics/diagnostic_listener.dart'; | 11 import '../diagnostics/diagnostic_listener.dart'; |
11 import '../elements/elements.dart'; | 12 import '../elements/elements.dart'; |
12 import '../elements/entities.dart' show Entity, Local; | 13 import '../elements/entities.dart' show Entity, Local; |
13 import '../elements/resolution_types.dart'; | 14 import '../elements/resolution_types.dart'; |
14 import '../js_backend/backend_helpers.dart'; | 15 import '../js_backend/backend_helpers.dart'; |
15 import '../js_backend/backend_usage.dart'; | 16 import '../js_backend/backend_usage.dart'; |
16 import '../js_backend/constant_handler_javascript.dart'; | 17 import '../js_backend/constant_handler_javascript.dart'; |
17 import '../js_backend/js_backend.dart'; | 18 import '../js_backend/js_backend.dart'; |
18 import '../js_backend/native_data.dart'; | 19 import '../js_backend/native_data.dart'; |
19 import '../js_backend/js_interop_analysis.dart'; | 20 import '../js_backend/js_interop_analysis.dart'; |
(...skipping 12 matching lines...) Expand all Loading... |
32 /// Base class for objects that build up an SSA graph. | 33 /// Base class for objects that build up an SSA graph. |
33 /// | 34 /// |
34 /// This contains helpers for building the graph and tracking information about | 35 /// This contains helpers for building the graph and tracking information about |
35 /// the current state of the graph being built. | 36 /// the current state of the graph being built. |
36 abstract class GraphBuilder { | 37 abstract class GraphBuilder { |
37 /// Holds the resulting SSA graph. | 38 /// Holds the resulting SSA graph. |
38 final HGraph graph = new HGraph(); | 39 final HGraph graph = new HGraph(); |
39 | 40 |
40 // TODO(het): remove this | 41 // TODO(het): remove this |
41 /// A reference to the compiler. | 42 /// A reference to the compiler. |
42 Compiler compiler; | 43 Compiler get compiler; |
43 | 44 |
44 /// True if the builder is processing nodes inside a try statement. This is | 45 /// True if the builder is processing nodes inside a try statement. This is |
45 /// important for generating control flow out of a try block like returns or | 46 /// important for generating control flow out of a try block like returns or |
46 /// breaks. | 47 /// breaks. |
47 bool inTryStatement = false; | 48 bool inTryStatement = false; |
48 | 49 |
49 /// The tree elements for the element being built into an SSA graph. | 50 /// The tree elements for the element being built into an SSA graph. |
50 TreeElements get elements; | 51 TreeElements get elements; |
51 | 52 |
52 /// The JavaScript backend we are targeting in this compilation. | 53 /// The JavaScript backend we are targeting in this compilation. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 BackendHelpers get helpers => backend.helpers; | 89 BackendHelpers get helpers => backend.helpers; |
89 | 90 |
90 RuntimeTypesEncoder get rtiEncoder => backend.rtiEncoder; | 91 RuntimeTypesEncoder get rtiEncoder => backend.rtiEncoder; |
91 | 92 |
92 FunctionInlineCache get inlineCache => backend.inlineCache; | 93 FunctionInlineCache get inlineCache => backend.inlineCache; |
93 | 94 |
94 MirrorsData get mirrorsData => backend.mirrorsData; | 95 MirrorsData get mirrorsData => backend.mirrorsData; |
95 | 96 |
96 JsInteropAnalysis get jsInteropAnalysis => backend.jsInteropAnalysis; | 97 JsInteropAnalysis get jsInteropAnalysis => backend.jsInteropAnalysis; |
97 | 98 |
| 99 DeferredLoadTask get deferredLoadTask => compiler.deferredLoadTask; |
| 100 |
| 101 Types get types => compiler.types; |
| 102 |
98 /// Used to track the locals while building the graph. | 103 /// Used to track the locals while building the graph. |
99 LocalsHandler localsHandler; | 104 LocalsHandler localsHandler; |
100 | 105 |
101 /// A stack of instructions. | 106 /// A stack of instructions. |
102 /// | 107 /// |
103 /// We build the SSA graph by simulating a stack machine. | 108 /// We build the SSA graph by simulating a stack machine. |
104 List<HInstruction> stack = <HInstruction>[]; | 109 List<HInstruction> stack = <HInstruction>[]; |
105 | 110 |
106 /// The count of nested loops we are currently building. | 111 /// The count of nested loops we are currently building. |
107 /// | 112 /// |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 open(newBlock); | 278 open(newBlock); |
274 } | 279 } |
275 | 280 |
276 HInstruction callSetRuntimeTypeInfo( | 281 HInstruction callSetRuntimeTypeInfo( |
277 HInstruction typeInfo, HInstruction newObject); | 282 HInstruction typeInfo, HInstruction newObject); |
278 | 283 |
279 /// The element for which this SSA builder is being used. | 284 /// The element for which this SSA builder is being used. |
280 Element get targetElement; | 285 Element get targetElement; |
281 TypeBuilder get typeBuilder; | 286 TypeBuilder get typeBuilder; |
282 } | 287 } |
OLD | NEW |