Index: src/type-feedback-vector.cc |
diff --git a/src/type-feedback-vector.cc b/src/type-feedback-vector.cc |
index 61f5e8b9c7d095a74ceb34d7bd3b5be89f5652dc..5a2f2e929cec8fa622c5f6cc81ad449a3a04759a 100644 |
--- a/src/type-feedback-vector.cc |
+++ b/src/type-feedback-vector.cc |
@@ -255,7 +255,10 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::New( |
} |
array->set(index, value, SKIP_WRITE_BARRIER); |
for (int j = 1; j < entry_size; j++) { |
- array->set(index + j, *uninitialized_sentinel, SKIP_WRITE_BARRIER); |
+ array->set(index + j, kind == FeedbackVectorSlotKind::CALL_IC |
Benedikt Meurer
2016/09/13 10:34:58
Nit: Hoist the value selection out of the loop.
|
+ ? Smi::FromInt(0) |
+ : *uninitialized_sentinel, |
+ SKIP_WRITE_BARRIER); |
} |
i += entry_size; |
} |
@@ -620,16 +623,19 @@ InlineCacheState CallICNexus::StateFromFeedback() const { |
int CallICNexus::ExtractCallCount() { |
Object* call_count = GetFeedbackExtra(); |
- if (call_count->IsSmi()) { |
- int value = Smi::cast(call_count)->value(); |
- return value; |
- } |
- return -1; |
+ CHECK(call_count->IsSmi()); |
+ int value = Smi::cast(call_count)->value(); |
+ return value; |
} |
- |
void CallICNexus::Clear(Code* host) { CallIC::Clear(GetIsolate(), host, this); } |
+void CallICNexus::ConfigureUninitialized() { |
+ Isolate* isolate = GetIsolate(); |
+ SetFeedback(*TypeFeedbackVector::UninitializedSentinel(isolate), |
+ SKIP_WRITE_BARRIER); |
+ SetFeedbackExtra(Smi::FromInt(0), SKIP_WRITE_BARRIER); |
+} |
void CallICNexus::ConfigureMonomorphicArray() { |
Object* feedback = GetFeedback(); |
@@ -650,10 +656,13 @@ void CallICNexus::ConfigureMonomorphic(Handle<JSFunction> function) { |
void CallICNexus::ConfigureMegamorphic() { |
- FeedbackNexus::ConfigureMegamorphic(); |
+ SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(GetIsolate()), |
+ SKIP_WRITE_BARRIER); |
+ Smi* count = Smi::cast(GetFeedbackExtra()); |
+ int new_count = count->value() + 1; |
+ SetFeedbackExtra(Smi::FromInt(new_count), SKIP_WRITE_BARRIER); |
} |
- |
void CallICNexus::ConfigureMegamorphic(int call_count) { |
SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(GetIsolate()), |
SKIP_WRITE_BARRIER); |