| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 /// Sometimes for resolution the resolved AST element needs to change (for | 54 /// Sometimes for resolution the resolved AST element needs to change (for |
| 55 /// example, if we're inlining, or if we're in a constructor, but then also | 55 /// example, if we're inlining, or if we're in a constructor, but then also |
| 56 /// constructing the field values). We keep track of this with a stack. | 56 /// constructing the field values). We keep track of this with a stack. |
| 57 final List<ResolvedAst> _resolvedAstStack = <ResolvedAst>[]; | 57 final List<ResolvedAst> _resolvedAstStack = <ResolvedAst>[]; |
| 58 | 58 |
| 59 final native.BehaviorBuilder nativeBehaviorBuilder; | 59 final native.BehaviorBuilder nativeBehaviorBuilder; |
| 60 | 60 |
| 61 KernelAstAdapter(this.kernel, this._backend, this._resolvedAst, | 61 KernelAstAdapter(this.kernel, this._backend, this._resolvedAst, |
| 62 this._nodeToAst, this._nodeToElement) | 62 this._nodeToAst, this._nodeToElement) |
| 63 : nativeBehaviorBuilder = new native.ResolverBehaviorBuilder( | 63 : nativeBehaviorBuilder = new native.ResolverBehaviorBuilder( |
| 64 _backend.compiler, _backend.nativeData) { | 64 _backend.compiler, _backend.nativeBasicData) { |
| 65 KernelJumpTarget.index = 0; | 65 KernelJumpTarget.index = 0; |
| 66 // TODO(het): Maybe just use all of the kernel maps directly? | 66 // TODO(het): Maybe just use all of the kernel maps directly? |
| 67 for (FieldElement fieldElement in kernel.fields.keys) { | 67 for (FieldElement fieldElement in kernel.fields.keys) { |
| 68 _nodeToElement[kernel.fields[fieldElement]] = fieldElement; | 68 _nodeToElement[kernel.fields[fieldElement]] = fieldElement; |
| 69 } | 69 } |
| 70 for (FunctionElement functionElement in kernel.functions.keys) { | 70 for (FunctionElement functionElement in kernel.functions.keys) { |
| 71 _nodeToElement[kernel.functions[functionElement]] = functionElement; | 71 _nodeToElement[kernel.functions[functionElement]] = functionElement; |
| 72 } | 72 } |
| 73 for (ClassElement classElement in kernel.classes.keys) { | 73 for (ClassElement classElement in kernel.classes.keys) { |
| 74 _nodeToElement[kernel.classes[classElement]] = classElement; | 74 _nodeToElement[kernel.classes[classElement]] = classElement; |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 JumpTarget continueTarget = | 832 JumpTarget continueTarget = |
| 833 astAdapter.getJumpTarget(switchCase, isContinueTarget: true); | 833 astAdapter.getJumpTarget(switchCase, isContinueTarget: true); |
| 834 assert(continueTarget is KernelJumpTarget); | 834 assert(continueTarget is KernelJumpTarget); |
| 835 targetIndexMap[continueTarget] = switchIndex; | 835 targetIndexMap[continueTarget] = switchIndex; |
| 836 assert(builder.jumpTargets[continueTarget] == null); | 836 assert(builder.jumpTargets[continueTarget] == null); |
| 837 builder.jumpTargets[continueTarget] = this; | 837 builder.jumpTargets[continueTarget] = this; |
| 838 switchIndex++; | 838 switchIndex++; |
| 839 } | 839 } |
| 840 } | 840 } |
| 841 } | 841 } |
| OLD | NEW |