| 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 3370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3381 CAST_ACCESSOR(Symbol) | 3381 CAST_ACCESSOR(Symbol) |
| 3382 CAST_ACCESSOR(TemplateInfo) | 3382 CAST_ACCESSOR(TemplateInfo) |
| 3383 CAST_ACCESSOR(Uint16x8) | 3383 CAST_ACCESSOR(Uint16x8) |
| 3384 CAST_ACCESSOR(Uint32x4) | 3384 CAST_ACCESSOR(Uint32x4) |
| 3385 CAST_ACCESSOR(Uint8x16) | 3385 CAST_ACCESSOR(Uint8x16) |
| 3386 CAST_ACCESSOR(UnseededNumberDictionary) | 3386 CAST_ACCESSOR(UnseededNumberDictionary) |
| 3387 CAST_ACCESSOR(WeakCell) | 3387 CAST_ACCESSOR(WeakCell) |
| 3388 CAST_ACCESSOR(WeakFixedArray) | 3388 CAST_ACCESSOR(WeakFixedArray) |
| 3389 CAST_ACCESSOR(WeakHashTable) | 3389 CAST_ACCESSOR(WeakHashTable) |
| 3390 | 3390 |
| 3391 template <class T> |
| 3392 PodArray<T>* PodArray<T>::cast(Object* object) { |
| 3393 SLOW_DCHECK(object->IsByteArray()); |
| 3394 return reinterpret_cast<PodArray<T>*>(object); |
| 3395 } |
| 3396 template <class T> |
| 3397 const PodArray<T>* PodArray<T>::cast(const Object* object) { |
| 3398 SLOW_DCHECK(object->IsByteArray()); |
| 3399 return reinterpret_cast<const PodArray<T>*>(object); |
| 3400 } |
| 3391 | 3401 |
| 3392 // static | 3402 // static |
| 3393 template <class Traits> | 3403 template <class Traits> |
| 3394 STATIC_CONST_MEMBER_DEFINITION const InstanceType | 3404 STATIC_CONST_MEMBER_DEFINITION const InstanceType |
| 3395 FixedTypedArray<Traits>::kInstanceType; | 3405 FixedTypedArray<Traits>::kInstanceType; |
| 3396 | 3406 |
| 3397 | 3407 |
| 3398 template <class Traits> | 3408 template <class Traits> |
| 3399 FixedTypedArray<Traits>* FixedTypedArray<Traits>::cast(Object* object) { | 3409 FixedTypedArray<Traits>* FixedTypedArray<Traits>::cast(Object* object) { |
| 3400 SLOW_DCHECK(object->IsHeapObject() && | 3410 SLOW_DCHECK(object->IsHeapObject() && |
| (...skipping 22 matching lines...) Expand all Loading... |
| 3423 } | 3433 } |
| 3424 | 3434 |
| 3425 DEFINE_DEOPT_ELEMENT_ACCESSORS(TranslationByteArray, ByteArray) | 3435 DEFINE_DEOPT_ELEMENT_ACCESSORS(TranslationByteArray, ByteArray) |
| 3426 DEFINE_DEOPT_ELEMENT_ACCESSORS(InlinedFunctionCount, Smi) | 3436 DEFINE_DEOPT_ELEMENT_ACCESSORS(InlinedFunctionCount, Smi) |
| 3427 DEFINE_DEOPT_ELEMENT_ACCESSORS(LiteralArray, FixedArray) | 3437 DEFINE_DEOPT_ELEMENT_ACCESSORS(LiteralArray, FixedArray) |
| 3428 DEFINE_DEOPT_ELEMENT_ACCESSORS(OsrAstId, Smi) | 3438 DEFINE_DEOPT_ELEMENT_ACCESSORS(OsrAstId, Smi) |
| 3429 DEFINE_DEOPT_ELEMENT_ACCESSORS(OsrPcOffset, Smi) | 3439 DEFINE_DEOPT_ELEMENT_ACCESSORS(OsrPcOffset, Smi) |
| 3430 DEFINE_DEOPT_ELEMENT_ACCESSORS(OptimizationId, Smi) | 3440 DEFINE_DEOPT_ELEMENT_ACCESSORS(OptimizationId, Smi) |
| 3431 DEFINE_DEOPT_ELEMENT_ACCESSORS(SharedFunctionInfo, Object) | 3441 DEFINE_DEOPT_ELEMENT_ACCESSORS(SharedFunctionInfo, Object) |
| 3432 DEFINE_DEOPT_ELEMENT_ACCESSORS(WeakCellCache, Object) | 3442 DEFINE_DEOPT_ELEMENT_ACCESSORS(WeakCellCache, Object) |
| 3443 DEFINE_DEOPT_ELEMENT_ACCESSORS(InliningPositions, PodArray<InliningPosition>) |
| 3433 | 3444 |
| 3434 #undef DEFINE_DEOPT_ELEMENT_ACCESSORS | 3445 #undef DEFINE_DEOPT_ELEMENT_ACCESSORS |
| 3435 | 3446 |
| 3436 | 3447 |
| 3437 #define DEFINE_DEOPT_ENTRY_ACCESSORS(name, type) \ | 3448 #define DEFINE_DEOPT_ENTRY_ACCESSORS(name, type) \ |
| 3438 type* DeoptimizationInputData::name(int i) { \ | 3449 type* DeoptimizationInputData::name(int i) { \ |
| 3439 return type::cast(get(IndexForEntry(i) + k##name##Offset)); \ | 3450 return type::cast(get(IndexForEntry(i) + k##name##Offset)); \ |
| 3440 } \ | 3451 } \ |
| 3441 void DeoptimizationInputData::Set##name(int i, type* value) { \ | 3452 void DeoptimizationInputData::Set##name(int i, type* value) { \ |
| 3442 set(IndexForEntry(i) + k##name##Offset, value); \ | 3453 set(IndexForEntry(i) + k##name##Offset, value); \ |
| (...skipping 4972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8415 #undef WRITE_INT64_FIELD | 8426 #undef WRITE_INT64_FIELD |
| 8416 #undef READ_BYTE_FIELD | 8427 #undef READ_BYTE_FIELD |
| 8417 #undef WRITE_BYTE_FIELD | 8428 #undef WRITE_BYTE_FIELD |
| 8418 #undef NOBARRIER_READ_BYTE_FIELD | 8429 #undef NOBARRIER_READ_BYTE_FIELD |
| 8419 #undef NOBARRIER_WRITE_BYTE_FIELD | 8430 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 8420 | 8431 |
| 8421 } // namespace internal | 8432 } // namespace internal |
| 8422 } // namespace v8 | 8433 } // namespace v8 |
| 8423 | 8434 |
| 8424 #endif // V8_OBJECTS_INL_H_ | 8435 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |