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

Side by Side Diff: runtime/vm/object.cc

Issue 317643004: Unify handling of identical(NaN, NaN) between generated code and Dart API. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/object_test.cc » ('j') | runtime/vm/object_test.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 13030 matching lines...) Expand 10 before | Expand all | Expand 10 after
13041 return result.raw() == Object::bool_true().raw(); 13041 return result.raw() == Object::bool_true().raw();
13042 } 13042 }
13043 13043
13044 13044
13045 bool Instance::IsIdenticalTo(const Instance& other) const { 13045 bool Instance::IsIdenticalTo(const Instance& other) const {
13046 if (raw() == other.raw()) return true; 13046 if (raw() == other.raw()) return true;
13047 if (IsInteger() && other.IsInteger()) { 13047 if (IsInteger() && other.IsInteger()) {
13048 return Integer::Cast(*this).Equals(other); 13048 return Integer::Cast(*this).Equals(other);
13049 } 13049 }
13050 if (IsDouble() && other.IsDouble()) { 13050 if (IsDouble() && other.IsDouble()) {
13051 if (Double::Cast(*this).CanonicalizeEquals(other)) return true; 13051 return Double::Cast(*this).CanonicalizeEquals(other);
13052 // Check for NaN.
13053 const Double& a_double = Double::Cast(*this);
13054 const Double& b_double = Double::Cast(other);
13055 if (isnan(a_double.value()) && isnan(b_double.value())) {
13056 return true;
13057 }
13058 } 13052 }
13059 return false; 13053 return false;
13060 } 13054 }
13061 13055
13062 13056
13063 intptr_t* Instance::NativeFieldsDataAddr() const { 13057 intptr_t* Instance::NativeFieldsDataAddr() const {
13064 NoGCScope no_gc; 13058 NoGCScope no_gc;
13065 RawTypedData* native_fields = 13059 RawTypedData* native_fields =
13066 reinterpret_cast<RawTypedData*>(*NativeFieldsAddr()); 13060 reinterpret_cast<RawTypedData*>(*NativeFieldsAddr());
13067 if (native_fields == TypedData::null()) { 13061 if (native_fields == TypedData::null()) {
(...skipping 5945 matching lines...) Expand 10 before | Expand all | Expand 10 after
19013 return tag_label.ToCString(); 19007 return tag_label.ToCString();
19014 } 19008 }
19015 19009
19016 19010
19017 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19011 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19018 Instance::PrintJSONImpl(stream, ref); 19012 Instance::PrintJSONImpl(stream, ref);
19019 } 19013 }
19020 19014
19021 19015
19022 } // namespace dart 19016 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object_test.cc » ('j') | runtime/vm/object_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698