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_FEEDBACK_VECTOR_INL_H_ | 5 #ifndef V8_FEEDBACK_VECTOR_INL_H_ |
6 #define V8_FEEDBACK_VECTOR_INL_H_ | 6 #define V8_FEEDBACK_VECTOR_INL_H_ |
7 | 7 |
8 #include "src/factory.h" | 8 #include "src/factory.h" |
9 #include "src/feedback-vector.h" | 9 #include "src/feedback-vector.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 bool FeedbackVector::is_empty() const { | 78 bool FeedbackVector::is_empty() const { |
79 return length() == kReservedIndexCount; | 79 return length() == kReservedIndexCount; |
80 } | 80 } |
81 | 81 |
82 int FeedbackVector::slot_count() const { | 82 int FeedbackVector::slot_count() const { |
83 return length() - kReservedIndexCount; | 83 return length() - kReservedIndexCount; |
84 } | 84 } |
85 | 85 |
86 FeedbackMetadata* FeedbackVector::metadata() const { | 86 FeedbackMetadata* FeedbackVector::metadata() const { |
87 return FeedbackMetadata::cast(get(kMetadataIndex)); | 87 return shared_function_info()->feedback_metadata(); |
| 88 } |
| 89 |
| 90 SharedFunctionInfo* FeedbackVector::shared_function_info() const { |
| 91 return SharedFunctionInfo::cast(get(kSharedFunctionInfoIndex)); |
88 } | 92 } |
89 | 93 |
90 int FeedbackVector::invocation_count() const { | 94 int FeedbackVector::invocation_count() const { |
91 return Smi::cast(get(kInvocationCountIndex))->value(); | 95 return Smi::cast(get(kInvocationCountIndex))->value(); |
92 } | 96 } |
93 | 97 |
94 // Conversion from an integer index to either a slot or an ic slot. | 98 // Conversion from an integer index to either a slot or an ic slot. |
95 // static | 99 // static |
96 FeedbackSlot FeedbackVector::ToSlot(int index) { | 100 FeedbackSlot FeedbackVector::ToSlot(int index) { |
97 DCHECK_GE(index, kReservedIndexCount); | 101 DCHECK_GE(index, kReservedIndexCount); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 #endif | 296 #endif |
293 int index = vector()->GetIndex(slot()) + 1; | 297 int index = vector()->GetIndex(slot()) + 1; |
294 vector()->set(index, feedback_extra, mode); | 298 vector()->set(index, feedback_extra, mode); |
295 } | 299 } |
296 | 300 |
297 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } | 301 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } |
298 } // namespace internal | 302 } // namespace internal |
299 } // namespace v8 | 303 } // namespace v8 |
300 | 304 |
301 #endif // V8_FEEDBACK_VECTOR_INL_H_ | 305 #endif // V8_FEEDBACK_VECTOR_INL_H_ |
OLD | NEW |