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 3397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3408 | 3408 |
3409 int HandlerTable::GetRangeEnd(int index) const { | 3409 int HandlerTable::GetRangeEnd(int index) const { |
3410 return Smi::cast(get(index * kRangeEntrySize + kRangeEndIndex))->value(); | 3410 return Smi::cast(get(index * kRangeEntrySize + kRangeEndIndex))->value(); |
3411 } | 3411 } |
3412 | 3412 |
3413 int HandlerTable::GetRangeHandler(int index) const { | 3413 int HandlerTable::GetRangeHandler(int index) const { |
3414 return HandlerOffsetField::decode( | 3414 return HandlerOffsetField::decode( |
3415 Smi::cast(get(index * kRangeEntrySize + kRangeHandlerIndex))->value()); | 3415 Smi::cast(get(index * kRangeEntrySize + kRangeHandlerIndex))->value()); |
3416 } | 3416 } |
3417 | 3417 |
3418 int HandlerTable::GetRangeDepth(int index) const { | 3418 int HandlerTable::GetRangeData(int index) const { |
3419 return Smi::cast(get(index * kRangeEntrySize + kRangeDepthIndex))->value(); | 3419 return Smi::cast(get(index * kRangeEntrySize + kRangeDataIndex))->value(); |
3420 } | 3420 } |
3421 | 3421 |
3422 void HandlerTable::SetRangeStart(int index, int value) { | 3422 void HandlerTable::SetRangeStart(int index, int value) { |
3423 set(index * kRangeEntrySize + kRangeStartIndex, Smi::FromInt(value)); | 3423 set(index * kRangeEntrySize + kRangeStartIndex, Smi::FromInt(value)); |
3424 } | 3424 } |
3425 | 3425 |
3426 | 3426 |
3427 void HandlerTable::SetRangeEnd(int index, int value) { | 3427 void HandlerTable::SetRangeEnd(int index, int value) { |
3428 set(index * kRangeEntrySize + kRangeEndIndex, Smi::FromInt(value)); | 3428 set(index * kRangeEntrySize + kRangeEndIndex, Smi::FromInt(value)); |
3429 } | 3429 } |
3430 | 3430 |
3431 | 3431 |
3432 void HandlerTable::SetRangeHandler(int index, int offset, | 3432 void HandlerTable::SetRangeHandler(int index, int offset, |
3433 CatchPrediction prediction) { | 3433 CatchPrediction prediction) { |
3434 int value = HandlerOffsetField::encode(offset) | | 3434 int value = HandlerOffsetField::encode(offset) | |
3435 HandlerPredictionField::encode(prediction); | 3435 HandlerPredictionField::encode(prediction); |
3436 set(index * kRangeEntrySize + kRangeHandlerIndex, Smi::FromInt(value)); | 3436 set(index * kRangeEntrySize + kRangeHandlerIndex, Smi::FromInt(value)); |
3437 } | 3437 } |
3438 | 3438 |
3439 | 3439 void HandlerTable::SetRangeData(int index, int value) { |
3440 void HandlerTable::SetRangeDepth(int index, int value) { | 3440 set(index * kRangeEntrySize + kRangeDataIndex, Smi::FromInt(value)); |
3441 set(index * kRangeEntrySize + kRangeDepthIndex, Smi::FromInt(value)); | |
3442 } | 3441 } |
3443 | 3442 |
3444 | 3443 |
3445 void HandlerTable::SetReturnOffset(int index, int value) { | 3444 void HandlerTable::SetReturnOffset(int index, int value) { |
3446 set(index * kReturnEntrySize + kReturnOffsetIndex, Smi::FromInt(value)); | 3445 set(index * kReturnEntrySize + kReturnOffsetIndex, Smi::FromInt(value)); |
3447 } | 3446 } |
3448 | 3447 |
3449 | 3448 |
3450 void HandlerTable::SetReturnHandler(int index, int offset, | 3449 void HandlerTable::SetReturnHandler(int index, int offset, |
3451 CatchPrediction prediction) { | 3450 CatchPrediction prediction) { |
(...skipping 4391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7843 #undef WRITE_INT64_FIELD | 7842 #undef WRITE_INT64_FIELD |
7844 #undef READ_BYTE_FIELD | 7843 #undef READ_BYTE_FIELD |
7845 #undef WRITE_BYTE_FIELD | 7844 #undef WRITE_BYTE_FIELD |
7846 #undef NOBARRIER_READ_BYTE_FIELD | 7845 #undef NOBARRIER_READ_BYTE_FIELD |
7847 #undef NOBARRIER_WRITE_BYTE_FIELD | 7846 #undef NOBARRIER_WRITE_BYTE_FIELD |
7848 | 7847 |
7849 } // namespace internal | 7848 } // namespace internal |
7850 } // namespace v8 | 7849 } // namespace v8 |
7851 | 7850 |
7852 #endif // V8_OBJECTS_INL_H_ | 7851 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |