| 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 part of world_builder; | 5 part of world_builder; |
| 6 | 6 |
| 7 /// World builder specific to codegen. | 7 /// World builder specific to codegen. |
| 8 /// | 8 /// |
| 9 /// This adds additional access to liveness of selectors and elements. | 9 /// This adds additional access to liveness of selectors and elements. |
| 10 abstract class CodegenWorldBuilder implements WorldBuilder { | 10 abstract class CodegenWorldBuilder implements WorldBuilder { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 Iterable<FunctionElement> get staticFunctionsNeedingGetter; | 41 Iterable<FunctionElement> get staticFunctionsNeedingGetter; |
| 42 Iterable<FunctionElement> get methodsNeedingSuperGetter; | 42 Iterable<FunctionElement> get methodsNeedingSuperGetter; |
| 43 | 43 |
| 44 /// The set of all referenced static fields. | 44 /// The set of all referenced static fields. |
| 45 /// | 45 /// |
| 46 /// Invariant: Elements are declaration elements. | 46 /// Invariant: Elements are declaration elements. |
| 47 Iterable<FieldElement> get allReferencedStaticFields; | 47 Iterable<FieldElement> get allReferencedStaticFields; |
| 48 } | 48 } |
| 49 | 49 |
| 50 class CodegenWorldBuilderImpl implements CodegenWorldBuilder { | 50 class CodegenWorldBuilderImpl implements CodegenWorldBuilder { |
| 51 final NativeClassData _nativeData; | 51 final NativeBasicData _nativeData; |
| 52 final ClosedWorld _world; | 52 final ClosedWorld _world; |
| 53 final JavaScriptConstantCompiler _constants; | 53 final JavaScriptConstantCompiler _constants; |
| 54 | 54 |
| 55 /// The set of all directly instantiated classes, that is, classes with a | 55 /// The set of all directly instantiated classes, that is, classes with a |
| 56 /// generative constructor that has been called directly and not only through | 56 /// generative constructor that has been called directly and not only through |
| 57 /// a super-call. | 57 /// a super-call. |
| 58 /// | 58 /// |
| 59 /// Invariant: Elements are declaration elements. | 59 /// Invariant: Elements are declaration elements. |
| 60 // TODO(johnniwinther): [_directlyInstantiatedClasses] and | 60 // TODO(johnniwinther): [_directlyInstantiatedClasses] and |
| 61 // [_instantiatedTypes] sets should be merged. | 61 // [_instantiatedTypes] sets should be merged. |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 | 488 |
| 489 /// Register the constant [use] with this world builder. Returns `true` if | 489 /// Register the constant [use] with this world builder. Returns `true` if |
| 490 /// the constant use was new to the world. | 490 /// the constant use was new to the world. |
| 491 bool registerConstantUse(ConstantUse use) { | 491 bool registerConstantUse(ConstantUse use) { |
| 492 if (use.kind == ConstantUseKind.DIRECT) { | 492 if (use.kind == ConstantUseKind.DIRECT) { |
| 493 _constants.addCompileTimeConstantForEmission(use.value); | 493 _constants.addCompileTimeConstantForEmission(use.value); |
| 494 } | 494 } |
| 495 return _constantValues.add(use.value); | 495 return _constantValues.add(use.value); |
| 496 } | 496 } |
| 497 } | 497 } |
| OLD | NEW |