diff options
Diffstat (limited to 'deps/v8/src/type-feedback-vector.cc')
-rw-r--r-- | deps/v8/src/type-feedback-vector.cc | 49 |
1 files changed, 17 insertions, 32 deletions
diff --git a/deps/v8/src/type-feedback-vector.cc b/deps/v8/src/type-feedback-vector.cc index 9fb03bb673..698f2a6d17 100644 --- a/deps/v8/src/type-feedback-vector.cc +++ b/deps/v8/src/type-feedback-vector.cc @@ -140,8 +140,6 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::New( Handle<FixedArray> array = factory->NewFixedArray(length, TENURED); array->set(kMetadataIndex, *metadata); - array->set(kWithTypesIndex, Smi::FromInt(0)); - array->set(kGenericCountIndex, Smi::FromInt(0)); // Ensure we can skip the write barrier Handle<Object> uninitialized_sentinel = UninitializedSentinel(isolate); @@ -162,28 +160,6 @@ int TypeFeedbackVector::GetIndexFromSpec(const FeedbackVectorSpec* spec, // static -int TypeFeedbackVector::PushAppliedArgumentsIndex() { - return kReservedIndexCount; -} - - -// static -Handle<TypeFeedbackVector> TypeFeedbackVector::CreatePushAppliedArgumentsVector( - Isolate* isolate) { - StaticFeedbackVectorSpec spec; - FeedbackVectorSlot slot = spec.AddKeyedLoadICSlot(); - // TODO(ishell): allocate this metadata only once. - Handle<TypeFeedbackMetadata> feedback_metadata = - TypeFeedbackMetadata::New(isolate, &spec); - Handle<TypeFeedbackVector> feedback_vector = - TypeFeedbackVector::New(isolate, feedback_metadata); - DCHECK_EQ(PushAppliedArgumentsIndex(), feedback_vector->GetIndex(slot)); - USE(slot); - return feedback_vector; -} - - -// static Handle<TypeFeedbackVector> TypeFeedbackVector::Copy( Isolate* isolate, Handle<TypeFeedbackVector> vector) { Handle<TypeFeedbackVector> result; @@ -233,13 +209,11 @@ void TypeFeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared, break; } case FeedbackVectorSlotKind::STORE_IC: { - DCHECK(FLAG_vector_stores); StoreICNexus nexus(this, slot); nexus.Clear(shared->code()); break; } case FeedbackVectorSlotKind::KEYED_STORE_IC: { - DCHECK(FLAG_vector_stores); KeyedStoreICNexus nexus(this, slot); nexus.Clear(shared->code()); break; @@ -269,7 +243,6 @@ void TypeFeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared, // static void TypeFeedbackVector::ClearAllKeyedStoreICs(Isolate* isolate) { - DCHECK(FLAG_vector_stores); SharedFunctionInfo::Iterator iterator(isolate); SharedFunctionInfo* shared; while ((shared = iterator.Next())) { @@ -293,7 +266,6 @@ void TypeFeedbackVector::ClearKeyedStoreICs(SharedFunctionInfo* shared) { if (kind != FeedbackVectorSlotKind::KEYED_STORE_IC) continue; Object* obj = Get(slot); if (obj != uninitialized_sentinel) { - DCHECK(FLAG_vector_stores); KeyedStoreICNexus nexus(this, slot); nexus.Clear(host); } @@ -520,6 +492,19 @@ void CallICNexus::ConfigureMonomorphic(Handle<JSFunction> function) { } +void CallICNexus::ConfigureMegamorphic() { + FeedbackNexus::ConfigureMegamorphic(); +} + + +void CallICNexus::ConfigureMegamorphic(int call_count) { + SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(GetIsolate()), + SKIP_WRITE_BARRIER); + SetFeedbackExtra(Smi::FromInt(call_count * kCallCountIncrement), + SKIP_WRITE_BARRIER); +} + + void LoadICNexus::ConfigureMonomorphic(Handle<Map> receiver_map, Handle<Code> handler) { Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map); @@ -536,8 +521,8 @@ void KeyedLoadICNexus::ConfigureMonomorphic(Handle<Name> name, SetFeedback(*cell); SetFeedbackExtra(*handler); } else { - SetFeedback(*name); Handle<FixedArray> array = EnsureExtraArrayOfSize(2); + SetFeedback(*name); array->set(0, *cell); array->set(1, *handler); } @@ -560,8 +545,8 @@ void KeyedStoreICNexus::ConfigureMonomorphic(Handle<Name> name, SetFeedback(*cell); SetFeedbackExtra(*handler); } else { - SetFeedback(*name); Handle<FixedArray> array = EnsureExtraArrayOfSize(2); + SetFeedback(*name); array->set(0, *cell); array->set(1, *handler); } @@ -590,8 +575,8 @@ void KeyedLoadICNexus::ConfigurePolymorphic(Handle<Name> name, SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()), SKIP_WRITE_BARRIER); } else { - SetFeedback(*name); array = EnsureExtraArrayOfSize(receiver_count * 2); + SetFeedback(*name); } InstallHandlers(array, maps, handlers); @@ -620,8 +605,8 @@ void KeyedStoreICNexus::ConfigurePolymorphic(Handle<Name> name, SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()), SKIP_WRITE_BARRIER); } else { - SetFeedback(*name); array = EnsureExtraArrayOfSize(receiver_count * 2); + SetFeedback(*name); } InstallHandlers(array, maps, handlers); |