Chromium Code Reviews| Index: src/type-feedback-vector.cc |
| diff --git a/src/type-feedback-vector.cc b/src/type-feedback-vector.cc |
| index e21ad93ba6dfff57abe0111222f679598ea88664..8fc91a5469743fd58b756071b8c1fead2c2f51c9 100644 |
| --- a/src/type-feedback-vector.cc |
| +++ b/src/type-feedback-vector.cc |
| @@ -202,6 +202,10 @@ const char* TypeFeedbackMetadata::Kind2String(FeedbackVectorSlotKind kind) { |
| return "STORE_IC"; |
| case FeedbackVectorSlotKind::KEYED_STORE_IC: |
| return "KEYED_STORE_IC"; |
| + case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC: |
| + return "iINTERPRETER_BINARYOP_IC"; |
|
Benedikt Meurer
2016/09/20 11:52:35
Nit: Remove the leading i :-)
|
| + case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: |
| + return "iINTERPRETER_COMPARE_IC"; |
|
Benedikt Meurer
2016/09/20 11:52:35
Nit: Remove the leading i :-)
|
| case FeedbackVectorSlotKind::GENERAL: |
| return "STUB"; |
| case FeedbackVectorSlotKind::KINDS_NUMBER: |
| @@ -252,6 +256,9 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::New( |
| Object* value; |
| if (kind == FeedbackVectorSlotKind::LOAD_GLOBAL_IC) { |
| value = *factory->empty_weak_cell(); |
| + } else if (kind == FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC || |
| + kind == FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC) { |
| + value = Smi::FromInt(0); |
| } else { |
| value = *uninitialized_sentinel; |
| } |
| @@ -339,6 +346,13 @@ void TypeFeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared, |
| nexus.Clear(shared->code()); |
| break; |
| } |
| + case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC: |
| + case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: { |
| + DCHECK(Get(slot)->IsSmi()); |
| + // don't clear these smi slots. |
| + // Set(slot, Smi::FromInt(0)); |
| + break; |
| + } |
| case FeedbackVectorSlotKind::GENERAL: { |
| if (obj->IsHeapObject()) { |
| InstanceType instance_type = |
| @@ -1037,5 +1051,38 @@ IcCheckType KeyedStoreICNexus::GetKeyType() const { |
| } |
| return IsPropertyNameFeedback(feedback) ? PROPERTY : ELEMENT; |
| } |
| + |
| +InlineCacheState BinaryOpICNexus::StateFromFeedback() const { |
| + BinaryOperationHint hint = GetBinaryOperationFeedback(); |
| + if (hint == BinaryOperationHint::kNone) { |
| + return UNINITIALIZED; |
| + } else if (hint == BinaryOperationHint::kAny) { |
| + return GENERIC; |
| + } |
| + |
| + return MONOMORPHIC; |
| +} |
| + |
| +InlineCacheState CompareICNexus::StateFromFeedback() const { |
| + CompareOperationHint hint = GetCompareOperationFeedback(); |
| + if (hint == CompareOperationHint::kNone) { |
| + return UNINITIALIZED; |
| + } else if (hint == CompareOperationHint::kAny) { |
| + return GENERIC; |
| + } |
| + |
| + return MONOMORPHIC; |
| +} |
| + |
| +BinaryOperationHint BinaryOpICNexus::GetBinaryOperationFeedback() const { |
| + int feedback = Smi::cast(GetFeedback())->value(); |
| + return BinaryOperationHintFromFeedback(feedback); |
| +} |
| + |
| +CompareOperationHint CompareICNexus::GetCompareOperationFeedback() const { |
| + int feedback = Smi::cast(GetFeedback())->value(); |
| + return CompareOperationHintFromFeedback(feedback); |
| +} |
| + |
| } // namespace internal |
| } // namespace v8 |