| 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 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "vm/kernel.h" | 10 #include "vm/kernel.h" |
| 11 #include "vm/kernel_to_il.h" | 11 #include "vm/kernel_to_il.h" |
| 12 #include "vm/object.h" | 12 #include "vm/object.h" |
| 13 | 13 |
| 14 namespace dart { | 14 namespace dart { |
| 15 namespace kernel { | 15 namespace kernel { |
| 16 | 16 |
| 17 class KernelReader; | 17 class KernelReader; |
| 18 | 18 |
| 19 class BuildingTranslationHelper : public TranslationHelper { | 19 class BuildingTranslationHelper : public TranslationHelper { |
| 20 public: | 20 public: |
| 21 BuildingTranslationHelper(KernelReader* reader, dart::Thread* thread, | 21 BuildingTranslationHelper(KernelReader* reader, |
| 22 dart::Zone* zone, Isolate* isolate) | 22 dart::Thread* thread, |
| 23 dart::Zone* zone, |
| 24 Isolate* isolate) |
| 23 : TranslationHelper(thread, zone, isolate), reader_(reader) {} | 25 : TranslationHelper(thread, zone, isolate), reader_(reader) {} |
| 24 virtual ~BuildingTranslationHelper() {} | 26 virtual ~BuildingTranslationHelper() {} |
| 25 | 27 |
| 26 virtual void SetFinalize(bool finalize); | 28 virtual void SetFinalize(bool finalize); |
| 27 | 29 |
| 28 virtual RawLibrary* LookupLibraryByKernelLibrary(Library* library); | 30 virtual RawLibrary* LookupLibraryByKernelLibrary(Library* library); |
| 29 virtual RawClass* LookupClassByKernelClass(Class* klass); | 31 virtual RawClass* LookupClassByKernelClass(Class* klass); |
| 30 | 32 |
| 31 private: | 33 private: |
| 32 KernelReader* reader_; | 34 KernelReader* reader_; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 buffer_length_(len) {} | 67 buffer_length_(len) {} |
| 66 | 68 |
| 67 // Returns either a library or a failure object. | 69 // Returns either a library or a failure object. |
| 68 dart::Object& ReadProgram(); | 70 dart::Object& ReadProgram(); |
| 69 | 71 |
| 70 static void SetupFunctionParameters(TranslationHelper translation_helper_, | 72 static void SetupFunctionParameters(TranslationHelper translation_helper_, |
| 71 DartTypeTranslator type_translator_, | 73 DartTypeTranslator type_translator_, |
| 72 const dart::Class& owner, | 74 const dart::Class& owner, |
| 73 const dart::Function& function, | 75 const dart::Function& function, |
| 74 FunctionNode* kernel_function, | 76 FunctionNode* kernel_function, |
| 75 bool is_method, bool is_closure); | 77 bool is_method, |
| 78 bool is_closure); |
| 76 | 79 |
| 77 void ReadLibrary(Library* kernel_library); | 80 void ReadLibrary(Library* kernel_library); |
| 78 | 81 |
| 79 private: | 82 private: |
| 80 friend class BuildingTranslationHelper; | 83 friend class BuildingTranslationHelper; |
| 81 | 84 |
| 82 void ReadPreliminaryClass(dart::Class* klass, Class* kernel_klass); | 85 void ReadPreliminaryClass(dart::Class* klass, Class* kernel_klass); |
| 83 void ReadClass(const dart::Library& library, Class* kernel_klass); | 86 void ReadClass(const dart::Library& library, Class* kernel_klass); |
| 84 void ReadProcedure(const dart::Library& library, const dart::Class& owner, | 87 void ReadProcedure(const dart::Library& library, |
| 85 Procedure* procedure, Class* kernel_klass = NULL); | 88 const dart::Class& owner, |
| 89 Procedure* procedure, |
| 90 Class* kernel_klass = NULL); |
| 86 | 91 |
| 87 void GenerateFieldAccessors(const dart::Class& klass, | 92 void GenerateFieldAccessors(const dart::Class& klass, |
| 88 const dart::Field& field, Field* kernel_field); | 93 const dart::Field& field, |
| 94 Field* kernel_field); |
| 89 | 95 |
| 90 void SetupFieldAccessorFunction(const dart::Class& klass, | 96 void SetupFieldAccessorFunction(const dart::Class& klass, |
| 91 const dart::Function& function); | 97 const dart::Function& function); |
| 92 | 98 |
| 93 dart::Library& LookupLibrary(Library* library); | 99 dart::Library& LookupLibrary(Library* library); |
| 94 dart::Class& LookupClass(Class* klass); | 100 dart::Class& LookupClass(Class* klass); |
| 95 | 101 |
| 96 dart::RawFunction::Kind GetFunctionType(Procedure* kernel_procedure); | 102 dart::RawFunction::Kind GetFunctionType(Procedure* kernel_procedure); |
| 97 | 103 |
| 98 dart::Thread* thread_; | 104 dart::Thread* thread_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 111 intptr_t buffer_length_; | 117 intptr_t buffer_length_; |
| 112 | 118 |
| 113 Mapping<Library, dart::Library> libraries_; | 119 Mapping<Library, dart::Library> libraries_; |
| 114 Mapping<Class, dart::Class> classes_; | 120 Mapping<Class, dart::Class> classes_; |
| 115 }; | 121 }; |
| 116 | 122 |
| 117 } // namespace kernel | 123 } // namespace kernel |
| 118 } // namespace dart | 124 } // namespace dart |
| 119 | 125 |
| 120 #endif // RUNTIME_VM_KERNEL_READER_H_ | 126 #endif // RUNTIME_VM_KERNEL_READER_H_ |
| OLD | NEW |