| 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_constructor_codegen; | 5 library fletchc.debug_info_constructor_codegen; |
| 6 | 6 |
| 7 import 'package:compiler/src/elements/elements.dart'; | 7 import 'package:compiler/src/elements/elements.dart'; |
| 8 import 'package:compiler/src/resolution/resolution.dart'; | 8 import 'package:compiler/src/universe/selector.dart' show |
| 9 Selector; |
| 9 import 'package:compiler/src/tree/tree.dart'; | 10 import 'package:compiler/src/tree/tree.dart'; |
| 10 import 'package:compiler/src/universe/universe.dart'; | 11 import 'package:compiler/src/resolution/tree_elements.dart' show |
| 11 | 12 TreeElements; |
| 12 import 'package:compiler/src/dart2jslib.dart' show | |
| 13 Registry; | |
| 14 | 13 |
| 15 import 'package:compiler/src/dart_types.dart' show | 14 import 'package:compiler/src/dart_types.dart' show |
| 16 DartType; | 15 DartType; |
| 17 | 16 |
| 18 import 'package:compiler/src/util/util.dart' show | 17 import 'package:compiler/src/diagnostics/spannable.dart' show |
| 19 Spannable; | 18 Spannable; |
| 20 | 19 |
| 21 import 'bytecode_assembler.dart'; | 20 import 'bytecode_assembler.dart'; |
| 22 import 'closure_environment.dart'; | 21 import 'closure_environment.dart'; |
| 23 import 'codegen_visitor.dart'; | 22 import 'codegen_visitor.dart'; |
| 24 | 23 |
| 25 import 'fletch_function_builder.dart' show | 24 import 'fletch_function_builder.dart' show |
| 26 FletchFunctionBuilder; | 25 FletchFunctionBuilder; |
| 27 | 26 |
| 28 import 'fletch_class_builder.dart' show | 27 import 'fletch_class_builder.dart' show |
| (...skipping 13 matching lines...) Expand all Loading... |
| 42 | 41 |
| 43 class DebugInfoConstructorCodegen extends ConstructorCodegen | 42 class DebugInfoConstructorCodegen extends ConstructorCodegen |
| 44 with DebugRegistry { | 43 with DebugRegistry { |
| 45 final DebugInfo debugInfo; | 44 final DebugInfo debugInfo; |
| 46 final FletchCompilerImplementation compiler; | 45 final FletchCompilerImplementation compiler; |
| 47 | 46 |
| 48 DebugInfoConstructorCodegen(this.debugInfo, | 47 DebugInfoConstructorCodegen(this.debugInfo, |
| 49 FletchFunctionBuilder functionBuilder, | 48 FletchFunctionBuilder functionBuilder, |
| 50 FletchContext context, | 49 FletchContext context, |
| 51 TreeElements elements, | 50 TreeElements elements, |
| 52 FletchRegistry registry, | |
| 53 ClosureEnvironment closureEnvironment, | 51 ClosureEnvironment closureEnvironment, |
| 54 ConstructorElement constructor, | 52 ConstructorElement constructor, |
| 55 FletchClassBuilder classBuilder, | 53 FletchClassBuilder classBuilder, |
| 56 this.compiler) | 54 this.compiler) |
| 57 : super(functionBuilder, context, elements, registry, | 55 : super(functionBuilder, context, elements, null, |
| 58 closureEnvironment, constructor, classBuilder); | 56 closureEnvironment, constructor, classBuilder); |
| 59 | 57 |
| 60 LazyFieldInitializerCodegen lazyFieldInitializerCodegenFor( | 58 LazyFieldInitializerCodegen lazyFieldInitializerCodegenFor( |
| 61 FletchFunctionBuilder function, | 59 FletchFunctionBuilder function, |
| 62 FieldElement field) { | 60 FieldElement field) { |
| 63 TreeElements elements = field.resolvedAst.elements; | 61 TreeElements elements = field.resolvedAst.elements; |
| 64 return new DebugInfoLazyFieldInitializerCodegen( | 62 return new DebugInfoLazyFieldInitializerCodegen( |
| 65 debugInfo, | 63 debugInfo, |
| 66 function, | 64 function, |
| 67 context, | 65 context, |
| 68 elements, | 66 elements, |
| 69 null, | |
| 70 context.backend.createClosureEnvironment(field, elements), | 67 context.backend.createClosureEnvironment(field, elements), |
| 71 field, | 68 field, |
| 72 compiler); | 69 compiler); |
| 73 } | 70 } |
| 74 | 71 |
| 75 void recordDebugInfo(Node node) { | 72 void recordDebugInfo(Node node) { |
| 76 debugInfo.addLocation(compiler, assembler.byteSize, node); | 73 debugInfo.addLocation(compiler, assembler.byteSize, node); |
| 77 } | 74 } |
| 78 | 75 |
| 79 void pushVariableDeclaration(LocalValue value) { | 76 void pushVariableDeclaration(LocalValue value) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 105 Spannable diagnosticLocation) { | 102 Spannable diagnosticLocation) { |
| 106 recordDebugInfo(node); | 103 recordDebugInfo(node); |
| 107 super.callIsSelector(node, type, diagnosticLocation); | 104 super.callIsSelector(node, type, diagnosticLocation); |
| 108 } | 105 } |
| 109 | 106 |
| 110 void invokeMethod(Node node, Selector selector) { | 107 void invokeMethod(Node node, Selector selector) { |
| 111 recordDebugInfo(node); | 108 recordDebugInfo(node); |
| 112 super.invokeMethod(node, selector); | 109 super.invokeMethod(node, selector); |
| 113 } | 110 } |
| 114 | 111 |
| 115 void invokeGetter(Node node, Selector selector) { | 112 void invokeGetter(Node node, Name name) { |
| 116 recordDebugInfo(node); | 113 recordDebugInfo(node); |
| 117 super.invokeGetter(node, selector); | 114 super.invokeGetter(node, name); |
| 118 } | 115 } |
| 119 | 116 |
| 120 void invokeSetter(Node node, Selector selector) { | 117 void invokeSetter(Node node, Name name) { |
| 121 recordDebugInfo(node); | 118 recordDebugInfo(node); |
| 122 super.invokeSetter(node, selector); | 119 super.invokeSetter(node, name); |
| 123 } | 120 } |
| 124 | 121 |
| 125 void invokeFactory(Node node, int constId, int arity) { | 122 void invokeFactory(Node node, int constId, int arity) { |
| 126 recordDebugInfo(node); | 123 recordDebugInfo(node); |
| 127 super.invokeFactory(node, constId, arity); | 124 super.invokeFactory(node, constId, arity); |
| 128 } | 125 } |
| 129 | 126 |
| 130 void invokeStatic(Node node, int constId, int arity) { | 127 void invokeStatic(Node node, int constId, int arity) { |
| 131 recordDebugInfo(node); | 128 recordDebugInfo(node); |
| 132 super.invokeStatic(node, constId, arity); | 129 super.invokeStatic(node, constId, arity); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 157 void visitForValue(Node node) { | 154 void visitForValue(Node node) { |
| 158 recordDebugInfo(node); | 155 recordDebugInfo(node); |
| 159 super.visitForValue(node); | 156 super.visitForValue(node); |
| 160 } | 157 } |
| 161 | 158 |
| 162 void visitForEffect(Node node) { | 159 void visitForEffect(Node node) { |
| 163 recordDebugInfo(node); | 160 recordDebugInfo(node); |
| 164 super.visitForEffect(node); | 161 super.visitForEffect(node); |
| 165 } | 162 } |
| 166 } | 163 } |
| OLD | NEW |