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

Unified Diff: runtime/lib/function.cc

Issue 2187433006: RELOAD: Check if an implicit closure needs rebinding at compile time and adjust closure equality. (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 | « no previous file | runtime/vm/isolate_reload_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/function.cc
diff --git a/runtime/lib/function.cc b/runtime/lib/function.cc
index b7424f5ef84aa22666d6cea97ac135a25d99c0f8..42417629551f264fb973d69aae18a02fa8dcd54f 100644
--- a/runtime/lib/function.cc
+++ b/runtime/lib/function.cc
@@ -47,6 +47,19 @@ DEFINE_NATIVE_ENTRY(Closure_equals, 2) {
const Object& receiver_b = Object::Handle(context_b.At(0));
if (receiver_a.raw() == receiver_b.raw()) return Bool::True().raw();
}
+ } else if (func_a.IsImplicitInstanceClosureFunction() &&
+ func_b.IsImplicitInstanceClosureFunction()) {
+ // TODO(rmacnak): Patch existing tears off during reload instead.
+ const Context& context_a = Context::Handle(receiver.context());
+ const Context& context_b = Context::Handle(
+ Closure::Cast(other).context());
+ const Object& receiver_a = Object::Handle(context_a.At(0));
+ const Object& receiver_b = Object::Handle(context_b.At(0));
+ if ((receiver_a.raw() == receiver_b.raw()) &&
+ (func_a.name() == func_b.name()) &&
+ (func_a.Owner() == func_b.Owner())) {
+ return Bool::True().raw();
+ }
}
}
return Bool::False().raw();
« no previous file with comments | « no previous file | runtime/vm/isolate_reload_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698