| OLD | NEW |
| 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Fletch 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 library fletchc.debug_info_lazy_field_initializer_codegen; | 5 library fletchc.debug_info_lazy_field_initializer_codegen; |
| 6 | 6 |
| 7 import 'package:compiler/src/dart2jslib.dart' show | |
| 8 MessageKind, | |
| 9 Registry; | |
| 10 | |
| 11 import 'package:compiler/src/elements/elements.dart'; | 7 import 'package:compiler/src/elements/elements.dart'; |
| 12 import 'package:compiler/src/resolution/resolution.dart'; | 8 import 'package:compiler/src/resolution/tree_elements.dart'; |
| 13 import 'package:compiler/src/tree/tree.dart'; | 9 import 'package:compiler/src/tree/tree.dart'; |
| 14 import 'package:compiler/src/universe/universe.dart'; | 10 import 'package:compiler/src/universe/selector.dart'; |
| 15 | 11 |
| 16 import 'package:compiler/src/dart_types.dart' show | 12 import 'package:compiler/src/dart_types.dart' show |
| 17 DartType; | 13 DartType; |
| 18 | 14 |
| 19 import 'package:compiler/src/util/util.dart' show | 15 import 'package:compiler/src/diagnostics/spannable.dart' show |
| 20 Spannable; | 16 Spannable; |
| 21 | 17 |
| 22 import 'fletch_context.dart'; | 18 import 'fletch_context.dart'; |
| 23 | 19 |
| 24 import 'fletch_function_builder.dart' show | 20 import 'fletch_function_builder.dart' show |
| 25 FletchFunctionBuilder; | 21 FletchFunctionBuilder; |
| 26 | 22 |
| 27 import 'fletch_registry.dart' show | 23 import 'fletch_registry.dart' show |
| 28 FletchRegistry; | 24 FletchRegistry; |
| 29 | 25 |
| 30 import 'debug_registry.dart' show | 26 import 'debug_registry.dart' show |
| 31 DebugRegistry; | 27 DebugRegistry; |
| 32 | 28 |
| 33 import 'closure_environment.dart'; | 29 import 'closure_environment.dart'; |
| 34 import 'codegen_visitor.dart'; | 30 import 'codegen_visitor.dart'; |
| 35 import 'lazy_field_initializer_codegen.dart'; | 31 import 'lazy_field_initializer_codegen.dart'; |
| 36 import 'debug_info.dart'; | 32 import 'debug_info.dart'; |
| 37 | 33 |
| 38 class DebugInfoLazyFieldInitializerCodegen | 34 class DebugInfoLazyFieldInitializerCodegen |
| 39 extends LazyFieldInitializerCodegen with DebugRegistry { | 35 extends LazyFieldInitializerCodegen with DebugRegistry { |
| 40 final DebugInfo debugInfo; | 36 final DebugInfo debugInfo; |
| 41 final FletchCompilerImplementation compiler; | 37 final FletchCompilerImplementation compiler; |
| 42 | 38 |
| 43 DebugInfoLazyFieldInitializerCodegen(this.debugInfo, | 39 DebugInfoLazyFieldInitializerCodegen(this.debugInfo, |
| 44 FletchFunctionBuilder functionBuilder, | 40 FletchFunctionBuilder functionBuilder, |
| 45 FletchContext context, | 41 FletchContext context, |
| 46 TreeElements elements, | 42 TreeElements elements, |
| 47 FletchRegistry registry, | |
| 48 ClosureEnvironment closureEnvironment, | 43 ClosureEnvironment closureEnvironment, |
| 49 FieldElement field, | 44 FieldElement field, |
| 50 this.compiler) | 45 this.compiler) |
| 51 : super(functionBuilder, context, elements, registry, | 46 : super(functionBuilder, context, elements, null, |
| 52 closureEnvironment, field); | 47 closureEnvironment, field); |
| 53 | 48 |
| 54 void recordDebugInfo(Node node) { | 49 void recordDebugInfo(Node node) { |
| 55 debugInfo.addLocation(compiler, assembler.byteSize, node); | 50 debugInfo.addLocation(compiler, assembler.byteSize, node); |
| 56 } | 51 } |
| 57 | 52 |
| 58 void pushVariableDeclaration(LocalValue value) { | 53 void pushVariableDeclaration(LocalValue value) { |
| 59 super.pushVariableDeclaration(value); | 54 super.pushVariableDeclaration(value); |
| 60 debugInfo.pushScope(assembler.byteSize, value); | 55 debugInfo.pushScope(assembler.byteSize, value); |
| 61 } | 56 } |
| 62 | 57 |
| 63 void popVariableDeclaration(Element element) { | 58 void popVariableDeclaration(Element element) { |
| 64 super.popVariableDeclaration(element); | 59 super.popVariableDeclaration(element); |
| 65 debugInfo.popScope(assembler.byteSize); | 60 debugInfo.popScope(assembler.byteSize); |
| 66 } | 61 } |
| 67 | 62 |
| 68 void callIsSelector( | 63 void callIsSelector( |
| 69 Node node, | 64 Node node, |
| 70 DartType type, | 65 DartType type, |
| 71 Spannable diagnosticLocation) { | 66 Spannable diagnosticLocation) { |
| 72 recordDebugInfo(node); | 67 recordDebugInfo(node); |
| 73 super.callIsSelector(node, type, diagnosticLocation); | 68 super.callIsSelector(node, type, diagnosticLocation); |
| 74 } | 69 } |
| 75 | 70 |
| 76 void invokeMethod(Node node, Selector selector) { | 71 void invokeMethod(Node node, Selector selector) { |
| 77 recordDebugInfo(node); | 72 recordDebugInfo(node); |
| 78 super.invokeMethod(node, selector); | 73 super.invokeMethod(node, selector); |
| 79 } | 74 } |
| 80 | 75 |
| 81 void invokeGetter(Node node, Selector selector) { | 76 void invokeGetter(Node node, Name name) { |
| 82 recordDebugInfo(node); | 77 recordDebugInfo(node); |
| 83 super.invokeGetter(node, selector); | 78 super.invokeGetter(node, name); |
| 84 } | 79 } |
| 85 | 80 |
| 86 void invokeSetter(Node node, Selector selector) { | 81 void invokeSetter(Node node, Name name) { |
| 87 recordDebugInfo(node); | 82 recordDebugInfo(node); |
| 88 super.invokeSetter(node, selector); | 83 super.invokeSetter(node, name); |
| 89 } | 84 } |
| 90 | 85 |
| 91 void invokeFactory(Node node, int constId, int arity) { | 86 void invokeFactory(Node node, int constId, int arity) { |
| 92 recordDebugInfo(node); | 87 recordDebugInfo(node); |
| 93 super.invokeFactory(node, constId, arity); | 88 super.invokeFactory(node, constId, arity); |
| 94 } | 89 } |
| 95 | 90 |
| 96 void invokeStatic(Node node, int constId, int arity) { | 91 void invokeStatic(Node node, int constId, int arity) { |
| 97 recordDebugInfo(node); | 92 recordDebugInfo(node); |
| 98 super.invokeStatic(node, constId, arity); | 93 super.invokeStatic(node, constId, arity); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 123 void visitForValue(Node node) { | 118 void visitForValue(Node node) { |
| 124 recordDebugInfo(node); | 119 recordDebugInfo(node); |
| 125 super.visitForValue(node); | 120 super.visitForValue(node); |
| 126 } | 121 } |
| 127 | 122 |
| 128 void visitForEffect(Node node) { | 123 void visitForEffect(Node node) { |
| 129 recordDebugInfo(node); | 124 recordDebugInfo(node); |
| 130 super.visitForEffect(node); | 125 super.visitForEffect(node); |
| 131 } | 126 } |
| 132 } | 127 } |
| OLD | NEW |