| 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 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2222 default: | 2222 default: |
| 2223 if (type >= FIRST_ARRAY_ITERATOR_TYPE && | 2223 if (type >= FIRST_ARRAY_ITERATOR_TYPE && |
| 2224 type <= LAST_ARRAY_ITERATOR_TYPE) { | 2224 type <= LAST_ARRAY_ITERATOR_TYPE) { |
| 2225 return JSArrayIterator::kSize; | 2225 return JSArrayIterator::kSize; |
| 2226 } | 2226 } |
| 2227 UNREACHABLE(); | 2227 UNREACHABLE(); |
| 2228 return 0; | 2228 return 0; |
| 2229 } | 2229 } |
| 2230 } | 2230 } |
| 2231 | 2231 |
| 2232 inline bool IsSpecialReceiverInstanceType(InstanceType instance_type) { | |
| 2233 return instance_type <= LAST_SPECIAL_RECEIVER_TYPE; | |
| 2234 } | |
| 2235 | 2232 |
| 2236 int JSObject::GetInternalFieldCount(Map* map) { | 2233 int JSObject::GetInternalFieldCount(Map* map) { |
| 2237 int instance_size = map->instance_size(); | 2234 int instance_size = map->instance_size(); |
| 2238 if (instance_size == kVariableSizeSentinel) return 0; | 2235 if (instance_size == kVariableSizeSentinel) return 0; |
| 2239 InstanceType instance_type = map->instance_type(); | 2236 InstanceType instance_type = map->instance_type(); |
| 2240 return ((instance_size - GetHeaderSize(instance_type)) >> kPointerSizeLog2) - | 2237 return ((instance_size - GetHeaderSize(instance_type)) >> kPointerSizeLog2) - |
| 2241 map->GetInObjectProperties(); | 2238 map->GetInObjectProperties(); |
| 2242 } | 2239 } |
| 2243 | 2240 |
| 2244 | 2241 |
| (...skipping 2725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4970 bool Map::IsJSProxyMap() { return instance_type() == JS_PROXY_TYPE; } | 4967 bool Map::IsJSProxyMap() { return instance_type() == JS_PROXY_TYPE; } |
| 4971 bool Map::IsJSGlobalProxyMap() { | 4968 bool Map::IsJSGlobalProxyMap() { |
| 4972 return instance_type() == JS_GLOBAL_PROXY_TYPE; | 4969 return instance_type() == JS_GLOBAL_PROXY_TYPE; |
| 4973 } | 4970 } |
| 4974 bool Map::IsJSGlobalObjectMap() { | 4971 bool Map::IsJSGlobalObjectMap() { |
| 4975 return instance_type() == JS_GLOBAL_OBJECT_TYPE; | 4972 return instance_type() == JS_GLOBAL_OBJECT_TYPE; |
| 4976 } | 4973 } |
| 4977 bool Map::IsJSTypedArrayMap() { return instance_type() == JS_TYPED_ARRAY_TYPE; } | 4974 bool Map::IsJSTypedArrayMap() { return instance_type() == JS_TYPED_ARRAY_TYPE; } |
| 4978 bool Map::IsJSDataViewMap() { return instance_type() == JS_DATA_VIEW_TYPE; } | 4975 bool Map::IsJSDataViewMap() { return instance_type() == JS_DATA_VIEW_TYPE; } |
| 4979 | 4976 |
| 4980 bool Map::IsSpecialReceiverMap() { | |
| 4981 bool result = IsSpecialReceiverInstanceType(instance_type()); | |
| 4982 DCHECK_IMPLIES(!result, | |
| 4983 !has_named_interceptor() && !is_access_check_needed()); | |
| 4984 return result; | |
| 4985 } | |
| 4986 | 4977 |
| 4987 bool Map::CanOmitMapChecks() { | 4978 bool Map::CanOmitMapChecks() { |
| 4988 return is_stable() && FLAG_omit_map_checks_for_leaf_maps; | 4979 return is_stable() && FLAG_omit_map_checks_for_leaf_maps; |
| 4989 } | 4980 } |
| 4990 | 4981 |
| 4991 | 4982 |
| 4992 DependentCode* DependentCode::next_link() { | 4983 DependentCode* DependentCode::next_link() { |
| 4993 return DependentCode::cast(get(kNextLinkIndex)); | 4984 return DependentCode::cast(get(kNextLinkIndex)); |
| 4994 } | 4985 } |
| 4995 | 4986 |
| (...skipping 3477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8473 #undef WRITE_INT64_FIELD | 8464 #undef WRITE_INT64_FIELD |
| 8474 #undef READ_BYTE_FIELD | 8465 #undef READ_BYTE_FIELD |
| 8475 #undef WRITE_BYTE_FIELD | 8466 #undef WRITE_BYTE_FIELD |
| 8476 #undef NOBARRIER_READ_BYTE_FIELD | 8467 #undef NOBARRIER_READ_BYTE_FIELD |
| 8477 #undef NOBARRIER_WRITE_BYTE_FIELD | 8468 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 8478 | 8469 |
| 8479 } // namespace internal | 8470 } // namespace internal |
| 8480 } // namespace v8 | 8471 } // namespace v8 |
| 8481 | 8472 |
| 8482 #endif // V8_OBJECTS_INL_H_ | 8473 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |