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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(); } | 153 bool Object::IsAccessorInfo() const { return IsExecutableAccessorInfo(); } |
154 | 154 |
155 | 155 |
156 bool Object::IsSmi() const { | |
157 return HAS_SMI_TAG(this); | |
158 } | |
159 | |
160 | |
161 bool Object::IsHeapObject() const { | |
162 return Internals::HasHeapObjectTag(this); | |
163 } | |
164 | |
165 | |
166 TYPE_CHECKER(HeapNumber, HEAP_NUMBER_TYPE) | 156 TYPE_CHECKER(HeapNumber, HEAP_NUMBER_TYPE) |
167 TYPE_CHECKER(MutableHeapNumber, MUTABLE_HEAP_NUMBER_TYPE) | 157 TYPE_CHECKER(MutableHeapNumber, MUTABLE_HEAP_NUMBER_TYPE) |
168 TYPE_CHECKER(Symbol, SYMBOL_TYPE) | 158 TYPE_CHECKER(Symbol, SYMBOL_TYPE) |
169 TYPE_CHECKER(Simd128Value, SIMD128_VALUE_TYPE) | 159 TYPE_CHECKER(Simd128Value, SIMD128_VALUE_TYPE) |
170 | 160 |
171 | 161 |
172 #define SIMD128_TYPE_CHECKER(TYPE, Type, type, lane_count, lane_type) \ | 162 #define SIMD128_TYPE_CHECKER(TYPE, Type, type, lane_count, lane_type) \ |
173 bool Object::Is##Type() const { \ | 163 bool Object::Is##Type() const { \ |
174 return Object::IsHeapObject() && \ | 164 return Object::IsHeapObject() && \ |
175 HeapObject::cast(this)->map() == \ | 165 HeapObject::cast(this)->map() == \ |
(...skipping 7726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7902 #undef READ_INT64_FIELD | 7892 #undef READ_INT64_FIELD |
7903 #undef WRITE_INT64_FIELD | 7893 #undef WRITE_INT64_FIELD |
7904 #undef READ_BYTE_FIELD | 7894 #undef READ_BYTE_FIELD |
7905 #undef WRITE_BYTE_FIELD | 7895 #undef WRITE_BYTE_FIELD |
7906 #undef NOBARRIER_READ_BYTE_FIELD | 7896 #undef NOBARRIER_READ_BYTE_FIELD |
7907 #undef NOBARRIER_WRITE_BYTE_FIELD | 7897 #undef NOBARRIER_WRITE_BYTE_FIELD |
7908 | 7898 |
7909 } } // namespace v8::internal | 7899 } } // namespace v8::internal |
7910 | 7900 |
7911 #endif // V8_OBJECTS_INL_H_ | 7901 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |