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

Unified Diff: runtime/vm/object_reload.cc

Issue 2194333002: RELOAD: Maintain identity of static tear-offs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 years, 5 months 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 | « runtime/vm/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_reload.cc
diff --git a/runtime/vm/object_reload.cc b/runtime/vm/object_reload.cc
index 046333438cb6f655df89e1730501f5610f1865ed..62a983543f5c14285da60195b28897e94325c890 100644
--- a/runtime/vm/object_reload.cc
+++ b/runtime/vm/object_reload.cc
@@ -363,6 +363,32 @@ void Class::PatchFieldsAndFunctions() const {
}
+void Class::MigrateImplicitStaticClosures(IsolateReloadContext* irc,
+ const Class& new_cls) const {
+ const Array& funcs = Array::Handle(functions());
+ Function& old_func = Function::Handle();
+ String& selector = String::Handle();
+ Function& new_func = Function::Handle();
+ Instance& old_closure = Instance::Handle();
+ Instance& new_closure = Instance::Handle();
+ for (intptr_t i = 0; i < funcs.Length(); i++) {
+ old_func ^= funcs.At(i);
+ if (old_func.is_static() &&
+ old_func.HasImplicitClosureFunction()) {
+ selector = old_func.name();
+ new_func = new_cls.LookupFunction(selector);
+ if (!new_func.IsNull() && new_func.is_static()) {
+ old_func = old_func.ImplicitClosureFunction();
+ old_closure = old_func.ImplicitStaticClosure();
+ new_func = new_func.ImplicitClosureFunction();
+ new_closure = new_func.ImplicitStaticClosure();
+ irc->AddBecomeMapping(old_closure, new_closure);
+ }
+ }
+ }
+}
+
+
class EnumClassConflict : public ClassReasonForCancelling {
public:
EnumClassConflict(const Class& from, const Class& to)
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698