Index: src/feedback-vector.cc |
diff --git a/src/feedback-vector.cc b/src/feedback-vector.cc |
index 895ffe2c7d84f8e132bfbe7835fe65211dc356f1..a61d7a13f99bf2528af6c5eb2fcca27d0a6655bb 100644 |
--- a/src/feedback-vector.cc |
+++ b/src/feedback-vector.cc |
@@ -161,18 +161,15 @@ FeedbackSlotKind FeedbackVector::GetKind(FeedbackSlot slot) const { |
// static |
Handle<FeedbackVector> FeedbackVector::New(Isolate* isolate, |
- Handle<FeedbackMetadata> metadata) { |
+ Handle<SharedFunctionInfo> shared) { |
Factory* factory = isolate->factory(); |
- const int slot_count = metadata->slot_count(); |
+ const int slot_count = shared->feedback_metadata()->slot_count(); |
const int length = slot_count + kReservedIndexCount; |
- if (length == kReservedIndexCount) { |
- return Handle<FeedbackVector>::cast(factory->empty_feedback_vector()); |
- } |
Handle<FixedArray> array = factory->NewFixedArray(length, TENURED); |
array->set_map_no_write_barrier(isolate->heap()->feedback_vector_map()); |
- array->set(kMetadataIndex, *metadata); |
+ array->set(kSharedFunctionInfoIndex, *shared); |
array->set(kInvocationCountIndex, Smi::kZero); |
// Ensure we can skip the write barrier |
@@ -181,7 +178,7 @@ Handle<FeedbackVector> FeedbackVector::New(Isolate* isolate, |
Handle<Oddball> undefined_value = factory->undefined_value(); |
for (int i = 0; i < slot_count;) { |
FeedbackSlot slot(i); |
- FeedbackSlotKind kind = metadata->GetKind(slot); |
+ FeedbackSlotKind kind = shared->feedback_metadata()->GetKind(slot); |
int index = FeedbackVector::GetIndex(slot); |
int entry_size = FeedbackMetadata::GetSlotSize(kind); |
@@ -253,8 +250,6 @@ void FeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared, |
Isolate* isolate = GetIsolate(); |
if (!force_clear && !ClearLogic(isolate)) return; |
- if (this == isolate->heap()->empty_feedback_vector()) return; |
- |
Object* uninitialized_sentinel = |
FeedbackVector::RawUninitializedSentinel(isolate); |
Oddball* undefined_value = isolate->heap()->undefined_value(); |