Commit 19dcbec8 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[cleanup] Remove obsolete --type_info_threshold flag.

The --type_info_threshold is no longer supported for a long time and
doesn't do anything useful nowadays, so no point in having that around.

Drive-by-fix: Remove the FeedbackVector::ComputeCounts() logic, since
it's dead code anyways by now.

Bug: v8:8834
Change-Id: I05f7517b3b82e34c0a83357337a456ab9c9f1f42
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1538128
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60442}
parent 573a91cd
......@@ -264,110 +264,6 @@ ForInHint ForInHintFromFeedback(int type_feedback) {
UNREACHABLE();
}
void FeedbackVector::ComputeCounts(int* with_type_info, int* generic,
int* vector_ic_count) {
MaybeObject megamorphic_sentinel = MaybeObject::FromObject(
*FeedbackVector::MegamorphicSentinel(GetIsolate()));
int with = 0;
int gen = 0;
int total = 0;
FeedbackMetadataIterator iter(metadata());
while (iter.HasNext()) {
FeedbackSlot slot = iter.Next();
FeedbackSlotKind kind = iter.kind();
MaybeObject const obj = Get(slot);
AssertNoLegacyTypes(obj);
switch (kind) {
case FeedbackSlotKind::kCall:
case FeedbackSlotKind::kLoadProperty:
case FeedbackSlotKind::kLoadGlobalInsideTypeof:
case FeedbackSlotKind::kLoadGlobalNotInsideTypeof:
case FeedbackSlotKind::kLoadKeyed:
case FeedbackSlotKind::kHasKeyed:
case FeedbackSlotKind::kStoreNamedSloppy:
case FeedbackSlotKind::kStoreNamedStrict:
case FeedbackSlotKind::kStoreOwnNamed:
case FeedbackSlotKind::kStoreGlobalSloppy:
case FeedbackSlotKind::kStoreGlobalStrict:
case FeedbackSlotKind::kStoreKeyedSloppy:
case FeedbackSlotKind::kStoreKeyedStrict:
case FeedbackSlotKind::kStoreInArrayLiteral:
case FeedbackSlotKind::kStoreDataPropertyInLiteral:
case FeedbackSlotKind::kTypeProfile: {
HeapObject heap_object;
if (obj->IsWeakOrCleared() ||
(obj->GetHeapObjectIfStrong(&heap_object) &&
(heap_object->IsWeakFixedArray() || heap_object->IsString()))) {
with++;
} else if (obj == megamorphic_sentinel) {
gen++;
with++;
}
total++;
break;
}
case FeedbackSlotKind::kBinaryOp: {
int const feedback = obj.ToSmi().value();
BinaryOperationHint hint = BinaryOperationHintFromFeedback(feedback);
if (hint == BinaryOperationHint::kAny) {
gen++;
}
if (hint != BinaryOperationHint::kNone) {
with++;
}
total++;
break;
}
case FeedbackSlotKind::kCompareOp: {
int const feedback = obj.ToSmi().value();
CompareOperationHint hint = CompareOperationHintFromFeedback(feedback);
if (hint == CompareOperationHint::kAny) {
gen++;
}
if (hint != CompareOperationHint::kNone) {
with++;
}
total++;
break;
}
case FeedbackSlotKind::kForIn: {
int const feedback = obj.ToSmi().value();
ForInHint hint = ForInHintFromFeedback(feedback);
if (hint == ForInHint::kAny) {
gen++;
}
if (hint != ForInHint::kNone) {
with++;
}
total++;
break;
}
case FeedbackSlotKind::kInstanceOf: {
if (obj->IsWeakOrCleared()) {
with++;
} else if (obj == megamorphic_sentinel) {
gen++;
with++;
}
total++;
break;
}
case FeedbackSlotKind::kLiteral:
case FeedbackSlotKind::kCloneObject:
break;
case FeedbackSlotKind::kInvalid:
case FeedbackSlotKind::kKindsNumber:
UNREACHABLE();
break;
}
}
*with_type_info = with;
*generic = gen;
*vector_ic_count = total;
}
Handle<Symbol> FeedbackVector::UninitializedSentinel(Isolate* isolate) {
return isolate->factory()->uninitialized_symbol();
}
......
......@@ -157,9 +157,6 @@ class FeedbackVector : public HeapObject {
DECL_CAST(FeedbackVector)
inline void ComputeCounts(int* with_type_info, int* generic,
int* vector_ic_count);
inline bool is_empty() const;
inline FeedbackMetadata metadata() const;
......
......@@ -687,8 +687,6 @@ DEFINE_NEG_IMPLICATION(wasm_interpret_all, wasm_tier_up)
// Profiler flags.
DEFINE_INT(frame_count, 1, "number of stack frames inspected by the profiler")
DEFINE_INT(type_info_threshold, 25,
"percentage of ICs that must have type info to allow optimization")
DEFINE_INT(stress_sampling_allocation_profiler, 0,
"Enables sampling allocation profiler with X as a sample interval")
......
......@@ -67,36 +67,12 @@ RuntimeProfiler::RuntimeProfiler(Isolate* isolate)
any_ic_changed_(false) {
}
static void GetICCounts(JSFunction function, int* ic_with_type_info_count,
int* ic_generic_count, int* ic_total_count,
int* type_info_percentage, int* generic_percentage) {
FeedbackVector vector = function->feedback_vector();
vector->ComputeCounts(ic_with_type_info_count, ic_generic_count,
ic_total_count);
if (*ic_total_count > 0) {
*type_info_percentage = 100 * *ic_with_type_info_count / *ic_total_count;
*generic_percentage = 100 * *ic_generic_count / *ic_total_count;
} else {
*type_info_percentage = 100; // Compared against lower bound.
*generic_percentage = 0; // Compared against upper bound.
}
}
static void TraceRecompile(JSFunction function, const char* reason,
const char* type) {
if (FLAG_trace_opt) {
PrintF("[marking ");
function->ShortPrint();
PrintF(" for %s recompilation, reason: %s", type, reason);
if (FLAG_type_info_threshold > 0) {
int typeinfo, generic, total, type_percentage, generic_percentage;
GetICCounts(function, &typeinfo, &generic, &total, &type_percentage,
&generic_percentage);
PrintF(", ICs with typeinfo: %d/%d (%d%%)", typeinfo, total,
type_percentage);
PrintF(", generic ICs: %d/%d (%d%%)", generic, total, generic_percentage);
}
PrintF("]\n");
}
}
......
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