| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | |
| 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. | |
| 4 | |
| 5 library fletchc.debug_info_lazy_field_initializer_codegen; | |
| 6 | |
| 7 import 'package:compiler/src/elements/elements.dart'; | |
| 8 import 'package:compiler/src/resolution/tree_elements.dart'; | |
| 9 import 'package:compiler/src/tree/tree.dart'; | |
| 10 import 'package:compiler/src/universe/selector.dart'; | |
| 11 | |
| 12 import 'package:compiler/src/dart_types.dart' show | |
| 13 DartType; | |
| 14 | |
| 15 import 'package:compiler/src/diagnostics/spannable.dart' show | |
| 16 Spannable; | |
| 17 | |
| 18 import 'fletch_context.dart'; | |
| 19 | |
| 20 import 'fletch_function_builder.dart' show | |
| 21 FletchFunctionBuilder; | |
| 22 | |
| 23 import 'fletch_registry.dart' show | |
| 24 FletchRegistry; | |
| 25 | |
| 26 import 'debug_registry.dart' show | |
| 27 DebugRegistry; | |
| 28 | |
| 29 import 'closure_environment.dart'; | |
| 30 import 'codegen_visitor.dart'; | |
| 31 import 'lazy_field_initializer_codegen.dart'; | |
| 32 import 'debug_info.dart'; | |
| 33 | |
| 34 class DebugInfoLazyFieldInitializerCodegen | |
| 35 extends LazyFieldInitializerCodegen with DebugRegistry { | |
| 36 final DebugInfo debugInfo; | |
| 37 final FletchCompilerImplementation compiler; | |
| 38 | |
| 39 DebugInfoLazyFieldInitializerCodegen(this.debugInfo, | |
| 40 FletchFunctionBuilder functionBuilder, | |
| 41 FletchContext context, | |
| 42 TreeElements elements, | |
| 43 ClosureEnvironment closureEnvironment, | |
| 44 FieldElement field, | |
| 45 this.compiler) | |
| 46 : super(functionBuilder, context, elements, null, | |
| 47 closureEnvironment, field); | |
| 48 | |
| 49 void recordDebugInfo(Node node) { | |
| 50 debugInfo.addLocation(compiler, assembler.byteSize, node); | |
| 51 } | |
| 52 | |
| 53 void pushVariableDeclaration(LocalValue value) { | |
| 54 super.pushVariableDeclaration(value); | |
| 55 debugInfo.pushScope(assembler.byteSize, value); | |
| 56 } | |
| 57 | |
| 58 void popVariableDeclaration(Element element) { | |
| 59 super.popVariableDeclaration(element); | |
| 60 debugInfo.popScope(assembler.byteSize); | |
| 61 } | |
| 62 | |
| 63 void callIsSelector( | |
| 64 Node node, | |
| 65 DartType type, | |
| 66 Spannable diagnosticLocation) { | |
| 67 recordDebugInfo(node); | |
| 68 super.callIsSelector(node, type, diagnosticLocation); | |
| 69 } | |
| 70 | |
| 71 void invokeMethod(Node node, Selector selector) { | |
| 72 recordDebugInfo(node); | |
| 73 super.invokeMethod(node, selector); | |
| 74 } | |
| 75 | |
| 76 void invokeGetter(Node node, Name name) { | |
| 77 recordDebugInfo(node); | |
| 78 super.invokeGetter(node, name); | |
| 79 } | |
| 80 | |
| 81 void invokeSetter(Node node, Name name) { | |
| 82 recordDebugInfo(node); | |
| 83 super.invokeSetter(node, name); | |
| 84 } | |
| 85 | |
| 86 void invokeFactory(Node node, int constId, int arity) { | |
| 87 recordDebugInfo(node); | |
| 88 super.invokeFactory(node, constId, arity); | |
| 89 } | |
| 90 | |
| 91 void invokeStatic(Node node, int constId, int arity) { | |
| 92 recordDebugInfo(node); | |
| 93 super.invokeStatic(node, constId, arity); | |
| 94 } | |
| 95 | |
| 96 void generateReturn(Node node) { | |
| 97 recordDebugInfo(node); | |
| 98 super.generateReturn(node); | |
| 99 } | |
| 100 | |
| 101 void generateSwitchCaseMatch(CaseMatch caseMatch, BytecodeLabel ifTrue) { | |
| 102 // We do not want to break on the evaluation of the individual | |
| 103 // case equality tests. | |
| 104 recordDebugInfo(null); | |
| 105 super.generateSwitchCaseMatch(caseMatch, ifTrue); | |
| 106 } | |
| 107 | |
| 108 void generateIdentical(Node node) { | |
| 109 recordDebugInfo(node); | |
| 110 super.generateIdentical(node); | |
| 111 } | |
| 112 | |
| 113 void generateIdenticalNonNumeric(Node node) { | |
| 114 recordDebugInfo(node); | |
| 115 super.generateIdenticalNonNumeric(node); | |
| 116 } | |
| 117 | |
| 118 void generateThrow(Node node) { | |
| 119 recordDebugInfo(node); | |
| 120 super.generateThrow(node); | |
| 121 } | |
| 122 | |
| 123 void visitForValue(Node node) { | |
| 124 recordDebugInfo(node); | |
| 125 super.visitForValue(node); | |
| 126 } | |
| 127 | |
| 128 void visitForEffect(Node node) { | |
| 129 recordDebugInfo(node); | |
| 130 super.visitForEffect(node); | |
| 131 } | |
| 132 } | |
| OLD | NEW |