Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(848)

Side by Side Diff: runtime/vm/isolate_reload.h

Issue 2512483002: Support reloading from source on top of a script snapshot. (Closed)
Patch Set: bug fixes Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_ISOLATE_RELOAD_H_ 5 #ifndef RUNTIME_VM_ISOLATE_RELOAD_H_
6 #define RUNTIME_VM_ISOLATE_RELOAD_H_ 6 #define RUNTIME_VM_ISOLATE_RELOAD_H_
7 7
8 #include "include/dart_tools_api.h" 8 #include "include/dart_tools_api.h"
9 9
10 #include "vm/hash_map.h" 10 #include "vm/hash_map.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 const Class& from_; 124 const Class& from_;
125 const Class& to_; 125 const Class& to_;
126 }; 126 };
127 127
128 128
129 class IsolateReloadContext { 129 class IsolateReloadContext {
130 public: 130 public:
131 explicit IsolateReloadContext(Isolate* isolate, JSONStream* js); 131 explicit IsolateReloadContext(Isolate* isolate, JSONStream* js);
132 ~IsolateReloadContext(); 132 ~IsolateReloadContext();
133 133
134 void Reload(bool force_reload); 134 void Reload(bool force_reload,
135 const char* root_script_url = NULL,
136 const char* packages_url = NULL);
135 137
136 // All zone allocated objects must be allocated from this zone. 138 // All zone allocated objects must be allocated from this zone.
137 Zone* zone() const { return zone_; } 139 Zone* zone() const { return zone_; }
138 140
139 bool reload_skipped() const { return reload_skipped_; } 141 bool reload_skipped() const { return reload_skipped_; }
140 bool reload_aborted() const { return reload_aborted_; } 142 bool reload_aborted() const { return reload_aborted_; }
141 RawError* error() const; 143 RawError* error() const;
142 int64_t reload_timestamp() const { return reload_timestamp_; } 144 int64_t reload_timestamp() const { return reload_timestamp_; }
143 145
144 static Dart_FileModifiedCallback file_modified_callback() { 146 static Dart_FileModifiedCallback file_modified_callback() {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 bool dirty; 297 bool dirty;
296 }; 298 };
297 MallocGrowableArray<LibraryInfo> library_infos_; 299 MallocGrowableArray<LibraryInfo> library_infos_;
298 300
299 // A bit vector indicating which of the original libraries were modified. 301 // A bit vector indicating which of the original libraries were modified.
300 BitVector* modified_libs_; 302 BitVector* modified_libs_;
301 303
302 RawClass* OldClassOrNull(const Class& replacement_or_new); 304 RawClass* OldClassOrNull(const Class& replacement_or_new);
303 305
304 RawLibrary* OldLibraryOrNull(const Library& replacement_or_new); 306 RawLibrary* OldLibraryOrNull(const Library& replacement_or_new);
307
308 RawLibrary* OldLibraryOrNullBaseMoved(const Library& replacement_or_new);
309
305 void BuildLibraryMapping(); 310 void BuildLibraryMapping();
306 311
307 void AddClassMapping(const Class& replacement_or_new, const Class& original); 312 void AddClassMapping(const Class& replacement_or_new, const Class& original);
308 313
309 void AddLibraryMapping(const Library& replacement_or_new, 314 void AddLibraryMapping(const Library& replacement_or_new,
310 const Library& original); 315 const Library& original);
311 316
312 void AddStaticFieldMapping(const Field& old_field, const Field& new_field); 317 void AddStaticFieldMapping(const Field& old_field, const Field& new_field);
313 318
314 void AddBecomeMapping(const Object& old, const Object& neu); 319 void AddBecomeMapping(const Object& old, const Object& neu);
315 void AddEnumBecomeMapping(const Object& old, const Object& neu); 320 void AddEnumBecomeMapping(const Object& old, const Object& neu);
316 321
317 void RebuildDirectSubclasses(); 322 void RebuildDirectSubclasses();
318 323
319 RawClass* MappedClass(const Class& replacement_or_new); 324 RawClass* MappedClass(const Class& replacement_or_new);
320 RawLibrary* MappedLibrary(const Library& replacement_or_new); 325 RawLibrary* MappedLibrary(const Library& replacement_or_new);
321 326
322 RawObject** from() { return reinterpret_cast<RawObject**>(&script_uri_); } 327 RawObject** from() { return reinterpret_cast<RawObject**>(&script_url_); }
323 RawString* script_uri_; 328 RawString* script_url_;
324 RawError* error_; 329 RawError* error_;
325 RawArray* old_classes_set_storage_; 330 RawArray* old_classes_set_storage_;
326 RawArray* class_map_storage_; 331 RawArray* class_map_storage_;
327 RawArray* old_libraries_set_storage_; 332 RawArray* old_libraries_set_storage_;
328 RawArray* library_map_storage_; 333 RawArray* library_map_storage_;
329 RawArray* become_map_storage_; 334 RawArray* become_map_storage_;
330 RawGrowableObjectArray* become_enum_mappings_; 335 RawGrowableObjectArray* become_enum_mappings_;
331 RawLibrary* saved_root_library_; 336 RawLibrary* saved_root_library_;
332 RawGrowableObjectArray* saved_libraries_; 337 RawGrowableObjectArray* saved_libraries_;
333 RawObject** to() { return reinterpret_cast<RawObject**>(&saved_libraries_); } 338 RawString* root_url_prefix_;
339 RawString* old_root_url_prefix_;
340 RawObject** to() {
341 return reinterpret_cast<RawObject**>(&old_root_url_prefix_);
342 }
334 343
335 friend class Isolate; 344 friend class Isolate;
336 friend class Class; // AddStaticFieldMapping, AddEnumBecomeMapping. 345 friend class Class; // AddStaticFieldMapping, AddEnumBecomeMapping.
337 friend class Library; 346 friend class Library;
338 friend class ObjectLocator; 347 friend class ObjectLocator;
339 friend class MarkFunctionsForRecompilation; // IsDirty. 348 friend class MarkFunctionsForRecompilation; // IsDirty.
340 friend class ReasonForCancelling; 349 friend class ReasonForCancelling;
341 350
342 static Dart_FileModifiedCallback file_modified_callback_; 351 static Dart_FileModifiedCallback file_modified_callback_;
343 }; 352 };
344 353
345 } // namespace dart 354 } // namespace dart
346 355
347 #endif // RUNTIME_VM_ISOLATE_RELOAD_H_ 356 #endif // RUNTIME_VM_ISOLATE_RELOAD_H_
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/isolate_reload.cc » ('j') | runtime/vm/unit_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698