| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 | 90 |
| 91 SharedFunctionInfo* FeedbackVector::shared_function_info() const { | 91 SharedFunctionInfo* FeedbackVector::shared_function_info() const { |
| 92 return SharedFunctionInfo::cast(get(kSharedFunctionInfoIndex)); | 92 return SharedFunctionInfo::cast(get(kSharedFunctionInfoIndex)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 int FeedbackVector::invocation_count() const { | 95 int FeedbackVector::invocation_count() const { |
| 96 return Smi::cast(get(kInvocationCountIndex))->value(); | 96 return Smi::cast(get(kInvocationCountIndex))->value(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void FeedbackVector::clear_invocation_count() { |
| 100 set(kInvocationCountIndex, Smi::kZero); |
| 101 } |
| 102 |
| 99 // Conversion from an integer index to either a slot or an ic slot. | 103 // Conversion from an integer index to either a slot or an ic slot. |
| 100 // static | 104 // static |
| 101 FeedbackSlot FeedbackVector::ToSlot(int index) { | 105 FeedbackSlot FeedbackVector::ToSlot(int index) { |
| 102 DCHECK_GE(index, kReservedIndexCount); | 106 DCHECK_GE(index, kReservedIndexCount); |
| 103 return FeedbackSlot(index - kReservedIndexCount); | 107 return FeedbackSlot(index - kReservedIndexCount); |
| 104 } | 108 } |
| 105 | 109 |
| 106 Object* FeedbackVector::Get(FeedbackSlot slot) const { | 110 Object* FeedbackVector::Get(FeedbackSlot slot) const { |
| 107 return get(GetIndex(slot)); | 111 return get(GetIndex(slot)); |
| 108 } | 112 } |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 #endif | 302 #endif |
| 299 int index = vector()->GetIndex(slot()) + 1; | 303 int index = vector()->GetIndex(slot()) + 1; |
| 300 vector()->set(index, feedback_extra, mode); | 304 vector()->set(index, feedback_extra, mode); |
| 301 } | 305 } |
| 302 | 306 |
| 303 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } | 307 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } |
| 304 } // namespace internal | 308 } // namespace internal |
| 305 } // namespace v8 | 309 } // namespace v8 |
| 306 | 310 |
| 307 #endif // V8_FEEDBACK_VECTOR_INL_H_ | 311 #endif // V8_FEEDBACK_VECTOR_INL_H_ |
| OLD | NEW |