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

Unified Diff: runtime/vm/isolate_reload.h

Issue 2489723003: Run field initializers for new instance fields after a reload (Closed)
Patch Set: Fix a comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/isolate_reload.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate_reload.h
diff --git a/runtime/vm/isolate_reload.h b/runtime/vm/isolate_reload.h
index f2a2df9d56239f90ed64b75b8933af5955e696fa..e5e5da194e7abb3faa9f30e3a5dd6e99d4ce3b3f 100644
--- a/runtime/vm/isolate_reload.h
+++ b/runtime/vm/isolate_reload.h
@@ -58,6 +58,8 @@ class InstanceMorpher : public ZoneAllocated {
// Called on each instance that needs to be morphed.
RawInstance* Morph(const Instance& instance) const;
+ void RunNewFieldInitializers() const;
+
// Adds an object to be morphed.
void AddObject(RawObject* object) const;
@@ -74,6 +76,8 @@ class InstanceMorpher : public ZoneAllocated {
ZoneGrowableArray<const Instance*>* before() const { return before_; }
// Returns the list of morphed objects (matches order in before()).
ZoneGrowableArray<const Instance*>* after() const { return after_; }
+ // Returns the list of new fields.
+ ZoneGrowableArray<const Field*>* new_fields() const { return new_fields_; }
// Returns the cid associated with the from_ and to_ class.
intptr_t cid() const { return cid_; }
@@ -84,6 +88,7 @@ class InstanceMorpher : public ZoneAllocated {
ZoneGrowableArray<intptr_t> mapping_;
ZoneGrowableArray<const Instance*>* before_;
ZoneGrowableArray<const Instance*>* after_;
+ ZoneGrowableArray<const Field*>* new_fields_;
intptr_t cid_;
void ComputeMapping();
@@ -232,6 +237,8 @@ class IsolateReloadContext {
// Transforms the heap based on instance_morphers_.
void MorphInstances();
+ void RunNewFieldInitializers();
+
bool ValidateReload();
void Rollback();
« no previous file with comments | « no previous file | runtime/vm/isolate_reload.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698