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 library dart2js.kernel.backend_strategy; | 5 library dart2js.kernel.backend_strategy; |
6 | 6 |
7 import 'package:kernel/ast.dart' as ir; | 7 import 'package:kernel/ast.dart' as ir; |
8 | 8 |
9 import '../backend_strategy.dart'; | 9 import '../backend_strategy.dart'; |
10 import '../common.dart'; | 10 import '../common.dart'; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 class KernelCodegenWorkItemBuilder implements WorkItemBuilder { | 44 class KernelCodegenWorkItemBuilder implements WorkItemBuilder { |
45 final JavaScriptBackend _backend; | 45 final JavaScriptBackend _backend; |
46 final ClosedWorld _closedWorld; | 46 final ClosedWorld _closedWorld; |
47 | 47 |
48 KernelCodegenWorkItemBuilder(this._backend, this._closedWorld); | 48 KernelCodegenWorkItemBuilder(this._backend, this._closedWorld); |
49 | 49 |
50 CompilerOptions get _options => _backend.compiler.options; | 50 CompilerOptions get _options => _backend.compiler.options; |
51 | 51 |
52 @override | 52 @override |
53 CodegenWorkItem createWorkItem(MemberEntity entity) { | 53 CodegenWorkItem createWorkItem(MemberEntity entity) { |
| 54 if (entity.isAbstract) return null; |
| 55 |
54 // Codegen inlines field initializers. It only needs to generate | 56 // Codegen inlines field initializers. It only needs to generate |
55 // code for checked setters. | 57 // code for checked setters. |
56 if (entity.isField && entity.isInstanceMember) { | 58 if (entity.isField && entity.isInstanceMember) { |
57 if (!_options.enableTypeAssertions || entity.enclosingClass.isClosure) { | 59 if (!_options.enableTypeAssertions || entity.enclosingClass.isClosure) { |
58 return null; | 60 return null; |
59 } | 61 } |
60 } | 62 } |
61 | 63 |
62 return new KernelCodegenWorkItem(_backend, _closedWorld, entity); | 64 return new KernelCodegenWorkItem(_backend, _closedWorld, entity); |
63 } | 65 } |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 return sorted; | 268 return sorted; |
267 } | 269 } |
268 | 270 |
269 @override | 271 @override |
270 Iterable<TypedefEntity> sortTypedefs(Iterable<TypedefEntity> typedefs) { | 272 Iterable<TypedefEntity> sortTypedefs(Iterable<TypedefEntity> typedefs) { |
271 // TODO(redemption): Support this. | 273 // TODO(redemption): Support this. |
272 assert(typedefs.isEmpty); | 274 assert(typedefs.isEmpty); |
273 return typedefs; | 275 return typedefs; |
274 } | 276 } |
275 } | 277 } |
OLD | NEW |