OLD | NEW |
---|---|
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 #ifndef RUNTIME_VM_PROGRAM_VISITOR_H_ | 5 #ifndef RUNTIME_VM_PROGRAM_VISITOR_H_ |
6 #define RUNTIME_VM_PROGRAM_VISITOR_H_ | 6 #define RUNTIME_VM_PROGRAM_VISITOR_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
11 | 11 |
12 class Function; | 12 class Function; |
13 class Class; | 13 class Class; |
14 | 14 |
15 template <typename T> | 15 template <typename T> |
16 class Visitor : public ValueObject { | 16 class Visitor : public ValueObject { |
17 public: | 17 public: |
18 virtual ~Visitor() {} | 18 virtual ~Visitor() {} |
19 virtual void Visit(const T& obj) = 0; | 19 virtual void Visit(const T& obj) = 0; |
20 }; | 20 }; |
21 | 21 |
22 typedef Visitor<Function> FunctionVisitor; | 22 typedef Visitor<Function> FunctionVisitor; |
23 typedef Visitor<Class> ClassVisitor; | 23 typedef Visitor<Class> ClassVisitor; |
24 | 24 |
25 class ProgramVisitor : public AllStatic { | 25 class ProgramVisitor : public AllStatic { |
rmacnak
2017/07/10 17:50:00
This shouldn't be used at all in AOT.
Aske Simon Christensen
2017/07/11 09:11:56
OK, I will take a look at eliminating this as part
| |
26 public: | 26 public: |
27 static void VisitFunctions(FunctionVisitor* visitor); | 27 static void VisitFunctions(FunctionVisitor* visitor); |
28 static void VisitClasses(ClassVisitor* visitor); | 28 static void VisitClasses(ClassVisitor* visitor); |
29 | 29 |
30 static void Dedup(); | 30 static void Dedup(); |
31 | 31 |
32 private: | 32 private: |
33 static void ShareMegamorphicBuckets(); | 33 static void ShareMegamorphicBuckets(); |
34 static void DedupStackMaps(); | 34 static void DedupStackMaps(); |
35 static void DedupPcDescriptors(); | 35 static void DedupPcDescriptors(); |
36 static void DedupDeoptEntries(); | 36 NOT_IN_PRECOMPILED(static void DedupDeoptEntries()); |
37 static void DedupCodeSourceMaps(); | 37 static void DedupCodeSourceMaps(); |
38 static void DedupLists(); | 38 static void DedupLists(); |
39 static void DedupInstructions(); | 39 static void DedupInstructions(); |
40 }; | 40 }; |
41 | 41 |
42 } // namespace dart | 42 } // namespace dart |
43 | 43 |
44 #endif // RUNTIME_VM_PROGRAM_VISITOR_H_ | 44 #endif // RUNTIME_VM_PROGRAM_VISITOR_H_ |
OLD | NEW |