| 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 6202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6213 DCHECK((IsFastSmiOrObjectElementsKind(kind) && | 6213 DCHECK((IsFastSmiOrObjectElementsKind(kind) && |
| 6214 (map == GetHeap()->fixed_array_map() || | 6214 (map == GetHeap()->fixed_array_map() || |
| 6215 map == GetHeap()->fixed_cow_array_map())) || | 6215 map == GetHeap()->fixed_cow_array_map())) || |
| 6216 (IsFastDoubleElementsKind(kind) && | 6216 (IsFastDoubleElementsKind(kind) && |
| 6217 (fixed_array->IsFixedDoubleArray() || | 6217 (fixed_array->IsFixedDoubleArray() || |
| 6218 fixed_array == GetHeap()->empty_fixed_array())) || | 6218 fixed_array == GetHeap()->empty_fixed_array())) || |
| 6219 (kind == DICTIONARY_ELEMENTS && | 6219 (kind == DICTIONARY_ELEMENTS && |
| 6220 fixed_array->IsFixedArray() && | 6220 fixed_array->IsFixedArray() && |
| 6221 fixed_array->IsDictionary()) || | 6221 fixed_array->IsDictionary()) || |
| 6222 (kind > DICTIONARY_ELEMENTS)); | 6222 (kind > DICTIONARY_ELEMENTS)); |
| 6223 DCHECK((kind != SLOPPY_ARGUMENTS_ELEMENTS) || | 6223 DCHECK(!IsSloppyArgumentsElements(kind) || |
| 6224 (elements()->IsFixedArray() && elements()->length() >= 2)); | 6224 (elements()->IsFixedArray() && elements()->length() >= 2)); |
| 6225 } | 6225 } |
| 6226 #endif | 6226 #endif |
| 6227 return kind; | 6227 return kind; |
| 6228 } | 6228 } |
| 6229 | 6229 |
| 6230 | 6230 |
| 6231 bool JSObject::HasFastObjectElements() { | 6231 bool JSObject::HasFastObjectElements() { |
| 6232 return IsFastObjectElementsKind(GetElementsKind()); | 6232 return IsFastObjectElementsKind(GetElementsKind()); |
| 6233 } | 6233 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 6256 bool JSObject::HasFastElements() { | 6256 bool JSObject::HasFastElements() { |
| 6257 return IsFastElementsKind(GetElementsKind()); | 6257 return IsFastElementsKind(GetElementsKind()); |
| 6258 } | 6258 } |
| 6259 | 6259 |
| 6260 | 6260 |
| 6261 bool JSObject::HasDictionaryElements() { | 6261 bool JSObject::HasDictionaryElements() { |
| 6262 return GetElementsKind() == DICTIONARY_ELEMENTS; | 6262 return GetElementsKind() == DICTIONARY_ELEMENTS; |
| 6263 } | 6263 } |
| 6264 | 6264 |
| 6265 | 6265 |
| 6266 bool JSObject::HasFastArgumentsElements() { |
| 6267 return GetElementsKind() == FAST_SLOPPY_ARGUMENTS_ELEMENTS; |
| 6268 } |
| 6269 |
| 6270 |
| 6271 bool JSObject::HasSlowArgumentsElements() { |
| 6272 return GetElementsKind() == SLOW_SLOPPY_ARGUMENTS_ELEMENTS; |
| 6273 } |
| 6274 |
| 6275 |
| 6266 bool JSObject::HasSloppyArgumentsElements() { | 6276 bool JSObject::HasSloppyArgumentsElements() { |
| 6267 return GetElementsKind() == SLOPPY_ARGUMENTS_ELEMENTS; | 6277 return IsSloppyArgumentsElements(GetElementsKind()); |
| 6268 } | 6278 } |
| 6269 | 6279 |
| 6270 | 6280 |
| 6271 bool JSObject::HasExternalArrayElements() { | 6281 bool JSObject::HasExternalArrayElements() { |
| 6272 HeapObject* array = elements(); | 6282 HeapObject* array = elements(); |
| 6273 DCHECK(array != NULL); | 6283 DCHECK(array != NULL); |
| 6274 return array->IsExternalArray(); | 6284 return array->IsExternalArray(); |
| 6275 } | 6285 } |
| 6276 | 6286 |
| 6277 | 6287 |
| (...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7297 #undef READ_SHORT_FIELD | 7307 #undef READ_SHORT_FIELD |
| 7298 #undef WRITE_SHORT_FIELD | 7308 #undef WRITE_SHORT_FIELD |
| 7299 #undef READ_BYTE_FIELD | 7309 #undef READ_BYTE_FIELD |
| 7300 #undef WRITE_BYTE_FIELD | 7310 #undef WRITE_BYTE_FIELD |
| 7301 #undef NOBARRIER_READ_BYTE_FIELD | 7311 #undef NOBARRIER_READ_BYTE_FIELD |
| 7302 #undef NOBARRIER_WRITE_BYTE_FIELD | 7312 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7303 | 7313 |
| 7304 } } // namespace v8::internal | 7314 } } // namespace v8::internal |
| 7305 | 7315 |
| 7306 #endif // V8_OBJECTS_INL_H_ | 7316 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |