| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.ir_builder; | 5 library dart2js.ir_builder; |
| 6 | 6 |
| 7 import 'ir_nodes.dart'; | 7 import 'ir_nodes.dart'; |
| 8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
| 9 import '../dart2jslib.dart'; | 9 import '../dart2jslib.dart'; |
| 10 import '../source_file.dart'; | 10 import '../source_file.dart'; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 if (backend.isInterceptedMethod(element)) return false; | 109 if (backend.isInterceptedMethod(element)) return false; |
| 110 | 110 |
| 111 // TODO(lry): support native functions (also in [visitReturn]). | 111 // TODO(lry): support native functions (also in [visitReturn]). |
| 112 if (function.isNative()) return false; | 112 if (function.isNative()) return false; |
| 113 | 113 |
| 114 return true; | 114 return true; |
| 115 } | 115 } |
| 116 | 116 |
| 117 void unlinkTreeAndToken(element) { | 117 void unlinkTreeAndToken(element) { |
| 118 element.beginToken.next = null; | 118 element.beginToken.next = null; |
| 119 element.cachedNode = null; | 119 // TODO(lry): Mark [element] so that parseNode will fail an assertion. |
| 120 // element.cachedNode = null; |
| 120 } | 121 } |
| 121 | 122 |
| 122 SourceFile elementSourceFile(Element element) { | 123 SourceFile elementSourceFile(Element element) { |
| 123 if (element is FunctionElement) { | 124 if (element is FunctionElement) { |
| 124 FunctionElement functionElement = element; | 125 FunctionElement functionElement = element; |
| 125 if (functionElement.patch != null) element = functionElement.patch; | 126 if (functionElement.patch != null) element = functionElement.patch; |
| 126 } | 127 } |
| 127 return element.getCompilationUnit().script.file; | 128 return element.getCompilationUnit().script.file; |
| 128 } | 129 } |
| 129 } | 130 } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 327 |
| 327 void exitBlock() { | 328 void exitBlock() { |
| 328 blockBuilders.removeLast(); | 329 blockBuilders.removeLast(); |
| 329 } | 330 } |
| 330 } | 331 } |
| 331 | 332 |
| 332 class BlockBuilder { | 333 class BlockBuilder { |
| 333 List<IrNode> statements = <IrNode>[]; | 334 List<IrNode> statements = <IrNode>[]; |
| 334 bool hasReturn = false; | 335 bool hasReturn = false; |
| 335 } | 336 } |
| OLD | NEW |