OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_KERNEL_READER_H_ | 5 #ifndef RUNTIME_VM_KERNEL_READER_H_ |
6 #define RUNTIME_VM_KERNEL_READER_H_ | 6 #define RUNTIME_VM_KERNEL_READER_H_ |
7 | 7 |
8 #if !defined(DART_PRECOMPILED_RUNTIME) | 8 #if !defined(DART_PRECOMPILED_RUNTIME) |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "vm/kernel.h" | 11 #include "vm/kernel.h" |
12 #include "vm/kernel_to_il.h" | 12 #include "vm/kernel_to_il.h" |
13 #include "vm/object.h" | 13 #include "vm/object.h" |
14 | 14 |
15 namespace dart { | 15 namespace dart { |
16 namespace kernel { | 16 namespace kernel { |
17 | 17 |
18 class KernelReader; | 18 class KernelReader; |
19 | 19 |
20 class BuildingTranslationHelper : public TranslationHelper { | 20 class BuildingTranslationHelper : public TranslationHelper { |
21 public: | 21 public: |
22 BuildingTranslationHelper(KernelReader* reader, dart::Thread* thread) | 22 BuildingTranslationHelper(KernelReader* reader, dart::Thread* thread) |
23 : TranslationHelper(thread), reader_(reader) {} | 23 : TranslationHelper(thread), reader_(reader) {} |
24 virtual ~BuildingTranslationHelper() {} | 24 virtual ~BuildingTranslationHelper() {} |
25 | 25 |
26 virtual RawLibrary* LookupLibraryByKernelLibrary(Library* library); | 26 virtual RawLibrary* LookupLibraryByKernelLibrary(CanonicalName* library); |
27 virtual RawClass* LookupClassByKernelClass(Class* klass); | 27 virtual RawClass* LookupClassByKernelClass(CanonicalName* klass); |
28 | 28 |
29 private: | 29 private: |
30 KernelReader* reader_; | 30 KernelReader* reader_; |
31 }; | 31 }; |
32 | 32 |
33 template <typename KernelType, typename VmType> | 33 template <typename KernelType, typename VmType> |
34 class Mapping { | 34 class Mapping { |
35 public: | 35 public: |
36 bool Lookup(KernelType* node, VmType** handle) { | 36 bool Lookup(KernelType* node, VmType** handle) { |
37 typename MapType::Pair* pair = map_.LookupPair(node); | 37 typename MapType::Pair* pair = map_.LookupPair(node); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 intptr_t source_uri_index); | 85 intptr_t source_uri_index); |
86 Script& ScriptAt(intptr_t source_uri_index, String* import_uri = NULL); | 86 Script& ScriptAt(intptr_t source_uri_index, String* import_uri = NULL); |
87 | 87 |
88 void GenerateFieldAccessors(const dart::Class& klass, | 88 void GenerateFieldAccessors(const dart::Class& klass, |
89 const dart::Field& field, | 89 const dart::Field& field, |
90 Field* kernel_field); | 90 Field* kernel_field); |
91 | 91 |
92 void SetupFieldAccessorFunction(const dart::Class& klass, | 92 void SetupFieldAccessorFunction(const dart::Class& klass, |
93 const dart::Function& function); | 93 const dart::Function& function); |
94 | 94 |
95 dart::Library& LookupLibrary(Library* library); | 95 dart::Library& LookupLibrary(CanonicalName* library); |
96 dart::Class& LookupClass(Class* klass); | 96 dart::Class& LookupClass(CanonicalName* klass); |
97 | 97 |
98 dart::RawFunction::Kind GetFunctionType(Procedure* kernel_procedure); | 98 dart::RawFunction::Kind GetFunctionType(Procedure* kernel_procedure); |
99 | 99 |
100 Program* program_; | 100 Program* program_; |
101 | 101 |
102 dart::Thread* thread_; | 102 dart::Thread* thread_; |
103 dart::Zone* zone_; | 103 dart::Zone* zone_; |
104 dart::Isolate* isolate_; | 104 dart::Isolate* isolate_; |
105 Array& scripts_; | 105 Array& scripts_; |
106 ActiveClass active_class_; | 106 ActiveClass active_class_; |
107 BuildingTranslationHelper translation_helper_; | 107 BuildingTranslationHelper translation_helper_; |
108 DartTypeTranslator type_translator_; | 108 DartTypeTranslator type_translator_; |
109 | 109 |
110 Mapping<Library, dart::Library> libraries_; | 110 Mapping<CanonicalName, dart::Library> libraries_; |
111 Mapping<Class, dart::Class> classes_; | 111 Mapping<CanonicalName, dart::Class> classes_; |
112 }; | 112 }; |
113 | 113 |
114 } // namespace kernel | 114 } // namespace kernel |
115 } // namespace dart | 115 } // namespace dart |
116 | 116 |
117 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 117 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
118 #endif // RUNTIME_VM_KERNEL_READER_H_ | 118 #endif // RUNTIME_VM_KERNEL_READER_H_ |
OLD | NEW |