| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 | 144 |
| 145 // External objects are not extensible, so the map check is enough. | 145 // External objects are not extensible, so the map check is enough. |
| 146 bool Object::IsExternal() const { | 146 bool Object::IsExternal() const { |
| 147 return Object::IsHeapObject() && | 147 return Object::IsHeapObject() && |
| 148 HeapObject::cast(this)->map() == | 148 HeapObject::cast(this)->map() == |
| 149 HeapObject::cast(this)->GetHeap()->external_map(); | 149 HeapObject::cast(this)->GetHeap()->external_map(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 | 152 |
| 153 bool Object::IsAccessorInfo() const { return IsExecutableAccessorInfo(); } | |
| 154 | |
| 155 | |
| 156 TYPE_CHECKER(HeapNumber, HEAP_NUMBER_TYPE) | 153 TYPE_CHECKER(HeapNumber, HEAP_NUMBER_TYPE) |
| 157 TYPE_CHECKER(MutableHeapNumber, MUTABLE_HEAP_NUMBER_TYPE) | 154 TYPE_CHECKER(MutableHeapNumber, MUTABLE_HEAP_NUMBER_TYPE) |
| 158 TYPE_CHECKER(Symbol, SYMBOL_TYPE) | 155 TYPE_CHECKER(Symbol, SYMBOL_TYPE) |
| 159 TYPE_CHECKER(Simd128Value, SIMD128_VALUE_TYPE) | 156 TYPE_CHECKER(Simd128Value, SIMD128_VALUE_TYPE) |
| 160 | 157 |
| 161 | 158 |
| 162 #define SIMD128_TYPE_CHECKER(TYPE, Type, type, lane_count, lane_type) \ | 159 #define SIMD128_TYPE_CHECKER(TYPE, Type, type, lane_count, lane_type) \ |
| 163 bool Object::Is##Type() const { \ | 160 bool Object::Is##Type() const { \ |
| 164 return Object::IsHeapObject() && \ | 161 return Object::IsHeapObject() && \ |
| 165 HeapObject::cast(this)->map() == \ | 162 HeapObject::cast(this)->map() == \ |
| (...skipping 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3174 | 3171 |
| 3175 void SeededNumberDictionary::set_requires_slow_elements() { | 3172 void SeededNumberDictionary::set_requires_slow_elements() { |
| 3176 set(kMaxNumberKeyIndex, Smi::FromInt(kRequiresSlowElementsMask)); | 3173 set(kMaxNumberKeyIndex, Smi::FromInt(kRequiresSlowElementsMask)); |
| 3177 } | 3174 } |
| 3178 | 3175 |
| 3179 | 3176 |
| 3180 // ------------------------------------ | 3177 // ------------------------------------ |
| 3181 // Cast operations | 3178 // Cast operations |
| 3182 | 3179 |
| 3183 | 3180 |
| 3184 CAST_ACCESSOR(AccessorInfo) | |
| 3185 CAST_ACCESSOR(ArrayList) | 3181 CAST_ACCESSOR(ArrayList) |
| 3186 CAST_ACCESSOR(Bool16x8) | 3182 CAST_ACCESSOR(Bool16x8) |
| 3187 CAST_ACCESSOR(Bool32x4) | 3183 CAST_ACCESSOR(Bool32x4) |
| 3188 CAST_ACCESSOR(Bool8x16) | 3184 CAST_ACCESSOR(Bool8x16) |
| 3189 CAST_ACCESSOR(ByteArray) | 3185 CAST_ACCESSOR(ByteArray) |
| 3190 CAST_ACCESSOR(BytecodeArray) | 3186 CAST_ACCESSOR(BytecodeArray) |
| 3191 CAST_ACCESSOR(Cell) | 3187 CAST_ACCESSOR(Cell) |
| 3192 CAST_ACCESSOR(Code) | 3188 CAST_ACCESSOR(Code) |
| 3193 CAST_ACCESSOR(CodeCacheHashTable) | 3189 CAST_ACCESSOR(CodeCacheHashTable) |
| 3194 CAST_ACCESSOR(CompilationCacheTable) | 3190 CAST_ACCESSOR(CompilationCacheTable) |
| (...skipping 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5467 ACCESSORS(JSGlobalObject, global_proxy, JSObject, kGlobalProxyOffset) | 5463 ACCESSORS(JSGlobalObject, global_proxy, JSObject, kGlobalProxyOffset) |
| 5468 | 5464 |
| 5469 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset) | 5465 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset) |
| 5470 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset) | 5466 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset) |
| 5471 | 5467 |
| 5472 ACCESSORS(AccessorInfo, name, Object, kNameOffset) | 5468 ACCESSORS(AccessorInfo, name, Object, kNameOffset) |
| 5473 SMI_ACCESSORS(AccessorInfo, flag, kFlagOffset) | 5469 SMI_ACCESSORS(AccessorInfo, flag, kFlagOffset) |
| 5474 ACCESSORS(AccessorInfo, expected_receiver_type, Object, | 5470 ACCESSORS(AccessorInfo, expected_receiver_type, Object, |
| 5475 kExpectedReceiverTypeOffset) | 5471 kExpectedReceiverTypeOffset) |
| 5476 | 5472 |
| 5477 ACCESSORS(ExecutableAccessorInfo, getter, Object, kGetterOffset) | 5473 ACCESSORS(AccessorInfo, getter, Object, kGetterOffset) |
| 5478 ACCESSORS(ExecutableAccessorInfo, setter, Object, kSetterOffset) | 5474 ACCESSORS(AccessorInfo, setter, Object, kSetterOffset) |
| 5479 ACCESSORS(ExecutableAccessorInfo, data, Object, kDataOffset) | 5475 ACCESSORS(AccessorInfo, data, Object, kDataOffset) |
| 5480 | 5476 |
| 5481 ACCESSORS(Box, value, Object, kValueOffset) | 5477 ACCESSORS(Box, value, Object, kValueOffset) |
| 5482 | 5478 |
| 5483 ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset) | 5479 ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset) |
| 5484 SMI_ACCESSORS(PrototypeInfo, registry_slot, kRegistrySlotOffset) | 5480 SMI_ACCESSORS(PrototypeInfo, registry_slot, kRegistrySlotOffset) |
| 5485 ACCESSORS(PrototypeInfo, validity_cell, Object, kValidityCellOffset) | 5481 ACCESSORS(PrototypeInfo, validity_cell, Object, kValidityCellOffset) |
| 5486 | 5482 |
| 5487 ACCESSORS(SloppyBlockWithEvalContextExtension, scope_info, ScopeInfo, | 5483 ACCESSORS(SloppyBlockWithEvalContextExtension, scope_info, ScopeInfo, |
| 5488 kScopeInfoOffset) | 5484 kScopeInfoOffset) |
| 5489 ACCESSORS(SloppyBlockWithEvalContextExtension, extension, JSObject, | 5485 ACCESSORS(SloppyBlockWithEvalContextExtension, extension, JSObject, |
| (...skipping 2319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7809 #undef WRITE_INT64_FIELD | 7805 #undef WRITE_INT64_FIELD |
| 7810 #undef READ_BYTE_FIELD | 7806 #undef READ_BYTE_FIELD |
| 7811 #undef WRITE_BYTE_FIELD | 7807 #undef WRITE_BYTE_FIELD |
| 7812 #undef NOBARRIER_READ_BYTE_FIELD | 7808 #undef NOBARRIER_READ_BYTE_FIELD |
| 7813 #undef NOBARRIER_WRITE_BYTE_FIELD | 7809 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7814 | 7810 |
| 7815 } // namespace internal | 7811 } // namespace internal |
| 7816 } // namespace v8 | 7812 } // namespace v8 |
| 7817 | 7813 |
| 7818 #endif // V8_OBJECTS_INL_H_ | 7814 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |