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

Unified Diff: runtime/vm/object.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/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.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 7bae66e59fe6ac754f0b027ef312b6be49271c58..82e4ef3087bb16ae09b767ade4692b288817ec6a 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -10483,6 +10483,24 @@ bool Instance::IsInstanceOf(const AbstractType& other,
}
+bool Instance::IsIdenticalTo(const Instance& other) const {
+ if (raw() == other.raw()) return true;
+ if (IsInteger() && other.IsInteger()) {
+ return Equals(other);
+ }
+ if (IsDouble() && other.IsDouble()) {
+ if (Equals(other)) return true;
+ // Check for NaN.
+ const Double& a_double = Double::Cast(*this);
+ const Double& b_double = Double::Cast(other);
+ if (isnan(a_double.value()) && isnan(b_double.value())) {
+ return true;
+ }
+ }
+ return false;
+}
+
+
void Instance::SetNativeField(int index, intptr_t value) const {
ASSERT(IsValidNativeIndex(index));
Object& native_fields = Object::Handle(*NativeFieldsAddr());
« 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