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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 24254004: Make Dart_IdentityEqual live up to its sepc and not leak boxing implementation detail. (Reland r275… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove debug prints Created 7 years, 3 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/lib/identical.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index ff4c0b3d270aa2606ac0104badcdb1ebc152725c..bbb21c31504f7a7d6c7dfea317275fa4311eff3e 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -499,8 +499,18 @@ DART_EXPORT Dart_Handle Dart_ToString(Dart_Handle object) {
DART_EXPORT bool Dart_IdentityEquals(Dart_Handle obj1, Dart_Handle obj2) {
Isolate* isolate = Isolate::Current();
CHECK_ISOLATE(isolate);
- NoGCScope ngc;
- return Api::UnwrapHandle(obj1) == Api::UnwrapHandle(obj2);
+ {
+ NoGCScope ngc;
+ if (Api::UnwrapHandle(obj1) == Api::UnwrapHandle(obj2)) {
+ return true;
+ }
+ }
+ const Object& object1 = Object::Handle(isolate, Api::UnwrapHandle(obj1));
+ const Object& object2 = Object::Handle(isolate, Api::UnwrapHandle(obj2));
+ if (object1.IsInstance() && object2.IsInstance()) {
+ return Instance::Cast(object1).IsIdenticalTo(Instance::Cast(object2));
+ }
+ return false;
}
« no previous file with comments | « runtime/lib/identical.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698