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 '../dart_types.dart'; | 9 import '../dart_types.dart'; |
10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 /// The tree elements for the element being built into an SSA graph. | 40 /// The tree elements for the element being built into an SSA graph. |
41 TreeElements get elements; | 41 TreeElements get elements; |
42 | 42 |
43 CodegenRegistry get registry; | 43 CodegenRegistry get registry; |
44 | 44 |
45 ClosedWorld get closedWorld => compiler.closedWorld; | 45 ClosedWorld get closedWorld => compiler.closedWorld; |
46 | 46 |
47 CommonMasks get commonMasks => closedWorld.commonMasks; | 47 CommonMasks get commonMasks => closedWorld.commonMasks; |
48 | 48 |
| 49 GlobalTypeInferenceResults get globalInferenceResults => |
| 50 compiler.globalInference.results; |
| 51 |
49 /// Used to track the locals while building the graph. | 52 /// Used to track the locals while building the graph. |
50 LocalsHandler localsHandler; | 53 LocalsHandler localsHandler; |
51 | 54 |
52 /// A stack of instructions. | 55 /// A stack of instructions. |
53 /// | 56 /// |
54 /// We build the SSA graph by simulating a stack machine. | 57 /// We build the SSA graph by simulating a stack machine. |
55 List<HInstruction> stack = <HInstruction>[]; | 58 List<HInstruction> stack = <HInstruction>[]; |
56 | 59 |
57 /// The count of nested loops we are currently building. | 60 /// The count of nested loops we are currently building. |
58 /// | 61 /// |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 if (statements == null) return null; | 194 if (statements == null) return null; |
192 return new HSubGraphBlockInformation(statements); | 195 return new HSubGraphBlockInformation(statements); |
193 } | 196 } |
194 | 197 |
195 HSubExpressionBlockInformation wrapExpressionGraph(SubExpression expression) { | 198 HSubExpressionBlockInformation wrapExpressionGraph(SubExpression expression) { |
196 if (expression == null) return null; | 199 if (expression == null) return null; |
197 return new HSubExpressionBlockInformation(expression); | 200 return new HSubExpressionBlockInformation(expression); |
198 } | 201 } |
199 | 202 |
200 HInstruction buildFunctionType(FunctionType type) { | 203 HInstruction buildFunctionType(FunctionType type) { |
201 type.accept( | 204 type.accept(new ReifiedTypeRepresentationBuilder(closedWorld), this); |
202 new ReifiedTypeRepresentationBuilder(compiler.closedWorld), this); | |
203 return pop(); | 205 return pop(); |
204 } | 206 } |
205 | 207 |
206 HInstruction buildFunctionTypeConversion( | 208 HInstruction buildFunctionTypeConversion( |
207 HInstruction original, DartType type, int kind); | 209 HInstruction original, DartType type, int kind); |
208 | 210 |
209 /// Returns the current source element. | 211 /// Returns the current source element. |
210 /// | 212 /// |
211 /// The returned element is a declaration element. | 213 /// The returned element is a declaration element. |
212 Element get sourceElement; | 214 Element get sourceElement; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 331 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
330 unaliased.accept(this, builder); | 332 unaliased.accept(this, builder); |
331 } | 333 } |
332 | 334 |
333 void visitDynamicType(DynamicType type, GraphBuilder builder) { | 335 void visitDynamicType(DynamicType type, GraphBuilder builder) { |
334 JavaScriptBackend backend = builder.compiler.backend; | 336 JavaScriptBackend backend = builder.compiler.backend; |
335 ClassElement cls = backend.helpers.DynamicRuntimeType; | 337 ClassElement cls = backend.helpers.DynamicRuntimeType; |
336 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld))); | 338 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld))); |
337 } | 339 } |
338 } | 340 } |
OLD | NEW |