| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
| 6 | 6 |
| 7 import '../closure.dart'; | 7 import '../closure.dart'; |
| 8 import '../common/tasks.dart'; | 8 import '../common/tasks.dart'; |
| 9 import '../elements/entities.dart'; | 9 import '../elements/entities.dart'; |
| 10 import '../kernel/element_map.dart'; | 10 import '../kernel/element_map.dart'; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 /// http://siek.blogspot.com/2012/07/essence-of-closure-conversion.html or | 26 /// http://siek.blogspot.com/2012/07/essence-of-closure-conversion.html or |
| 27 /// http://matt.might.net/articles/closure-conversion/. | 27 /// http://matt.might.net/articles/closure-conversion/. |
| 28 // TODO(efortuna): Change inheritance hierarchy so that the | 28 // TODO(efortuna): Change inheritance hierarchy so that the |
| 29 // ClosureConversionTask doesn't inherit from ClosureTask because it's just a | 29 // ClosureConversionTask doesn't inherit from ClosureTask because it's just a |
| 30 // glorified timer. | 30 // glorified timer. |
| 31 class KernelClosureConversionTask extends ClosureConversionTask<ir.Node> { | 31 class KernelClosureConversionTask extends ClosureConversionTask<ir.Node> { |
| 32 final KernelToElementMapForBuilding _elementMap; | 32 final KernelToElementMapForBuilding _elementMap; |
| 33 final GlobalLocalsMap _globalLocalsMap; | 33 final GlobalLocalsMap _globalLocalsMap; |
| 34 | 34 |
| 35 /// Map of the scoping information that corresponds to a particular entity. | 35 /// Map of the scoping information that corresponds to a particular entity. |
| 36 /// This particular map contains ScopeInfos only for entities that are *not* | |
| 37 /// closures. Entities that are closures are stored in the | |
| 38 /// [_loopClosureScopeMap]. TODO!!! | |
| 39 Map<Entity, ScopeInfo> _scopeMap = <Entity, ScopeInfo>{}; | 36 Map<Entity, ScopeInfo> _scopeMap = <Entity, ScopeInfo>{}; |
| 40 Map<ir.Statement, LoopClosureScope> _loopClosureScopeMap = | 37 Map<ir.Statement, LoopClosureScope> _loopClosureScopeMap = |
| 41 <ir.Statement, LoopClosureScope>{}; | 38 <ir.Statement, LoopClosureScope>{}; |
| 42 | 39 |
| 43 Map<Entity, ClosureRepresentationInfo> _closureRepresentationMap = | 40 Map<Entity, ClosureRepresentationInfo> _closureRepresentationMap = |
| 44 <Entity, ClosureRepresentationInfo>{}; | 41 <Entity, ClosureRepresentationInfo>{}; |
| 45 | 42 |
| 46 /// Should only be used at the very beginning to ensure we are looking at the | 43 /// Should only be used at the very beginning to ensure we are looking at the |
| 47 /// right kind of elements. | 44 /// right kind of elements. |
| 48 // TODO(efortuna): Remove this map once we have one kernel backend strategy. | 45 // TODO(efortuna): Remove this map once we have one kernel backend strategy. |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // that (and the subsequent adjustment here) will follow soon. | 281 // that (and the subsequent adjustment here) will follow soon. |
| 285 bool get isClosure => false; | 282 bool get isClosure => false; |
| 286 | 283 |
| 287 bool get isAbstract => false; | 284 bool get isAbstract => false; |
| 288 | 285 |
| 289 // TODO(efortuna): Talk to Johnni. | 286 // TODO(efortuna): Talk to Johnni. |
| 290 JLibrary get library => null; | 287 JLibrary get library => null; |
| 291 | 288 |
| 292 String toString() => '${jsElementPrefix}class($name)'; | 289 String toString() => '${jsElementPrefix}class($name)'; |
| 293 } | 290 } |
| OLD | NEW |