| 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 library dart2js.world; | 5 library dart2js.world; |
| 6 | 6 |
| 7 import 'closure.dart' show | 7 import 'closure.dart' show |
| 8 SynthesizedCallMethodElementX; | 8 SynthesizedCallMethodElementX; |
| 9 import 'common.dart'; | 9 import 'common.dart'; |
| 10 import 'common/backend_api.dart' show | 10 import 'common/backend_api.dart' show |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 void addFunctionCalledInLoop(Element element) { | 603 void addFunctionCalledInLoop(Element element) { |
| 604 functionsCalledInLoop.add(element.declaration); | 604 functionsCalledInLoop.add(element.declaration); |
| 605 } | 605 } |
| 606 | 606 |
| 607 bool isCalledInLoop(Element element) { | 607 bool isCalledInLoop(Element element) { |
| 608 return functionsCalledInLoop.contains(element.declaration); | 608 return functionsCalledInLoop.contains(element.declaration); |
| 609 } | 609 } |
| 610 | 610 |
| 611 bool fieldNeverChanges(Element element) { | 611 bool fieldNeverChanges(Element element) { |
| 612 if (!element.isField) return false; | 612 if (!element.isField) return false; |
| 613 if (element.isNative) { | 613 if (backend.isNative(element)) { |
| 614 // Some native fields are views of data that may be changed by operations. | 614 // Some native fields are views of data that may be changed by operations. |
| 615 // E.g. node.firstChild depends on parentNode.removeBefore(n1, n2). | 615 // E.g. node.firstChild depends on parentNode.removeBefore(n1, n2). |
| 616 // TODO(sra): Refine the effect classification so that native effects are | 616 // TODO(sra): Refine the effect classification so that native effects are |
| 617 // distinct from ordinary Dart effects. | 617 // distinct from ordinary Dart effects. |
| 618 return false; | 618 return false; |
| 619 } | 619 } |
| 620 | 620 |
| 621 return element.isFinal | 621 return element.isFinal |
| 622 || element.isConst | 622 || element.isConst |
| 623 || (element.isInstanceMember | 623 || (element.isInstanceMember |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 // function expressions's element. | 692 // function expressions's element. |
| 693 // TODO(herhut): Generate classes for function expressions earlier. | 693 // TODO(herhut): Generate classes for function expressions earlier. |
| 694 if (element is SynthesizedCallMethodElementX) { | 694 if (element is SynthesizedCallMethodElementX) { |
| 695 return getMightBePassedToApply(element.expression); | 695 return getMightBePassedToApply(element.expression); |
| 696 } | 696 } |
| 697 return functionsThatMightBePassedToApply.contains(element); | 697 return functionsThatMightBePassedToApply.contains(element); |
| 698 } | 698 } |
| 699 | 699 |
| 700 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport; | 700 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport; |
| 701 } | 701 } |
| OLD | NEW |