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

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

Issue 2512483002: Support reloading from source on top of a script snapshot. (Closed)
Patch Set: ... 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
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/isolate_reload.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 const Class& from_; 129 const Class& from_;
130 const Class& to_; 130 const Class& to_;
131 }; 131 };
132 132
133 133
134 class IsolateReloadContext { 134 class IsolateReloadContext {
135 public: 135 public:
136 explicit IsolateReloadContext(Isolate* isolate, JSONStream* js); 136 explicit IsolateReloadContext(Isolate* isolate, JSONStream* js);
137 ~IsolateReloadContext(); 137 ~IsolateReloadContext();
138 138
139 void Reload(bool force_reload); 139 void Reload(bool force_reload,
140 const char* root_script_url = NULL,
141 const char* packages_url = NULL);
140 142
141 // All zone allocated objects must be allocated from this zone. 143 // All zone allocated objects must be allocated from this zone.
142 Zone* zone() const { return zone_; } 144 Zone* zone() const { return zone_; }
143 145
144 bool reload_skipped() const { return reload_skipped_; } 146 bool reload_skipped() const { return reload_skipped_; }
145 bool reload_aborted() const { return reload_aborted_; } 147 bool reload_aborted() const { return reload_aborted_; }
146 RawError* error() const; 148 RawError* error() const;
147 int64_t reload_timestamp() const { return reload_timestamp_; } 149 int64_t reload_timestamp() const { return reload_timestamp_; }
148 150
149 static Dart_FileModifiedCallback file_modified_callback() { 151 static Dart_FileModifiedCallback file_modified_callback() {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 bool dirty; 306 bool dirty;
305 }; 307 };
306 MallocGrowableArray<LibraryInfo> library_infos_; 308 MallocGrowableArray<LibraryInfo> library_infos_;
307 309
308 // A bit vector indicating which of the original libraries were modified. 310 // A bit vector indicating which of the original libraries were modified.
309 BitVector* modified_libs_; 311 BitVector* modified_libs_;
310 312
311 RawClass* OldClassOrNull(const Class& replacement_or_new); 313 RawClass* OldClassOrNull(const Class& replacement_or_new);
312 314
313 RawLibrary* OldLibraryOrNull(const Library& replacement_or_new); 315 RawLibrary* OldLibraryOrNull(const Library& replacement_or_new);
316
317 RawLibrary* OldLibraryOrNullBaseMoved(const Library& replacement_or_new);
318
314 void BuildLibraryMapping(); 319 void BuildLibraryMapping();
315 320
316 void AddClassMapping(const Class& replacement_or_new, const Class& original); 321 void AddClassMapping(const Class& replacement_or_new, const Class& original);
317 322
318 void AddLibraryMapping(const Library& replacement_or_new, 323 void AddLibraryMapping(const Library& replacement_or_new,
319 const Library& original); 324 const Library& original);
320 325
321 void AddStaticFieldMapping(const Field& old_field, const Field& new_field); 326 void AddStaticFieldMapping(const Field& old_field, const Field& new_field);
322 327
323 void AddBecomeMapping(const Object& old, const Object& neu); 328 void AddBecomeMapping(const Object& old, const Object& neu);
324 void AddEnumBecomeMapping(const Object& old, const Object& neu); 329 void AddEnumBecomeMapping(const Object& old, const Object& neu);
325 330
326 void RebuildDirectSubclasses(); 331 void RebuildDirectSubclasses();
327 332
328 RawClass* MappedClass(const Class& replacement_or_new); 333 RawClass* MappedClass(const Class& replacement_or_new);
329 RawLibrary* MappedLibrary(const Library& replacement_or_new); 334 RawLibrary* MappedLibrary(const Library& replacement_or_new);
330 335
331 RawObject** from() { return reinterpret_cast<RawObject**>(&script_uri_); } 336 RawObject** from() { return reinterpret_cast<RawObject**>(&script_url_); }
332 RawString* script_uri_; 337 RawString* script_url_;
333 RawError* error_; 338 RawError* error_;
334 RawArray* old_classes_set_storage_; 339 RawArray* old_classes_set_storage_;
335 RawArray* class_map_storage_; 340 RawArray* class_map_storage_;
336 RawArray* old_libraries_set_storage_; 341 RawArray* old_libraries_set_storage_;
337 RawArray* library_map_storage_; 342 RawArray* library_map_storage_;
338 RawArray* become_map_storage_; 343 RawArray* become_map_storage_;
339 RawGrowableObjectArray* become_enum_mappings_; 344 RawGrowableObjectArray* become_enum_mappings_;
340 RawLibrary* saved_root_library_; 345 RawLibrary* saved_root_library_;
341 RawGrowableObjectArray* saved_libraries_; 346 RawGrowableObjectArray* saved_libraries_;
342 RawObject** to() { return reinterpret_cast<RawObject**>(&saved_libraries_); } 347 RawString* root_url_prefix_;
348 RawString* old_root_url_prefix_;
349 RawObject** to() {
350 return reinterpret_cast<RawObject**>(&old_root_url_prefix_);
351 }
343 352
344 friend class Isolate; 353 friend class Isolate;
345 friend class Class; // AddStaticFieldMapping, AddEnumBecomeMapping. 354 friend class Class; // AddStaticFieldMapping, AddEnumBecomeMapping.
346 friend class Library; 355 friend class Library;
347 friend class ObjectLocator; 356 friend class ObjectLocator;
348 friend class MarkFunctionsForRecompilation; // IsDirty. 357 friend class MarkFunctionsForRecompilation; // IsDirty.
349 friend class ReasonForCancelling; 358 friend class ReasonForCancelling;
350 359
351 static Dart_FileModifiedCallback file_modified_callback_; 360 static Dart_FileModifiedCallback file_modified_callback_;
352 }; 361 };
353 362
354 } // namespace dart 363 } // namespace dart
355 364
356 #endif // RUNTIME_VM_ISOLATE_RELOAD_H_ 365 #endif // RUNTIME_VM_ISOLATE_RELOAD_H_
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/isolate_reload.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698