Commit 8c3cfa3a authored by ishell's avatar ishell Committed by Commit bot

[ic] Properly initialize dummy feedback vector.

Review-Url: https://codereview.chromium.org/2372173002
Cr-Commit-Position: refs/heads/master@{#39759}
parent e25b2649
......@@ -2779,18 +2779,18 @@ void Heap::CreateInitialObjects() {
{
StaticFeedbackVectorSpec spec;
FeedbackVectorSlot load_ic_slot = spec.AddLoadICSlot();
FeedbackVectorSlot keyed_load_ic_slot = spec.AddKeyedLoadICSlot();
FeedbackVectorSlot store_ic_slot = spec.AddStoreICSlot();
FeedbackVectorSlot keyed_store_ic_slot = spec.AddKeyedStoreICSlot();
DCHECK_EQ(load_ic_slot,
FeedbackVectorSlot(TypeFeedbackVector::kDummyLoadICSlot));
DCHECK_EQ(keyed_load_ic_slot,
FeedbackVectorSlot slot = spec.AddLoadICSlot();
DCHECK_EQ(slot, FeedbackVectorSlot(TypeFeedbackVector::kDummyLoadICSlot));
slot = spec.AddKeyedLoadICSlot();
DCHECK_EQ(slot,
FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot));
DCHECK_EQ(store_ic_slot,
FeedbackVectorSlot(TypeFeedbackVector::kDummyStoreICSlot));
DCHECK_EQ(keyed_store_ic_slot,
slot = spec.AddStoreICSlot();
DCHECK_EQ(slot, FeedbackVectorSlot(TypeFeedbackVector::kDummyStoreICSlot));
slot = spec.AddKeyedStoreICSlot();
DCHECK_EQ(slot,
FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot));
Handle<TypeFeedbackMetadata> dummy_metadata =
......@@ -2798,13 +2798,13 @@ void Heap::CreateInitialObjects() {
Handle<TypeFeedbackVector> dummy_vector =
TypeFeedbackVector::New(isolate(), dummy_metadata);
Object* megamorphic = *TypeFeedbackVector::MegamorphicSentinel(isolate());
dummy_vector->Set(load_ic_slot, megamorphic, SKIP_WRITE_BARRIER);
dummy_vector->Set(keyed_load_ic_slot, megamorphic, SKIP_WRITE_BARRIER);
dummy_vector->Set(store_ic_slot, megamorphic, SKIP_WRITE_BARRIER);
dummy_vector->Set(keyed_store_ic_slot, megamorphic, SKIP_WRITE_BARRIER);
set_dummy_vector(*dummy_vector);
// Now initialize dummy vector's entries.
LoadICNexus(isolate()).ConfigureMegamorphic();
StoreICNexus(isolate()).ConfigureMegamorphic();
KeyedLoadICNexus(isolate()).ConfigureMegamorphicKeyed(PROPERTY);
KeyedStoreICNexus(isolate()).ConfigureMegamorphicKeyed(PROPERTY);
}
{
......
......@@ -566,6 +566,10 @@ class KeyedLoadICNexus : public FeedbackNexus {
: FeedbackNexus(vector, slot) {
DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, vector->GetKind(slot));
}
explicit KeyedLoadICNexus(Isolate* isolate)
: FeedbackNexus(
TypeFeedbackVector::DummyVector(isolate),
FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)) {}
KeyedLoadICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot)
: FeedbackNexus(vector, slot) {
DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, vector->GetKind(slot));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment