| 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/globals.h" | 8 #include "src/globals.h" |
| 9 #include "src/type-feedback-vector.h" | 9 #include "src/type-feedback-vector.h" |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 DCHECK(obj->IsTypeFeedbackVector()); | 48 DCHECK(obj->IsTypeFeedbackVector()); |
| 49 return reinterpret_cast<TypeFeedbackVector*>(obj); | 49 return reinterpret_cast<TypeFeedbackVector*>(obj); |
| 50 } | 50 } |
| 51 | 51 |
| 52 | 52 |
| 53 int TypeFeedbackMetadata::GetSlotSize(FeedbackVectorSlotKind kind) { | 53 int TypeFeedbackMetadata::GetSlotSize(FeedbackVectorSlotKind kind) { |
| 54 DCHECK_NE(FeedbackVectorSlotKind::INVALID, kind); | 54 DCHECK_NE(FeedbackVectorSlotKind::INVALID, kind); |
| 55 DCHECK_NE(FeedbackVectorSlotKind::KINDS_NUMBER, kind); | 55 DCHECK_NE(FeedbackVectorSlotKind::KINDS_NUMBER, kind); |
| 56 if (kind == FeedbackVectorSlotKind::GENERAL || | 56 if (kind == FeedbackVectorSlotKind::GENERAL || |
| 57 kind == FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC || | 57 kind == FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC || |
| 58 kind == FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC || | 58 kind == FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC) { |
| 59 kind == FeedbackVectorSlotKind::CREATE_CLOSURE) { | |
| 60 return 1; | 59 return 1; |
| 61 } | 60 } |
| 62 | 61 |
| 63 return 2; | 62 return 2; |
| 64 } | 63 } |
| 65 | 64 |
| 66 bool TypeFeedbackMetadata::SlotRequiresParameter(FeedbackVectorSlotKind kind) { | |
| 67 switch (kind) { | |
| 68 case FeedbackVectorSlotKind::CREATE_CLOSURE: | |
| 69 return true; | |
| 70 | |
| 71 case FeedbackVectorSlotKind::CALL_IC: | |
| 72 case FeedbackVectorSlotKind::LOAD_IC: | |
| 73 case FeedbackVectorSlotKind::LOAD_GLOBAL_IC: | |
| 74 case FeedbackVectorSlotKind::KEYED_LOAD_IC: | |
| 75 case FeedbackVectorSlotKind::STORE_IC: | |
| 76 case FeedbackVectorSlotKind::KEYED_STORE_IC: | |
| 77 case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC: | |
| 78 case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: | |
| 79 case FeedbackVectorSlotKind::GENERAL: | |
| 80 case FeedbackVectorSlotKind::INVALID: | |
| 81 return false; | |
| 82 | |
| 83 case FeedbackVectorSlotKind::KINDS_NUMBER: | |
| 84 break; | |
| 85 } | |
| 86 UNREACHABLE(); | |
| 87 return false; | |
| 88 } | |
| 89 | |
| 90 bool TypeFeedbackVector::is_empty() const { | 65 bool TypeFeedbackVector::is_empty() const { |
| 91 return length() == kReservedIndexCount; | 66 return length() == kReservedIndexCount; |
| 92 } | 67 } |
| 93 | 68 |
| 94 int TypeFeedbackVector::slot_count() const { | 69 int TypeFeedbackVector::slot_count() const { |
| 95 return length() - kReservedIndexCount; | 70 return length() - kReservedIndexCount; |
| 96 } | 71 } |
| 97 | 72 |
| 98 | 73 |
| 99 TypeFeedbackMetadata* TypeFeedbackVector::metadata() const { | 74 TypeFeedbackMetadata* TypeFeedbackVector::metadata() const { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 if (hint == BinaryOperationHint::kAny) { | 189 if (hint == BinaryOperationHint::kAny) { |
| 215 gen++; | 190 gen++; |
| 216 } else if (hint != BinaryOperationHint::kNone) { | 191 } else if (hint != BinaryOperationHint::kNone) { |
| 217 with++; | 192 with++; |
| 218 } | 193 } |
| 219 } | 194 } |
| 220 total++; | 195 total++; |
| 221 } | 196 } |
| 222 break; | 197 break; |
| 223 } | 198 } |
| 224 case FeedbackVectorSlotKind::CREATE_CLOSURE: | |
| 225 case FeedbackVectorSlotKind::GENERAL: | 199 case FeedbackVectorSlotKind::GENERAL: |
| 226 break; | 200 break; |
| 227 case FeedbackVectorSlotKind::INVALID: | 201 case FeedbackVectorSlotKind::INVALID: |
| 228 case FeedbackVectorSlotKind::KINDS_NUMBER: | 202 case FeedbackVectorSlotKind::KINDS_NUMBER: |
| 229 UNREACHABLE(); | 203 UNREACHABLE(); |
| 230 break; | 204 break; |
| 231 } | 205 } |
| 232 } | 206 } |
| 233 | 207 |
| 234 *with_type_info = with; | 208 *with_type_info = with; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 int index = vector()->GetIndex(slot()) + 1; | 269 int index = vector()->GetIndex(slot()) + 1; |
| 296 vector()->set(index, feedback_extra, mode); | 270 vector()->set(index, feedback_extra, mode); |
| 297 } | 271 } |
| 298 | 272 |
| 299 | 273 |
| 300 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } | 274 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } |
| 301 } // namespace internal | 275 } // namespace internal |
| 302 } // namespace v8 | 276 } // namespace v8 |
| 303 | 277 |
| 304 #endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_ | 278 #endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_ |
| OLD | NEW |