| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |