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

Side by Side Diff: src/objects-inl.h

Issue 2631123002: [crankshaft][runtime] Initialize uninitialized double fields with hole NaN value instead of 0.0. (Closed)
Patch Set: Addressing comments Created 3 years, 11 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
« no previous file with comments | « src/objects.cc ('k') | src/value-serializer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 if (filter & SKIP_SYMBOLS) return true; 739 if (filter & SKIP_SYMBOLS) return true;
740 if (Symbol::cast(this)->is_private()) return true; 740 if (Symbol::cast(this)->is_private()) return true;
741 } else { 741 } else {
742 if (filter & SKIP_STRINGS) return true; 742 if (filter & SKIP_STRINGS) return true;
743 } 743 }
744 return false; 744 return false;
745 } 745 }
746 746
747 Handle<Object> Object::NewStorageFor(Isolate* isolate, Handle<Object> object, 747 Handle<Object> Object::NewStorageFor(Isolate* isolate, Handle<Object> object,
748 Representation representation) { 748 Representation representation) {
749 if (representation.IsSmi() && object->IsUninitialized(isolate)) {
750 return handle(Smi::kZero, isolate);
751 }
752 if (!representation.IsDouble()) return object; 749 if (!representation.IsDouble()) return object;
753 double value; 750 double value;
754 if (object->IsUninitialized(isolate)) { 751 if (object->IsUninitialized(isolate)) {
755 value = 0; 752 value = bit_cast<double>(kHoleNanInt64);
756 } else if (object->IsMutableHeapNumber()) { 753 } else if (object->IsMutableHeapNumber()) {
757 value = HeapNumber::cast(*object)->value(); 754 value = HeapNumber::cast(*object)->value();
758 } else { 755 } else {
759 value = object->Number(); 756 value = object->Number();
760 } 757 }
761 return isolate->factory()->NewHeapNumber(value, MUTABLE); 758 return isolate->factory()->NewHeapNumber(value, MUTABLE);
762 } 759 }
763 760
764 Handle<Object> Object::WrapForRead(Isolate* isolate, Handle<Object> object, 761 Handle<Object> Object::WrapForRead(Isolate* isolate, Handle<Object> object,
765 Representation representation) { 762 Representation representation) {
(...skipping 7652 matching lines...) Expand 10 before | Expand all | Expand 10 after
8418 #undef WRITE_INT64_FIELD 8415 #undef WRITE_INT64_FIELD
8419 #undef READ_BYTE_FIELD 8416 #undef READ_BYTE_FIELD
8420 #undef WRITE_BYTE_FIELD 8417 #undef WRITE_BYTE_FIELD
8421 #undef NOBARRIER_READ_BYTE_FIELD 8418 #undef NOBARRIER_READ_BYTE_FIELD
8422 #undef NOBARRIER_WRITE_BYTE_FIELD 8419 #undef NOBARRIER_WRITE_BYTE_FIELD
8423 8420
8424 } // namespace internal 8421 } // namespace internal
8425 } // namespace v8 8422 } // namespace v8
8426 8423
8427 #endif // V8_OBJECTS_INL_H_ 8424 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/value-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698