| 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 VM_ISOLATE_RELOAD_H_ | 5 #ifndef VM_ISOLATE_RELOAD_H_ |
| 6 #define VM_ISOLATE_RELOAD_H_ | 6 #define VM_ISOLATE_RELOAD_H_ |
| 7 | 7 |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
| 10 #include "vm/log.h" | 10 #include "vm/log.h" |
| 11 | 11 |
| 12 DECLARE_FLAG(bool, trace_reload); | 12 DECLARE_FLAG(bool, trace_reload); |
| 13 DECLARE_FLAG(bool, trace_reload_verbose); |
| 13 | 14 |
| 14 // 'Trace Isolate Reload' TIR_Print | 15 // 'Trace Isolate Reload' TIR_Print |
| 15 #if defined(_MSC_VER) | 16 #if defined(_MSC_VER) |
| 16 #define TIR_Print(format, ...) \ | 17 #define TIR_Print(format, ...) \ |
| 17 if (FLAG_trace_reload) Log::Current()->Print(format, __VA_ARGS__) | 18 if (FLAG_trace_reload) Log::Current()->Print(format, __VA_ARGS__) |
| 18 #else | 19 #else |
| 19 #define TIR_Print(format, ...) \ | 20 #define TIR_Print(format, ...) \ |
| 20 if (FLAG_trace_reload) Log::Current()->Print(format, ##__VA_ARGS__) | 21 if (FLAG_trace_reload) Log::Current()->Print(format, ##__VA_ARGS__) |
| 21 #endif | 22 #endif |
| 22 | 23 |
| 24 // 'Verbose Trace Isolate Reload' VTIR_Print |
| 25 #if defined(_MSC_VER) |
| 26 #define VTIR_Print(format, ...) \ |
| 27 if (FLAG_trace_reload_verbose) Log::Current()->Print(format, __VA_ARGS__) |
| 28 #else |
| 29 #define VTIR_Print(format, ...) \ |
| 30 if (FLAG_trace_reload_verbose) Log::Current()->Print(format, ##__VA_ARGS__) |
| 31 #endif |
| 32 |
| 23 namespace dart { | 33 namespace dart { |
| 24 | 34 |
| 25 class GrowableObjectArray; | 35 class GrowableObjectArray; |
| 26 class Isolate; | 36 class Isolate; |
| 27 class Library; | 37 class Library; |
| 28 class RawError; | 38 class RawError; |
| 29 class RawGrowableObjectArray; | 39 class RawGrowableObjectArray; |
| 30 class RawLibrary; | 40 class RawLibrary; |
| 31 class RawObject; | 41 class RawObject; |
| 32 class RawString; | 42 class RawString; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 void BuildLibraryMapping(); | 148 void BuildLibraryMapping(); |
| 139 | 149 |
| 140 void AddClassMapping(const Class& replacement_or_new, | 150 void AddClassMapping(const Class& replacement_or_new, |
| 141 const Class& original); | 151 const Class& original); |
| 142 | 152 |
| 143 void AddLibraryMapping(const Library& replacement_or_new, | 153 void AddLibraryMapping(const Library& replacement_or_new, |
| 144 const Library& original); | 154 const Library& original); |
| 145 | 155 |
| 146 void AddStaticFieldMapping(const Field& old_field, const Field& new_field); | 156 void AddStaticFieldMapping(const Field& old_field, const Field& new_field); |
| 147 | 157 |
| 148 void AddBecomeMapping(const Object& old, const Object& nue); | 158 void AddBecomeMapping(const Object& old, const Object& neu); |
| 159 void AddEnumBecomeMapping(const Object& old, const Object& neu); |
| 149 | 160 |
| 150 void RebuildDirectSubclasses(); | 161 void RebuildDirectSubclasses(); |
| 151 | 162 |
| 152 RawClass* MappedClass(const Class& replacement_or_new); | 163 RawClass* MappedClass(const Class& replacement_or_new); |
| 153 RawLibrary* MappedLibrary(const Library& replacement_or_new); | 164 RawLibrary* MappedLibrary(const Library& replacement_or_new); |
| 154 | 165 |
| 155 RawObject** from() { return reinterpret_cast<RawObject**>(&script_uri_); } | 166 RawObject** from() { return reinterpret_cast<RawObject**>(&script_uri_); } |
| 156 RawString* script_uri_; | 167 RawString* script_uri_; |
| 157 RawError* error_; | 168 RawError* error_; |
| 158 RawArray* old_classes_set_storage_; | 169 RawArray* old_classes_set_storage_; |
| 159 RawArray* class_map_storage_; | 170 RawArray* class_map_storage_; |
| 160 RawArray* old_libraries_set_storage_; | 171 RawArray* old_libraries_set_storage_; |
| 161 RawArray* library_map_storage_; | 172 RawArray* library_map_storage_; |
| 162 RawArray* become_map_storage_; | 173 RawArray* become_map_storage_; |
| 174 RawGrowableObjectArray* become_enum_mappings_; |
| 163 RawLibrary* saved_root_library_; | 175 RawLibrary* saved_root_library_; |
| 164 RawGrowableObjectArray* saved_libraries_; | 176 RawGrowableObjectArray* saved_libraries_; |
| 165 RawObject** to() { return reinterpret_cast<RawObject**>(&saved_libraries_); } | 177 RawObject** to() { return reinterpret_cast<RawObject**>(&saved_libraries_); } |
| 166 | 178 |
| 167 friend class Isolate; | 179 friend class Isolate; |
| 168 friend class Class; // AddStaticFieldMapping. | 180 friend class Class; // AddStaticFieldMapping, AddEnumBecomeMapping. |
| 169 }; | 181 }; |
| 170 | 182 |
| 171 } // namespace dart | 183 } // namespace dart |
| 172 | 184 |
| 173 #endif // VM_ISOLATE_RELOAD_H_ | 185 #endif // VM_ISOLATE_RELOAD_H_ |
| OLD | NEW |