| 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 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 return true; | 745 return true; |
| 746 } | 746 } |
| 747 | 747 |
| 748 bool HeapObject::IsHandlerTable() const { | 748 bool HeapObject::IsHandlerTable() const { |
| 749 if (!IsFixedArray()) return false; | 749 if (!IsFixedArray()) return false; |
| 750 // There's actually no way to see the difference between a fixed array and | 750 // There's actually no way to see the difference between a fixed array and |
| 751 // a handler table array. | 751 // a handler table array. |
| 752 return true; | 752 return true; |
| 753 } | 753 } |
| 754 | 754 |
| 755 bool HeapObject::IsTemplateList() const { |
| 756 if (!IsFixedArray()) return false; |
| 757 // There's actually no way to see the difference between a fixed array and |
| 758 // a template list. |
| 759 if (FixedArray::cast(this)->length() < 1) return false; |
| 760 return true; |
| 761 } |
| 762 |
| 755 bool HeapObject::IsDependentCode() const { | 763 bool HeapObject::IsDependentCode() const { |
| 756 if (!IsFixedArray()) return false; | 764 if (!IsFixedArray()) return false; |
| 757 // There's actually no way to see the difference between a fixed array and | 765 // There's actually no way to see the difference between a fixed array and |
| 758 // a dependent codes array. | 766 // a dependent codes array. |
| 759 return true; | 767 return true; |
| 760 } | 768 } |
| 761 | 769 |
| 762 bool HeapObject::IsContext() const { | 770 bool HeapObject::IsContext() const { |
| 763 Map* map = this->map(); | 771 Map* map = this->map(); |
| 764 Heap* heap = GetHeap(); | 772 Heap* heap = GetHeap(); |
| (...skipping 2472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3237 CAST_ACCESSOR(Name) | 3245 CAST_ACCESSOR(Name) |
| 3238 CAST_ACCESSOR(NameDictionary) | 3246 CAST_ACCESSOR(NameDictionary) |
| 3239 CAST_ACCESSOR(NormalizedMapCache) | 3247 CAST_ACCESSOR(NormalizedMapCache) |
| 3240 CAST_ACCESSOR(Object) | 3248 CAST_ACCESSOR(Object) |
| 3241 CAST_ACCESSOR(ObjectHashTable) | 3249 CAST_ACCESSOR(ObjectHashTable) |
| 3242 CAST_ACCESSOR(ObjectHashSet) | 3250 CAST_ACCESSOR(ObjectHashSet) |
| 3243 CAST_ACCESSOR(Oddball) | 3251 CAST_ACCESSOR(Oddball) |
| 3244 CAST_ACCESSOR(OrderedHashMap) | 3252 CAST_ACCESSOR(OrderedHashMap) |
| 3245 CAST_ACCESSOR(OrderedHashSet) | 3253 CAST_ACCESSOR(OrderedHashSet) |
| 3246 CAST_ACCESSOR(PropertyCell) | 3254 CAST_ACCESSOR(PropertyCell) |
| 3255 CAST_ACCESSOR(TemplateList) |
| 3247 CAST_ACCESSOR(ScopeInfo) | 3256 CAST_ACCESSOR(ScopeInfo) |
| 3248 CAST_ACCESSOR(SeededNumberDictionary) | 3257 CAST_ACCESSOR(SeededNumberDictionary) |
| 3249 CAST_ACCESSOR(SeqOneByteString) | 3258 CAST_ACCESSOR(SeqOneByteString) |
| 3250 CAST_ACCESSOR(SeqString) | 3259 CAST_ACCESSOR(SeqString) |
| 3251 CAST_ACCESSOR(SeqTwoByteString) | 3260 CAST_ACCESSOR(SeqTwoByteString) |
| 3252 CAST_ACCESSOR(SharedFunctionInfo) | 3261 CAST_ACCESSOR(SharedFunctionInfo) |
| 3253 CAST_ACCESSOR(Simd128Value) | 3262 CAST_ACCESSOR(Simd128Value) |
| 3254 CAST_ACCESSOR(SlicedString) | 3263 CAST_ACCESSOR(SlicedString) |
| 3255 CAST_ACCESSOR(Smi) | 3264 CAST_ACCESSOR(Smi) |
| 3256 CAST_ACCESSOR(String) | 3265 CAST_ACCESSOR(String) |
| (...skipping 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5683 kInstanceCallHandlerOffset) | 5692 kInstanceCallHandlerOffset) |
| 5684 ACCESSORS(FunctionTemplateInfo, access_check_info, Object, | 5693 ACCESSORS(FunctionTemplateInfo, access_check_info, Object, |
| 5685 kAccessCheckInfoOffset) | 5694 kAccessCheckInfoOffset) |
| 5686 ACCESSORS(FunctionTemplateInfo, shared_function_info, Object, | 5695 ACCESSORS(FunctionTemplateInfo, shared_function_info, Object, |
| 5687 kSharedFunctionInfoOffset) | 5696 kSharedFunctionInfoOffset) |
| 5688 | 5697 |
| 5689 SMI_ACCESSORS(FunctionTemplateInfo, flag, kFlagOffset) | 5698 SMI_ACCESSORS(FunctionTemplateInfo, flag, kFlagOffset) |
| 5690 | 5699 |
| 5691 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset) | 5700 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset) |
| 5692 ACCESSORS(ObjectTemplateInfo, data, Object, kDataOffset) | 5701 ACCESSORS(ObjectTemplateInfo, data, Object, kDataOffset) |
| 5702 |
| 5693 int ObjectTemplateInfo::internal_field_count() const { | 5703 int ObjectTemplateInfo::internal_field_count() const { |
| 5694 Object* value = data(); | 5704 Object* value = data(); |
| 5695 DCHECK(value->IsSmi()); | 5705 DCHECK(value->IsSmi()); |
| 5696 return InternalFieldCount::decode(Smi::cast(value)->value()); | 5706 return InternalFieldCount::decode(Smi::cast(value)->value()); |
| 5697 } | 5707 } |
| 5708 |
| 5698 void ObjectTemplateInfo::set_internal_field_count(int count) { | 5709 void ObjectTemplateInfo::set_internal_field_count(int count) { |
| 5699 return set_data(Smi::FromInt( | 5710 return set_data(Smi::FromInt( |
| 5700 InternalFieldCount::update(Smi::cast(data())->value(), count))); | 5711 InternalFieldCount::update(Smi::cast(data())->value(), count))); |
| 5701 } | 5712 } |
| 5713 |
| 5702 bool ObjectTemplateInfo::immutable_proto() const { | 5714 bool ObjectTemplateInfo::immutable_proto() const { |
| 5703 Object* value = data(); | 5715 Object* value = data(); |
| 5704 DCHECK(value->IsSmi()); | 5716 DCHECK(value->IsSmi()); |
| 5705 return IsImmutablePrototype::decode(Smi::cast(value)->value()); | 5717 return IsImmutablePrototype::decode(Smi::cast(value)->value()); |
| 5706 } | 5718 } |
| 5719 |
| 5707 void ObjectTemplateInfo::set_immutable_proto(bool immutable) { | 5720 void ObjectTemplateInfo::set_immutable_proto(bool immutable) { |
| 5708 return set_data(Smi::FromInt( | 5721 return set_data(Smi::FromInt( |
| 5709 IsImmutablePrototype::update(Smi::cast(data())->value(), immutable))); | 5722 IsImmutablePrototype::update(Smi::cast(data())->value(), immutable))); |
| 5710 } | 5723 } |
| 5711 | 5724 |
| 5725 int TemplateList::length() const { |
| 5726 return Smi::cast(FixedArray::cast(this)->get(kLengthIndex))->value(); |
| 5727 } |
| 5728 |
| 5729 Object* TemplateList::get(int index) const { |
| 5730 return FixedArray::cast(this)->get(kFirstElementIndex + index); |
| 5731 } |
| 5732 |
| 5733 void TemplateList::set(int index, Object* value) { |
| 5734 FixedArray::cast(this)->set(kFirstElementIndex + index, value); |
| 5735 } |
| 5736 |
| 5712 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) | 5737 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) |
| 5713 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset) | 5738 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset) |
| 5714 SMI_ACCESSORS(AllocationSite, pretenure_data, kPretenureDataOffset) | 5739 SMI_ACCESSORS(AllocationSite, pretenure_data, kPretenureDataOffset) |
| 5715 SMI_ACCESSORS(AllocationSite, pretenure_create_count, | 5740 SMI_ACCESSORS(AllocationSite, pretenure_create_count, |
| 5716 kPretenureCreateCountOffset) | 5741 kPretenureCreateCountOffset) |
| 5717 ACCESSORS(AllocationSite, dependent_code, DependentCode, | 5742 ACCESSORS(AllocationSite, dependent_code, DependentCode, |
| 5718 kDependentCodeOffset) | 5743 kDependentCodeOffset) |
| 5719 ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset) | 5744 ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset) |
| 5720 ACCESSORS(AllocationMemento, allocation_site, Object, kAllocationSiteOffset) | 5745 ACCESSORS(AllocationMemento, allocation_site, Object, kAllocationSiteOffset) |
| 5721 | 5746 |
| (...skipping 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8148 #undef WRITE_INT64_FIELD | 8173 #undef WRITE_INT64_FIELD |
| 8149 #undef READ_BYTE_FIELD | 8174 #undef READ_BYTE_FIELD |
| 8150 #undef WRITE_BYTE_FIELD | 8175 #undef WRITE_BYTE_FIELD |
| 8151 #undef NOBARRIER_READ_BYTE_FIELD | 8176 #undef NOBARRIER_READ_BYTE_FIELD |
| 8152 #undef NOBARRIER_WRITE_BYTE_FIELD | 8177 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 8153 | 8178 |
| 8154 } // namespace internal | 8179 } // namespace internal |
| 8155 } // namespace v8 | 8180 } // namespace v8 |
| 8156 | 8181 |
| 8157 #endif // V8_OBJECTS_INL_H_ | 8182 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |