Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 2b072f302144b48a82ee29453d60fc813de2ae5d..3e49fea21d61da6b1b8e10e46b549f97fe266703 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -2721,17 +2721,36 @@ void Heap::CreateInitialObjects() { |
{ |
FeedbackVectorSlotKind kinds[] = {FeedbackVectorSlotKind::LOAD_IC, |
+ FeedbackVectorSlotKind::INVALID, |
FeedbackVectorSlotKind::KEYED_LOAD_IC, |
+ FeedbackVectorSlotKind::INVALID, |
FeedbackVectorSlotKind::STORE_IC, |
- FeedbackVectorSlotKind::KEYED_STORE_IC}; |
- StaticFeedbackVectorSpec spec(0, 4, kinds); |
+ FeedbackVectorSlotKind::INVALID, |
+ FeedbackVectorSlotKind::KEYED_STORE_IC, |
+ FeedbackVectorSlotKind::INVALID}; |
+ StaticFeedbackVectorSpec spec(arraysize(kinds), kinds); |
Handle<TypeFeedbackVector> dummy_vector = |
- factory->NewTypeFeedbackVector(&spec); |
- for (int i = 0; i < 4; i++) { |
- dummy_vector->Set(FeedbackVectorICSlot(0), |
Igor Sheludko
2015/09/30 16:30:56
I guess we wanted to use FeedbackVectorICSlot(i) h
mvstanton
2015/10/01 10:24:31
Good catch.
|
- *TypeFeedbackVector::MegamorphicSentinel(isolate()), |
- SKIP_WRITE_BARRIER); |
+ TypeFeedbackVector::New(isolate(), &spec); |
+ for (int i = 0; i < spec.slots(); i++) { |
+ if (kinds[i] != FeedbackVectorSlotKind::INVALID) { |
+ dummy_vector->Set(FeedbackVectorSlot(i), |
+ *TypeFeedbackVector::MegamorphicSentinel(isolate()), |
+ SKIP_WRITE_BARRIER); |
+ } |
} |
+ DCHECK_EQ(FeedbackVectorSlotKind::LOAD_IC, |
+ dummy_vector->GetKind( |
+ FeedbackVectorSlot(TypeFeedbackVector::kDummyLoadICSlot))); |
+ DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, |
+ dummy_vector->GetKind(FeedbackVectorSlot( |
+ TypeFeedbackVector::kDummyKeyedLoadICSlot))); |
+ DCHECK_EQ(FeedbackVectorSlotKind::STORE_IC, |
+ dummy_vector->GetKind( |
+ FeedbackVectorSlot(TypeFeedbackVector::kDummyStoreICSlot))); |
+ DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, |
+ dummy_vector->GetKind(FeedbackVectorSlot( |
+ TypeFeedbackVector::kDummyKeyedStoreICSlot))); |
+ |
set_dummy_vector(*dummy_vector); |
} |