| 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 code_generator; | 5 library code_generator; |
| 6 | 6 |
| 7 import 'glue.dart'; | 7 import 'glue.dart'; |
| 8 | 8 |
| 9 import '../../closure.dart' show | 9 import '../../closure.dart' show |
| 10 ClosureClassElement; | 10 ClosureClassElement; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 List<js.Expression> arguments = visitExpressionList(node.arguments); | 265 List<js.Expression> arguments = visitExpressionList(node.arguments); |
| 266 return buildStaticInvoke( | 266 return buildStaticInvoke( |
| 267 target, | 267 target, |
| 268 arguments, | 268 arguments, |
| 269 sourceInformation: node.sourceInformation); | 269 sourceInformation: node.sourceInformation); |
| 270 } | 270 } |
| 271 | 271 |
| 272 void registerMethodInvoke(tree_ir.InvokeMethod node) { | 272 void registerMethodInvoke(tree_ir.InvokeMethod node) { |
| 273 Selector selector = node.selector; | 273 Selector selector = node.selector; |
| 274 TypeMask mask = node.mask; | 274 TypeMask mask = node.mask; |
| 275 mask = glue.extendMaskIfReachesAll(selector, mask); |
| 275 if (selector.isGetter) { | 276 if (selector.isGetter) { |
| 276 registry.registerDynamicUse(new DynamicUse(selector, mask)); | 277 registry.registerDynamicUse(new DynamicUse(selector, mask)); |
| 277 } else if (selector.isSetter) { | 278 } else if (selector.isSetter) { |
| 278 registry.registerDynamicUse(new DynamicUse(selector, mask)); | 279 registry.registerDynamicUse(new DynamicUse(selector, mask)); |
| 279 } else { | 280 } else { |
| 280 assert(invariant(CURRENT_ELEMENT_SPANNABLE, | 281 assert(invariant(CURRENT_ELEMENT_SPANNABLE, |
| 281 selector.isCall || selector.isOperator || | 282 selector.isCall || selector.isOperator || |
| 282 selector.isIndex || selector.isIndexSet, | 283 selector.isIndex || selector.isIndexSet, |
| 283 message: 'unexpected kind ${selector.kind}')); | 284 message: 'unexpected kind ${selector.kind}')); |
| 284 // TODO(sigurdm): We should find a better place to register the call. | 285 // TODO(sigurdm): We should find a better place to register the call. |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 void registerDefaultParameterValues(ExecutableElement element) { | 1090 void registerDefaultParameterValues(ExecutableElement element) { |
| 1090 if (element is! FunctionElement) return; | 1091 if (element is! FunctionElement) return; |
| 1091 FunctionElement function = element; | 1092 FunctionElement function = element; |
| 1092 if (function.isStatic) return; // Defaults are inlined at call sites. | 1093 if (function.isStatic) return; // Defaults are inlined at call sites. |
| 1093 function.functionSignature.forEachOptionalParameter((param) { | 1094 function.functionSignature.forEachOptionalParameter((param) { |
| 1094 ConstantValue constant = glue.getDefaultParameterValue(param); | 1095 ConstantValue constant = glue.getDefaultParameterValue(param); |
| 1095 registry.registerCompileTimeConstant(constant); | 1096 registry.registerCompileTimeConstant(constant); |
| 1096 }); | 1097 }); |
| 1097 } | 1098 } |
| 1098 } | 1099 } |
| OLD | NEW |