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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 return Object::IsHeapObject() && HeapObject::cast(this)->map()->is_callable(); | 191 return Object::IsHeapObject() && HeapObject::cast(this)->map()->is_callable(); |
192 } | 192 } |
193 | 193 |
194 | 194 |
195 bool Object::IsSpecObject() const { | 195 bool Object::IsSpecObject() const { |
196 return Object::IsHeapObject() | 196 return Object::IsHeapObject() |
197 && HeapObject::cast(this)->map()->instance_type() >= FIRST_SPEC_OBJECT_TYPE; | 197 && HeapObject::cast(this)->map()->instance_type() >= FIRST_SPEC_OBJECT_TYPE; |
198 } | 198 } |
199 | 199 |
200 | 200 |
201 // TODO(rossberg): Remove this and use the spec compliant IsCallable instead. | |
202 bool Object::IsSpecFunction() const { | |
203 if (!Object::IsHeapObject()) return false; | |
204 InstanceType type = HeapObject::cast(this)->map()->instance_type(); | |
205 return type == JS_FUNCTION_TYPE || type == JS_FUNCTION_PROXY_TYPE; | |
206 } | |
207 | |
208 | |
209 bool Object::IsTemplateInfo() const { | 201 bool Object::IsTemplateInfo() const { |
210 return IsObjectTemplateInfo() || IsFunctionTemplateInfo(); | 202 return IsObjectTemplateInfo() || IsFunctionTemplateInfo(); |
211 } | 203 } |
212 | 204 |
213 | 205 |
214 bool Object::IsInternalizedString() const { | 206 bool Object::IsInternalizedString() const { |
215 if (!this->IsHeapObject()) return false; | 207 if (!this->IsHeapObject()) return false; |
216 uint32_t type = HeapObject::cast(this)->map()->instance_type(); | 208 uint32_t type = HeapObject::cast(this)->map()->instance_type(); |
217 STATIC_ASSERT(kNotInternalizedTag != 0); | 209 STATIC_ASSERT(kNotInternalizedTag != 0); |
218 return (type & (kIsNotStringMask | kIsNotInternalizedMask)) == | 210 return (type & (kIsNotStringMask | kIsNotInternalizedMask)) == |
(...skipping 7133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7352 return (getter() == getter_value) && (setter() == setter_value); | 7344 return (getter() == getter_value) && (setter() == setter_value); |
7353 } | 7345 } |
7354 | 7346 |
7355 | 7347 |
7356 bool AccessorPair::ContainsAccessor() { | 7348 bool AccessorPair::ContainsAccessor() { |
7357 return IsJSAccessor(getter()) || IsJSAccessor(setter()); | 7349 return IsJSAccessor(getter()) || IsJSAccessor(setter()); |
7358 } | 7350 } |
7359 | 7351 |
7360 | 7352 |
7361 bool AccessorPair::IsJSAccessor(Object* obj) { | 7353 bool AccessorPair::IsJSAccessor(Object* obj) { |
7362 return obj->IsSpecFunction() || obj->IsUndefined(); | 7354 return obj->IsCallable() || obj->IsUndefined(); |
7363 } | 7355 } |
7364 | 7356 |
7365 | 7357 |
7366 template<typename Derived, typename Shape, typename Key> | 7358 template<typename Derived, typename Shape, typename Key> |
7367 void Dictionary<Derived, Shape, Key>::SetEntry(int entry, | 7359 void Dictionary<Derived, Shape, Key>::SetEntry(int entry, |
7368 Handle<Object> key, | 7360 Handle<Object> key, |
7369 Handle<Object> value) { | 7361 Handle<Object> value) { |
7370 this->SetEntry(entry, key, value, PropertyDetails(Smi::FromInt(0))); | 7362 this->SetEntry(entry, key, value, PropertyDetails(Smi::FromInt(0))); |
7371 } | 7363 } |
7372 | 7364 |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8015 #undef READ_INT64_FIELD | 8007 #undef READ_INT64_FIELD |
8016 #undef WRITE_INT64_FIELD | 8008 #undef WRITE_INT64_FIELD |
8017 #undef READ_BYTE_FIELD | 8009 #undef READ_BYTE_FIELD |
8018 #undef WRITE_BYTE_FIELD | 8010 #undef WRITE_BYTE_FIELD |
8019 #undef NOBARRIER_READ_BYTE_FIELD | 8011 #undef NOBARRIER_READ_BYTE_FIELD |
8020 #undef NOBARRIER_WRITE_BYTE_FIELD | 8012 #undef NOBARRIER_WRITE_BYTE_FIELD |
8021 | 8013 |
8022 } } // namespace v8::internal | 8014 } } // namespace v8::internal |
8023 | 8015 |
8024 #endif // V8_OBJECTS_INL_H_ | 8016 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |