| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 'package:js_runtime/shared/embedded_names.dart'; | 5 import 'package:js_runtime/shared/embedded_names.dart'; |
| 6 import 'package:kernel/ast.dart' as ir; | 6 import 'package:kernel/ast.dart' as ir; |
| 7 | 7 |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 variable, () => new SyntheticLocal("x", null)); | 169 variable, () => new SyntheticLocal("x", null)); |
| 170 } | 170 } |
| 171 return getElement(variable) as LocalElement; | 171 return getElement(variable) as LocalElement; |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool getCanThrow(ir.Node procedure, ClosedWorld closedWorld) { | 174 bool getCanThrow(ir.Node procedure, ClosedWorld closedWorld) { |
| 175 FunctionElement function = getElement(procedure); | 175 FunctionElement function = getElement(procedure); |
| 176 return !closedWorld.getCannotThrow(function); | 176 return !closedWorld.getCannotThrow(function); |
| 177 } | 177 } |
| 178 | 178 |
| 179 TypeMask returnTypeOf(ir.Member node) { | 179 TypeMask returnTypeOf(ir.Procedure node) { |
| 180 return TypeMaskFactory.inferredReturnTypeForElement( | 180 return TypeMaskFactory.inferredReturnTypeForElement( |
| 181 getElement(node), _globalInferenceResults); | 181 getMethod(node), _globalInferenceResults); |
| 182 } | 182 } |
| 183 | 183 |
| 184 SideEffects getSideEffects(ir.Node node, ClosedWorld closedWorld) { | 184 SideEffects getSideEffects(ir.Node node, ClosedWorld closedWorld) { |
| 185 return closedWorld.getSideEffectsOfElement(getElement(node)); | 185 return closedWorld.getSideEffectsOfElement(getElement(node)); |
| 186 } | 186 } |
| 187 | 187 |
| 188 FunctionSignature getFunctionSignature(ir.FunctionNode function) { | 188 FunctionSignature getFunctionSignature(ir.FunctionNode function) { |
| 189 return getElement(function).asFunctionElement().functionSignature; | 189 return getElement(function).asFunctionElement().functionSignature; |
| 190 } | 190 } |
| 191 | 191 |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 JumpTarget continueTarget = | 821 JumpTarget continueTarget = |
| 822 astAdapter.getJumpTarget(switchCase, isContinueTarget: true); | 822 astAdapter.getJumpTarget(switchCase, isContinueTarget: true); |
| 823 assert(continueTarget is KernelJumpTarget); | 823 assert(continueTarget is KernelJumpTarget); |
| 824 targetIndexMap[continueTarget] = switchIndex; | 824 targetIndexMap[continueTarget] = switchIndex; |
| 825 assert(builder.jumpTargets[continueTarget] == null); | 825 assert(builder.jumpTargets[continueTarget] == null); |
| 826 builder.jumpTargets[continueTarget] = this; | 826 builder.jumpTargets[continueTarget] = this; |
| 827 switchIndex++; | 827 switchIndex++; |
| 828 } | 828 } |
| 829 } | 829 } |
| 830 } | 830 } |
| OLD | NEW |