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_registry; | |
6 | |
7 import 'package:compiler/src/universe/selector.dart' show | |
8 Selector; | |
9 | |
10 import 'package:compiler/src/elements/elements.dart' show | |
11 ClassElement, | |
12 FieldElement, | |
13 FunctionElement, | |
14 LocalElement; | |
15 | |
16 import 'package:compiler/src/dart_types.dart' show | |
17 DartType; | |
18 | |
19 import 'package:compiler/src/diagnostics/spannable.dart' show | |
20 Spannable; | |
21 | |
22 import 'package:compiler/src/universe/use.dart' show | |
23 DynamicUse, | |
24 StaticUse; | |
25 | |
26 import 'fletch_context.dart' show | |
27 FletchContext; | |
28 | |
29 import 'fletch_function_builder.dart' show | |
30 FletchFunctionBuilder; | |
31 | |
32 /// Turns off enqueuing when generating debug information. | |
33 /// | |
34 /// We generate debug information for one element at the time, on | |
35 /// demand. Generating this information shouldn't interact with the | |
36 /// enqueuer/registry/tree-shaking algorithm. | |
37 abstract class DebugRegistry { | |
38 FletchContext get context; | |
39 FletchFunctionBuilder get functionBuilder; | |
40 | |
41 void registerDynamicUse(Selector selector) { } | |
42 void registerDynamicGetter(Selector selector) { } | |
43 void registerDynamicSetter(Selector selector) { } | |
44 void registerStaticUse(StaticUse use) { } | |
45 void registerInstantiatedClass(ClassElement klass) { } | |
46 void registerIsCheck(DartType type) { } | |
47 void registerLocalInvoke(LocalElement element, Selector selector) { } | |
48 void registerClosurization(FunctionElement element, _) { } | |
49 | |
50 int compileLazyFieldInitializer(FieldElement field) { | |
51 int index = context.getStaticFieldIndex(field, null); | |
52 | |
53 if (field.initializer == null) return index; | |
54 | |
55 if (context.backend.lazyFieldInitializers.containsKey(field)) return index; | |
56 | |
57 context.compiler.reporter.internalError( | |
58 field, "not compiled before use in debugger"); | |
59 throw null; | |
60 } | |
61 | |
62 void generateUnimplementedError(Spannable spannable, String reason) { | |
63 context.backend.generateUnimplementedError( | |
64 spannable, reason, functionBuilder, suppressHint: true); | |
65 } | |
66 } | |
OLD | NEW |