Commit fab276ea authored by Victor Gomes's avatar Victor Gomes Committed by V8 LUCI CQ

[runtime] Remove dead code: FeedbackNexus::GetTypeProfile

Change-Id: Ide2262b9d0d6a5269ed9bf6694c194aeba8da828
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2867465
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74346}
parent 9b78e758
...@@ -1417,52 +1417,6 @@ std::vector<Handle<String>> FeedbackNexus::GetTypesForSourcePositions( ...@@ -1417,52 +1417,6 @@ std::vector<Handle<String>> FeedbackNexus::GetTypesForSourcePositions(
return types_for_position; return types_for_position;
} }
namespace {
Handle<JSObject> ConvertToJSObject(Isolate* isolate,
Handle<SimpleNumberDictionary> feedback) {
Handle<JSObject> type_profile =
isolate->factory()->NewJSObject(isolate->object_function());
for (int index = SimpleNumberDictionary::kElementsStartIndex;
index < feedback->length();
index += SimpleNumberDictionary::kEntrySize) {
int key_index = index + SimpleNumberDictionary::kEntryKeyIndex;
Object key = feedback->get(key_index);
if (key.IsSmi()) {
int value_index = index + SimpleNumberDictionary::kEntryValueIndex;
Handle<ArrayList> position_specific_types(
ArrayList::cast(feedback->get(value_index)), isolate);
int position = Smi::ToInt(key);
JSObject::AddDataElement(
type_profile, position,
isolate->factory()->NewJSArrayWithElements(
ArrayList::Elements(isolate, position_specific_types)),
PropertyAttributes::NONE);
}
}
return type_profile;
}
} // namespace
JSObject FeedbackNexus::GetTypeProfile() const {
DCHECK(IsTypeProfileKind(kind()));
Isolate* isolate = GetIsolate();
MaybeObject const feedback = GetFeedback();
if (feedback == UninitializedSentinel()) {
return *isolate->factory()->NewJSObject(isolate->object_function());
}
return *ConvertToJSObject(isolate,
handle(SimpleNumberDictionary::cast(
feedback->GetHeapObjectAssumeStrong()),
isolate));
}
void FeedbackNexus::ResetTypeProfile() { void FeedbackNexus::ResetTypeProfile() {
DCHECK(IsTypeProfileKind(kind())); DCHECK(IsTypeProfileKind(kind()));
SetFeedback(UninitializedSentinel()); SetFeedback(UninitializedSentinel());
......
...@@ -835,7 +835,6 @@ class V8_EXPORT_PRIVATE FeedbackNexus final { ...@@ -835,7 +835,6 @@ class V8_EXPORT_PRIVATE FeedbackNexus final {
// Add a type to the list of types for source position <position>. // Add a type to the list of types for source position <position>.
void Collect(Handle<String> type, int position); void Collect(Handle<String> type, int position);
JSObject GetTypeProfile() const;
std::vector<int> GetSourcePositions() const; std::vector<int> GetSourcePositions() const;
std::vector<Handle<String>> GetTypesForSourcePositions(uint32_t pos) const; std::vector<Handle<String>> GetTypesForSourcePositions(uint32_t pos) const;
......
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