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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 return Object::IsHeapObject() && HeapObject::cast(this)->map()->is_callable(); | 183 return Object::IsHeapObject() && HeapObject::cast(this)->map()->is_callable(); |
184 } | 184 } |
185 | 185 |
186 | 186 |
187 bool Object::IsConstructor() const { | 187 bool Object::IsConstructor() const { |
188 return Object::IsHeapObject() && | 188 return Object::IsHeapObject() && |
189 HeapObject::cast(this)->map()->is_constructor(); | 189 HeapObject::cast(this)->map()->is_constructor(); |
190 } | 190 } |
191 | 191 |
192 | 192 |
193 bool Object::IsSpecObject() const { | |
194 return Object::IsHeapObject() | |
195 && HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_RECEIVER_TYPE; | |
196 } | |
197 | |
198 | |
199 bool Object::IsTemplateInfo() const { | 193 bool Object::IsTemplateInfo() const { |
200 return IsObjectTemplateInfo() || IsFunctionTemplateInfo(); | 194 return IsObjectTemplateInfo() || IsFunctionTemplateInfo(); |
201 } | 195 } |
202 | 196 |
203 | 197 |
204 bool Object::IsInternalizedString() const { | 198 bool Object::IsInternalizedString() const { |
205 if (!this->IsHeapObject()) return false; | 199 if (!this->IsHeapObject()) return false; |
206 uint32_t type = HeapObject::cast(this)->map()->instance_type(); | 200 uint32_t type = HeapObject::cast(this)->map()->instance_type(); |
207 STATIC_ASSERT(kNotInternalizedTag != 0); | 201 STATIC_ASSERT(kNotInternalizedTag != 0); |
208 return (type & (kIsNotStringMask | kIsNotInternalizedMask)) == | 202 return (type & (kIsNotStringMask | kIsNotInternalizedMask)) == |
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2363 | 2357 |
2364 String* str = String::cast(js_value->value()); | 2358 String* str = String::cast(js_value->value()); |
2365 if (index >= static_cast<uint32_t>(str->length())) return false; | 2359 if (index >= static_cast<uint32_t>(str->length())) return false; |
2366 | 2360 |
2367 return true; | 2361 return true; |
2368 } | 2362 } |
2369 | 2363 |
2370 | 2364 |
2371 void Object::VerifyApiCallResultType() { | 2365 void Object::VerifyApiCallResultType() { |
2372 #if DEBUG | 2366 #if DEBUG |
2373 if (!(IsSmi() || IsString() || IsSymbol() || IsSpecObject() || | 2367 if (!(IsSmi() || IsString() || IsSymbol() || IsJSReceiver() || |
2374 IsHeapNumber() || IsSimd128Value() || IsUndefined() || IsTrue() || | 2368 IsHeapNumber() || IsSimd128Value() || IsUndefined() || IsTrue() || |
2375 IsFalse() || IsNull())) { | 2369 IsFalse() || IsNull())) { |
2376 FATAL("API call returned invalid object"); | 2370 FATAL("API call returned invalid object"); |
2377 } | 2371 } |
2378 #endif // DEBUG | 2372 #endif // DEBUG |
2379 } | 2373 } |
2380 | 2374 |
2381 | 2375 |
2382 Object* FixedArray::get(int index) const { | 2376 Object* FixedArray::get(int index) const { |
2383 SLOW_DCHECK(index >= 0 && index < this->length()); | 2377 SLOW_DCHECK(index >= 0 && index < this->length()); |
(...skipping 5478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7862 #undef WRITE_INT64_FIELD | 7856 #undef WRITE_INT64_FIELD |
7863 #undef READ_BYTE_FIELD | 7857 #undef READ_BYTE_FIELD |
7864 #undef WRITE_BYTE_FIELD | 7858 #undef WRITE_BYTE_FIELD |
7865 #undef NOBARRIER_READ_BYTE_FIELD | 7859 #undef NOBARRIER_READ_BYTE_FIELD |
7866 #undef NOBARRIER_WRITE_BYTE_FIELD | 7860 #undef NOBARRIER_WRITE_BYTE_FIELD |
7867 | 7861 |
7868 } // namespace internal | 7862 } // namespace internal |
7869 } // namespace v8 | 7863 } // namespace v8 |
7870 | 7864 |
7871 #endif // V8_OBJECTS_INL_H_ | 7865 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |