OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 resolution; | 5 part of resolution; |
6 | 6 |
7 abstract class TreeElements { | 7 abstract class TreeElements { |
8 Element get currentElement; | 8 Element get currentElement; |
9 Set<Node> get superUses; | 9 Set<Node> get superUses; |
10 | 10 |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 } | 447 } |
448 ResolverVisitor visitor = visitorFor(element); | 448 ResolverVisitor visitor = visitorFor(element); |
449 visitor.useElement(tree, element); | 449 visitor.useElement(tree, element); |
450 | 450 |
451 // TODO(johnniwinther): Avoid analyzing initializers if | 451 // TODO(johnniwinther): Avoid analyzing initializers if |
452 // [Compiler.analyzeSignaturesOnly] is set. | 452 // [Compiler.analyzeSignaturesOnly] is set. |
453 initializerDo(tree, visitor.visit); | 453 initializerDo(tree, visitor.visit); |
454 | 454 |
455 if (Elements.isStaticOrTopLevelField(element)) { | 455 if (Elements.isStaticOrTopLevelField(element)) { |
456 if (tree.asSendSet() != null) { | 456 if (tree.asSendSet() != null) { |
457 // TODO(ngeoffray): We could do better here by using the | 457 // TODO(13429): We could do better here by using the |
458 // constant handler to figure out if it's a lazy field or not. | 458 // constant handler to figure out if it's a lazy field or not. |
459 compiler.backend.registerLazyField(visitor.mapping); | 459 compiler.backend.registerLazyField(visitor.mapping); |
460 } else { | 460 } else { |
461 compiler.enqueuer.resolution.registerInstantiatedClass( | 461 compiler.enqueuer.resolution.registerInstantiatedClass( |
462 compiler.nullClass, visitor.mapping); | 462 compiler.nullClass, visitor.mapping); |
463 } | 463 } |
464 } | 464 } |
465 | 465 |
466 // Perform various checks as side effect of "computing" the type. | 466 // Perform various checks as side effect of "computing" the type. |
467 element.computeType(compiler); | 467 element.computeType(compiler); |
(...skipping 3874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4342 return e; | 4342 return e; |
4343 } | 4343 } |
4344 | 4344 |
4345 /// Assumed to be called by [resolveRedirectingFactory]. | 4345 /// Assumed to be called by [resolveRedirectingFactory]. |
4346 Element visitReturn(Return node) { | 4346 Element visitReturn(Return node) { |
4347 Node expression = node.expression; | 4347 Node expression = node.expression; |
4348 return finishConstructorReference(visit(expression), | 4348 return finishConstructorReference(visit(expression), |
4349 expression, expression); | 4349 expression, expression); |
4350 } | 4350 } |
4351 } | 4351 } |
OLD | NEW |