diff options
author | Michaël Zasso <targos@protonmail.com> | 2022-01-29 08:33:07 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2022-02-02 17:23:18 +0100 |
commit | 974ab4060fe3eff74dc0a62a5a27d516738f4c55 (patch) | |
tree | 30fbcca796ca5cc7b4abf917e716e2b02899cb7a /deps/v8/src/objects/feedback-vector.cc | |
parent | 4318b2348dbcd5003e0c4a14b5fe378cceec3c81 (diff) | |
download | node-new-974ab4060fe3eff74dc0a62a5a27d516738f4c55.tar.gz |
deps: update V8 to 9.8.177.9
PR-URL: https://github.com/nodejs/node/pull/41610
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/src/objects/feedback-vector.cc')
-rw-r--r-- | deps/v8/src/objects/feedback-vector.cc | 92 |
1 files changed, 47 insertions, 45 deletions
diff --git a/deps/v8/src/objects/feedback-vector.cc b/deps/v8/src/objects/feedback-vector.cc index 10428d18a5..15a0851c57 100644 --- a/deps/v8/src/objects/feedback-vector.cc +++ b/deps/v8/src/objects/feedback-vector.cc @@ -95,7 +95,7 @@ Handle<FeedbackMetadata> FeedbackMetadata::New(IsolateT* isolate, FeedbackSlotKind kind = spec->GetKind(FeedbackSlot(i)); int entry_size = FeedbackMetadata::GetSlotSize(kind); for (int j = 1; j < entry_size; j++) { - FeedbackSlotKind kind = spec->GetKind(FeedbackSlot(i + j)); + kind = spec->GetKind(FeedbackSlot(i + j)); DCHECK_EQ(FeedbackSlotKind::kInvalid, kind); } i += entry_size; @@ -725,20 +725,20 @@ InlineCacheState FeedbackNexus::ic_state() const { switch (kind()) { case FeedbackSlotKind::kLiteral: - if (feedback->IsSmi()) return UNINITIALIZED; - return MONOMORPHIC; + if (feedback->IsSmi()) return InlineCacheState::UNINITIALIZED; + return InlineCacheState::MONOMORPHIC; case FeedbackSlotKind::kStoreGlobalSloppy: case FeedbackSlotKind::kStoreGlobalStrict: case FeedbackSlotKind::kLoadGlobalNotInsideTypeof: case FeedbackSlotKind::kLoadGlobalInsideTypeof: { - if (feedback->IsSmi()) return MONOMORPHIC; + if (feedback->IsSmi()) return InlineCacheState::MONOMORPHIC; DCHECK(feedback->IsWeakOrCleared()); if (!feedback->IsCleared() || extra != UninitializedSentinel()) { - return MONOMORPHIC; + return InlineCacheState::MONOMORPHIC; } - return UNINITIALIZED; + return InlineCacheState::UNINITIALIZED; } case FeedbackSlotKind::kStoreNamedSloppy: @@ -752,32 +752,33 @@ InlineCacheState FeedbackNexus::ic_state() const { case FeedbackSlotKind::kLoadKeyed: case FeedbackSlotKind::kHasKeyed: { if (feedback == UninitializedSentinel()) { - return UNINITIALIZED; + return InlineCacheState::UNINITIALIZED; } if (feedback == MegamorphicSentinel()) { - return MEGAMORPHIC; + return InlineCacheState::MEGAMORPHIC; } if (feedback == MegaDOMSentinel()) { DCHECK(IsLoadICKind(kind())); - return MEGADOM; + return InlineCacheState::MEGADOM; } if (feedback->IsWeakOrCleared()) { // Don't check if the map is cleared. - return MONOMORPHIC; + return InlineCacheState::MONOMORPHIC; } HeapObject heap_object; if (feedback->GetHeapObjectIfStrong(&heap_object)) { if (heap_object.IsWeakFixedArray()) { // Determine state purely by our structure, don't check if the maps // are cleared. - return POLYMORPHIC; + return InlineCacheState::POLYMORPHIC; } if (heap_object.IsName()) { DCHECK(IsKeyedLoadICKind(kind()) || IsKeyedStoreICKind(kind()) || IsKeyedHasICKind(kind()) || IsDefineOwnICKind(kind())); Object extra_object = extra->GetHeapObjectAssumeStrong(); WeakFixedArray extra_array = WeakFixedArray::cast(extra_object); - return extra_array.length() > 2 ? POLYMORPHIC : MONOMORPHIC; + return extra_array.length() > 2 ? InlineCacheState::POLYMORPHIC + : InlineCacheState::MONOMORPHIC; } } UNREACHABLE(); @@ -785,97 +786,97 @@ InlineCacheState FeedbackNexus::ic_state() const { case FeedbackSlotKind::kCall: { HeapObject heap_object; if (feedback == MegamorphicSentinel()) { - return GENERIC; + return InlineCacheState::GENERIC; } else if (feedback->IsWeakOrCleared()) { if (feedback->GetHeapObjectIfWeak(&heap_object)) { if (heap_object.IsFeedbackCell()) { - return POLYMORPHIC; + return InlineCacheState::POLYMORPHIC; } CHECK(heap_object.IsJSFunction() || heap_object.IsJSBoundFunction()); } - return MONOMORPHIC; + return InlineCacheState::MONOMORPHIC; } else if (feedback->GetHeapObjectIfStrong(&heap_object) && heap_object.IsAllocationSite()) { - return MONOMORPHIC; + return InlineCacheState::MONOMORPHIC; } CHECK_EQ(feedback, UninitializedSentinel()); - return UNINITIALIZED; + return InlineCacheState::UNINITIALIZED; } case FeedbackSlotKind::kBinaryOp: { BinaryOperationHint hint = GetBinaryOperationFeedback(); if (hint == BinaryOperationHint::kNone) { - return UNINITIALIZED; + return InlineCacheState::UNINITIALIZED; } else if (hint == BinaryOperationHint::kAny) { - return GENERIC; + return InlineCacheState::GENERIC; } - return MONOMORPHIC; + return InlineCacheState::MONOMORPHIC; } case FeedbackSlotKind::kCompareOp: { CompareOperationHint hint = GetCompareOperationFeedback(); if (hint == CompareOperationHint::kNone) { - return UNINITIALIZED; + return InlineCacheState::UNINITIALIZED; } else if (hint == CompareOperationHint::kAny) { - return GENERIC; + return InlineCacheState::GENERIC; } - return MONOMORPHIC; + return InlineCacheState::MONOMORPHIC; } case FeedbackSlotKind::kForIn: { ForInHint hint = GetForInFeedback(); if (hint == ForInHint::kNone) { - return UNINITIALIZED; + return InlineCacheState::UNINITIALIZED; } else if (hint == ForInHint::kAny) { - return GENERIC; + return InlineCacheState::GENERIC; } - return MONOMORPHIC; + return InlineCacheState::MONOMORPHIC; } case FeedbackSlotKind::kInstanceOf: { if (feedback == UninitializedSentinel()) { - return UNINITIALIZED; + return InlineCacheState::UNINITIALIZED; } else if (feedback == MegamorphicSentinel()) { - return MEGAMORPHIC; + return InlineCacheState::MEGAMORPHIC; } - return MONOMORPHIC; + return InlineCacheState::MONOMORPHIC; } case FeedbackSlotKind::kStoreDataPropertyInLiteral: { if (feedback == UninitializedSentinel()) { - return UNINITIALIZED; + return InlineCacheState::UNINITIALIZED; } else if (feedback->IsWeakOrCleared()) { // Don't check if the map is cleared. - return MONOMORPHIC; + return InlineCacheState::MONOMORPHIC; } - return MEGAMORPHIC; + return InlineCacheState::MEGAMORPHIC; } case FeedbackSlotKind::kTypeProfile: { if (feedback == UninitializedSentinel()) { - return UNINITIALIZED; + return InlineCacheState::UNINITIALIZED; } - return MONOMORPHIC; + return InlineCacheState::MONOMORPHIC; } case FeedbackSlotKind::kCloneObject: { if (feedback == UninitializedSentinel()) { - return UNINITIALIZED; + return InlineCacheState::UNINITIALIZED; } if (feedback == MegamorphicSentinel()) { - return MEGAMORPHIC; + return InlineCacheState::MEGAMORPHIC; } if (feedback->IsWeakOrCleared()) { - return MONOMORPHIC; + return InlineCacheState::MONOMORPHIC; } DCHECK(feedback->GetHeapObjectAssumeStrong().IsWeakFixedArray()); - return POLYMORPHIC; + return InlineCacheState::POLYMORPHIC; } case FeedbackSlotKind::kInvalid: case FeedbackSlotKind::kKindsNumber: UNREACHABLE(); } - return UNINITIALIZED; + return InlineCacheState::UNINITIALIZED; } void FeedbackNexus::ConfigurePropertyCellMode(Handle<PropertyCell> cell) { @@ -925,12 +926,12 @@ void FeedbackNexus::ConfigureCloneObject(Handle<Map> source_map, } } switch (ic_state()) { - case UNINITIALIZED: + case InlineCacheState::UNINITIALIZED: // Cache the first map seen which meets the fast case requirements. SetFeedback(HeapObjectReference::Weak(*source_map), UPDATE_WRITE_BARRIER, *result_map); break; - case MONOMORPHIC: + case InlineCacheState::MONOMORPHIC: if (feedback.is_null() || feedback.is_identical_to(source_map) || Map::cast(*feedback).is_deprecated()) { SetFeedback(HeapObjectReference::Weak(*source_map), @@ -947,7 +948,7 @@ void FeedbackNexus::ConfigureCloneObject(Handle<Map> source_map, HeapObjectReference::ClearedValue(isolate)); } break; - case POLYMORPHIC: { + case InlineCacheState::POLYMORPHIC: { const int kMaxElements = FLAG_max_valid_polymorphic_map_count * kCloneObjectPolymorphicEntrySize; Handle<WeakFixedArray> array = Handle<WeakFixedArray>::cast(feedback); @@ -1170,7 +1171,7 @@ Name FeedbackNexus::GetName() const { KeyedAccessLoadMode FeedbackNexus::GetKeyedAccessLoadMode() const { DCHECK(IsKeyedLoadICKind(kind()) || IsKeyedHasICKind(kind())); - if (GetKeyType() == PROPERTY) return STANDARD_LOAD; + if (GetKeyType() == IcCheckType::kProperty) return STANDARD_LOAD; std::vector<MapAndHandler> maps_and_handlers; ExtractMapsAndHandlers(&maps_and_handlers); @@ -1238,7 +1239,7 @@ KeyedAccessStoreMode FeedbackNexus::GetKeyedAccessStoreMode() const { IsStoreDataPropertyInLiteralKind(kind()) || IsDefineOwnICKind(kind())); KeyedAccessStoreMode mode = STANDARD_STORE; - if (GetKeyType() == PROPERTY) return mode; + if (GetKeyType() == IcCheckType::kProperty) return mode; std::vector<MapAndHandler> maps_and_handlers; ExtractMapsAndHandlers(&maps_and_handlers); @@ -1310,7 +1311,8 @@ IcCheckType FeedbackNexus::GetKeyType() const { IsStoreDataPropertyInLiteralKind(kind()) || IsDefineOwnICKind(kind()) ? pair.second : feedback; - return IsPropertyNameFeedback(maybe_name) ? PROPERTY : ELEMENT; + return IsPropertyNameFeedback(maybe_name) ? IcCheckType::kProperty + : IcCheckType::kElement; } BinaryOperationHint FeedbackNexus::GetBinaryOperationFeedback() const { |