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 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 void Insert(KernelType* node, VmType* object) { map_[node] = object; } | 48 void Insert(KernelType* node, VmType* object) { map_[node] = object; } |
49 | 49 |
50 private: | 50 private: |
51 typedef typename std::map<KernelType*, VmType*> MapType; | 51 typedef typename std::map<KernelType*, VmType*> MapType; |
52 MapType map_; | 52 MapType map_; |
53 }; | 53 }; |
54 | 54 |
55 class KernelReader { | 55 class KernelReader { |
56 public: | 56 public: |
57 KernelReader(const uint8_t* buffer, intptr_t len, bool bootstrapping = false) | 57 KernelReader(const uint8_t* buffer, intptr_t len) |
58 : thread_(dart::Thread::Current()), | 58 : thread_(dart::Thread::Current()), |
59 zone_(thread_->zone()), | 59 zone_(thread_->zone()), |
60 isolate_(thread_->isolate()), | 60 isolate_(thread_->isolate()), |
61 scripts_(Array::ZoneHandle(zone_)), | 61 scripts_(Array::ZoneHandle(zone_)), |
62 program_(NULL), | 62 program_(NULL), |
63 translation_helper_(this, thread_, zone_, isolate_), | 63 translation_helper_(this, thread_, zone_, isolate_), |
64 type_translator_(&translation_helper_, | 64 type_translator_(&translation_helper_, |
65 &active_class_, | 65 &active_class_, |
66 /*finalize=*/false), | 66 /*finalize=*/false), |
67 bootstrapping_(bootstrapping), | |
68 buffer_(buffer), | 67 buffer_(buffer), |
69 buffer_length_(len) {} | 68 buffer_length_(len) {} |
70 | 69 |
71 // Returns either pointer to a program or null. | 70 // Returns either pointer to a program or null. |
72 Program* ReadPrecompiledProgram(); | 71 Program* ReadPrecompiledProgram(); |
73 | 72 |
74 // Returns either a library or a failure object. | 73 // Returns either a library or a failure object. |
75 dart::Object& ReadProgram(); | 74 dart::Object& ReadProgram(); |
76 | 75 |
77 static void SetupFunctionParameters(TranslationHelper translation_helper_, | 76 static void SetupFunctionParameters(TranslationHelper translation_helper_, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 114 |
116 dart::Thread* thread_; | 115 dart::Thread* thread_; |
117 dart::Zone* zone_; | 116 dart::Zone* zone_; |
118 dart::Isolate* isolate_; | 117 dart::Isolate* isolate_; |
119 Array& scripts_; | 118 Array& scripts_; |
120 Program* program_; | 119 Program* program_; |
121 ActiveClass active_class_; | 120 ActiveClass active_class_; |
122 BuildingTranslationHelper translation_helper_; | 121 BuildingTranslationHelper translation_helper_; |
123 DartTypeTranslator type_translator_; | 122 DartTypeTranslator type_translator_; |
124 | 123 |
125 bool bootstrapping_; | |
126 | |
127 const uint8_t* buffer_; | 124 const uint8_t* buffer_; |
128 intptr_t buffer_length_; | 125 intptr_t buffer_length_; |
129 | 126 |
130 Mapping<Library, dart::Library> libraries_; | 127 Mapping<Library, dart::Library> libraries_; |
131 Mapping<Class, dart::Class> classes_; | 128 Mapping<Class, dart::Class> classes_; |
132 }; | 129 }; |
133 | 130 |
134 } // namespace kernel | 131 } // namespace kernel |
135 } // namespace dart | 132 } // namespace dart |
136 | 133 |
137 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 134 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
138 #endif // RUNTIME_VM_KERNEL_READER_H_ | 135 #endif // RUNTIME_VM_KERNEL_READER_H_ |
OLD | NEW |