| 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 #ifndef V8_TYPE_FEEDBACK_VECTOR_INL_H_ | 5 #ifndef V8_TYPE_FEEDBACK_VECTOR_INL_H_ |
| 6 #define V8_TYPE_FEEDBACK_VECTOR_INL_H_ | 6 #define V8_TYPE_FEEDBACK_VECTOR_INL_H_ |
| 7 | 7 |
| 8 #include "src/type-feedback-vector.h" | 8 #include "src/type-feedback-vector.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 DCHECK(length() > kReservedIndexCount); | 70 DCHECK(length() > kReservedIndexCount); |
| 71 return length() - kReservedIndexCount; | 71 return length() - kReservedIndexCount; |
| 72 } | 72 } |
| 73 | 73 |
| 74 | 74 |
| 75 TypeFeedbackMetadata* TypeFeedbackVector::metadata() const { | 75 TypeFeedbackMetadata* TypeFeedbackVector::metadata() const { |
| 76 return is_empty() ? TypeFeedbackMetadata::cast(GetHeap()->empty_fixed_array()) | 76 return is_empty() ? TypeFeedbackMetadata::cast(GetHeap()->empty_fixed_array()) |
| 77 : TypeFeedbackMetadata::cast(get(kMetadataIndex)); | 77 : TypeFeedbackMetadata::cast(get(kMetadataIndex)); |
| 78 } | 78 } |
| 79 | 79 |
| 80 | 80 // Conversion from an integer index to either a slot or an ic slot. |
| 81 // Conversion from an integer index to either a slot or an ic slot. The caller | |
| 82 // should know what kind she expects. | |
| 83 // static | 81 // static |
| 84 FeedbackVectorSlot TypeFeedbackVector::ToSlot(int index) { | 82 FeedbackVectorSlot TypeFeedbackVector::ToSlot(int index) { |
| 85 DCHECK(index >= kReservedIndexCount); | 83 DCHECK(index >= kReservedIndexCount); |
| 86 return FeedbackVectorSlot(index - kReservedIndexCount); | 84 return FeedbackVectorSlot(index - kReservedIndexCount); |
| 87 } | 85 } |
| 88 | 86 |
| 89 | 87 |
| 90 Object* TypeFeedbackVector::Get(FeedbackVectorSlot slot) const { | 88 Object* TypeFeedbackVector::Get(FeedbackVectorSlot slot) const { |
| 91 return get(GetIndex(slot)); | 89 return get(GetIndex(slot)); |
| 92 } | 90 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 int index = vector()->GetIndex(slot()) + 1; | 182 int index = vector()->GetIndex(slot()) + 1; |
| 185 vector()->set(index, feedback_extra, mode); | 183 vector()->set(index, feedback_extra, mode); |
| 186 } | 184 } |
| 187 | 185 |
| 188 | 186 |
| 189 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } | 187 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } |
| 190 } // namespace internal | 188 } // namespace internal |
| 191 } // namespace v8 | 189 } // namespace v8 |
| 192 | 190 |
| 193 #endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_ | 191 #endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_ |
| OLD | NEW |