| 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 '../closure.dart'; | 8 import '../closure.dart'; |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../compiler.dart'; | 10 import '../compiler.dart'; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 for (LocalFunctionElement localFunction in kernel.localFunctions.keys) { | 79 for (LocalFunctionElement localFunction in kernel.localFunctions.keys) { |
| 80 _nodeToElement[kernel.localFunctions[localFunction]] = localFunction; | 80 _nodeToElement[kernel.localFunctions[localFunction]] = localFunction; |
| 81 } | 81 } |
| 82 for (TypeVariableElement typeVariable in kernel.typeParameters.keys) { | 82 for (TypeVariableElement typeVariable in kernel.typeParameters.keys) { |
| 83 _nodeToElement[kernel.typeParameters[typeVariable]] = typeVariable; | 83 _nodeToElement[kernel.typeParameters[typeVariable]] = typeVariable; |
| 84 } | 84 } |
| 85 _typeConverter = new DartTypeConverter(this); | 85 _typeConverter = new DartTypeConverter(this); |
| 86 } | 86 } |
| 87 | 87 |
| 88 @override |
| 89 ConstantValue computeConstantValue(ConstantExpression constant) { |
| 90 return _compiler.constants.getConstantValue(constant); |
| 91 } |
| 92 |
| 88 /// Called to find the corresponding Kernel element for a particular Element | 93 /// Called to find the corresponding Kernel element for a particular Element |
| 89 /// before traversing over it with a Kernel visitor. | 94 /// before traversing over it with a Kernel visitor. |
| 90 ir.Node getInitialKernelNode(Element originTarget) { | 95 ir.Node getInitialKernelNode(Element originTarget) { |
| 91 ir.Node target; | 96 ir.Node target; |
| 92 if (originTarget.isPatch) { | 97 if (originTarget.isPatch) { |
| 93 originTarget = originTarget.origin; | 98 originTarget = originTarget.origin; |
| 94 } | 99 } |
| 95 if (originTarget is FunctionElement) { | 100 if (originTarget is FunctionElement) { |
| 96 if (originTarget is ConstructorBodyElement) { | 101 if (originTarget is ConstructorBodyElement) { |
| 97 ConstructorBodyElement body = originTarget; | 102 ConstructorBodyElement body = originTarget; |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 JumpTarget continueTarget = | 832 JumpTarget continueTarget = |
| 828 astAdapter.getJumpTarget(switchCase, isContinueTarget: true); | 833 astAdapter.getJumpTarget(switchCase, isContinueTarget: true); |
| 829 assert(continueTarget is KernelJumpTarget); | 834 assert(continueTarget is KernelJumpTarget); |
| 830 targetIndexMap[continueTarget] = switchIndex; | 835 targetIndexMap[continueTarget] = switchIndex; |
| 831 assert(builder.jumpTargets[continueTarget] == null); | 836 assert(builder.jumpTargets[continueTarget] == null); |
| 832 builder.jumpTargets[continueTarget] = this; | 837 builder.jumpTargets[continueTarget] = this; |
| 833 switchIndex++; | 838 switchIndex++; |
| 834 } | 839 } |
| 835 } | 840 } |
| 836 } | 841 } |
| OLD | NEW |