| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer2dart.treeShaker; | 5 library analyzer2dart.treeShaker; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/analyzer.dart'; | 9 import 'package:analyzer/analyzer.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
| 11 import 'package:analyzer/src/generated/source.dart'; | 11 import 'package:analyzer/src/generated/source.dart'; |
| 12 import 'package:analyzer/src/generated/resolver.dart'; | 12 import 'package:analyzer/src/generated/resolver.dart'; |
| 13 import 'package:compiler/src/universe/universe.dart'; | 13 import 'package:compiler/src/universe/universe.dart'; |
| 14 import 'package:sharedfrontend/src/access_semantics.dart'; | |
| 15 | 14 |
| 16 import 'closed_world.dart'; | 15 import 'closed_world.dart'; |
| 17 import 'util.dart'; | 16 import 'util.dart'; |
| 18 import 'semantic_visitor.dart'; | 17 import 'semantic_visitor.dart'; |
| 19 import 'identifier_semantics.dart'; | 18 import 'identifier_semantics.dart'; |
| 20 | 19 |
| 21 /** | 20 /** |
| 22 * The result of performing local reachability analysis on a method. | 21 * The result of performing local reachability analysis on a method. |
| 23 */ | 22 */ |
| 24 class MethodAnalysis { | 23 class MethodAnalysis { |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 @override | 303 @override |
| 305 void visitStaticPropertyInvocation(MethodInvocation node, | 304 void visitStaticPropertyInvocation(MethodInvocation node, |
| 306 AccessSemantics semantics) { | 305 AccessSemantics semantics) { |
| 307 // Invocation of a property. TODO(paulberry): handle this. | 306 // Invocation of a property. TODO(paulberry): handle this. |
| 308 super.visitStaticPropertyInvocation(node, semantics); | 307 super.visitStaticPropertyInvocation(node, semantics); |
| 309 } | 308 } |
| 310 | 309 |
| 311 void handleDynamicAccess(AccessSemantics semantics) { | 310 void handleDynamicAccess(AccessSemantics semantics) { |
| 312 if (semantics.isRead) { | 311 if (semantics.isRead) { |
| 313 analysis.invokes.add( | 312 analysis.invokes.add( |
| 314 new Selector.getter(semantics.name, null)); | 313 new Selector.getter(semantics.identifier.name, null)); |
| 315 } | 314 } |
| 316 if (semantics.isWrite) { | 315 if (semantics.isWrite) { |
| 317 // Selector.setter constructor uses the convention that setter names | 316 // Selector.setter constructor uses the convention that setter names |
| 318 // don't end in '='. | 317 // don't end in '='. |
| 319 analysis.invokes.add( | 318 analysis.invokes.add( |
| 320 new Selector.setter(semantics.name, null)); | 319 new Selector.setter(semantics.identifier.name, null)); |
| 321 } | 320 } |
| 322 } | 321 } |
| 323 | 322 |
| 324 @override | 323 @override |
| 325 void visitDynamicAccess(AstNode node, AccessSemantics semantics) { | 324 void visitDynamicAccess(AstNode node, AccessSemantics semantics) { |
| 326 handleDynamicAccess(semantics); | 325 handleDynamicAccess(semantics); |
| 327 } | 326 } |
| 328 | 327 |
| 329 @override | 328 @override |
| 330 void visitLocalFunctionAccess(AstNode node, AccessSemantics semantics) { | 329 void visitLocalFunctionAccess(AstNode node, AccessSemantics semantics) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 // null, because that would have been detected by the analyzer and | 389 // null, because that would have been detected by the analyzer and |
| 391 // reported as a compile time error. | 390 // reported as a compile time error. |
| 392 analysis.calls.add(node.staticElement); | 391 analysis.calls.add(node.staticElement); |
| 393 } | 392 } |
| 394 | 393 |
| 395 @override | 394 @override |
| 396 void handleAssignmentExpression(AssignmentExpression node) { | 395 void handleAssignmentExpression(AssignmentExpression node) { |
| 397 // Don't special-case assignment expressions. | 396 // Don't special-case assignment expressions. |
| 398 } | 397 } |
| 399 } | 398 } |
| OLD | NEW |