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 import 'dart:collection'; | 5 import 'dart:collection'; |
6 | 6 |
7 import 'package:js_runtime/shared/embedded_names.dart'; | 7 import 'package:js_runtime/shared/embedded_names.dart'; |
8 | 8 |
9 import '../closure.dart'; | 9 import '../closure.dart'; |
10 import '../common.dart'; | 10 import '../common.dart'; |
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1739 /// Use sparingly. In order for the comment to be retained it is modeled as | 1739 /// Use sparingly. In order for the comment to be retained it is modeled as |
1740 /// having side effects which will inhibit code motion. | 1740 /// having side effects which will inhibit code motion. |
1741 // TODO(sra): Figure out how to keep comment anchored without effects. | 1741 // TODO(sra): Figure out how to keep comment anchored without effects. |
1742 void addComment(String text) { | 1742 void addComment(String text) { |
1743 add(new HForeignCode(js.js.statementTemplateYielding(new js.Comment(text)), | 1743 add(new HForeignCode(js.js.statementTemplateYielding(new js.Comment(text)), |
1744 backend.dynamicType, <HInstruction>[], | 1744 backend.dynamicType, <HInstruction>[], |
1745 isStatement: true)); | 1745 isStatement: true)); |
1746 } | 1746 } |
1747 | 1747 |
1748 HGraph buildCheckedSetter(VariableElement field) { | 1748 HGraph buildCheckedSetter(VariableElement field) { |
1749 openFunction(field, field.node); | 1749 ResolvedAst resolvedAst = field.resolvedAst; |
| 1750 openFunction(field, resolvedAst.node); |
1750 HInstruction thisInstruction = localsHandler.readThis(); | 1751 HInstruction thisInstruction = localsHandler.readThis(); |
1751 // Use dynamic type because the type computed by the inferrer is | 1752 // Use dynamic type because the type computed by the inferrer is |
1752 // narrowed to the type annotation. | 1753 // narrowed to the type annotation. |
1753 HInstruction parameter = new HParameterValue(field, backend.dynamicType); | 1754 HInstruction parameter = new HParameterValue(field, backend.dynamicType); |
1754 // Add the parameter as the last instruction of the entry block. | 1755 // Add the parameter as the last instruction of the entry block. |
1755 // If the method is intercepted, we want the actual receiver | 1756 // If the method is intercepted, we want the actual receiver |
1756 // to be the first parameter. | 1757 // to be the first parameter. |
1757 graph.entry.addBefore(graph.entry.last, parameter); | 1758 graph.entry.addBefore(graph.entry.last, parameter); |
1758 HInstruction value = potentiallyCheckOrTrustType(parameter, field.type); | 1759 HInstruction value = potentiallyCheckOrTrustType(parameter, field.type); |
1759 add(new HFieldSet(field, thisInstruction, value)); | 1760 add(new HFieldSet(field, thisInstruction, value)); |
(...skipping 6865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8625 const _LoopTypeVisitor(); | 8626 const _LoopTypeVisitor(); |
8626 int visitNode(ast.Node node) => HLoopBlockInformation.NOT_A_LOOP; | 8627 int visitNode(ast.Node node) => HLoopBlockInformation.NOT_A_LOOP; |
8627 int visitWhile(ast.While node) => HLoopBlockInformation.WHILE_LOOP; | 8628 int visitWhile(ast.While node) => HLoopBlockInformation.WHILE_LOOP; |
8628 int visitFor(ast.For node) => HLoopBlockInformation.FOR_LOOP; | 8629 int visitFor(ast.For node) => HLoopBlockInformation.FOR_LOOP; |
8629 int visitDoWhile(ast.DoWhile node) => HLoopBlockInformation.DO_WHILE_LOOP; | 8630 int visitDoWhile(ast.DoWhile node) => HLoopBlockInformation.DO_WHILE_LOOP; |
8630 int visitAsyncForIn(ast.AsyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; | 8631 int visitAsyncForIn(ast.AsyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; |
8631 int visitSyncForIn(ast.SyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; | 8632 int visitSyncForIn(ast.SyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; |
8632 int visitSwitchStatement(ast.SwitchStatement node) => | 8633 int visitSwitchStatement(ast.SwitchStatement node) => |
8633 HLoopBlockInformation.SWITCH_CONTINUE_LOOP; | 8634 HLoopBlockInformation.SWITCH_CONTINUE_LOOP; |
8634 } | 8635 } |
OLD | NEW |