Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 2337123003: [turbofan] Collect invocation counts and compute relative call frequencies. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index 39c0397181346f1ccba477059b9905a5a420c99d..5068eff673146adc34078c915c9ad301be40150c 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -571,9 +571,11 @@ bool BytecodeGraphBuilder::Environment::StateValuesAreUpToDate(
BytecodeGraphBuilder::BytecodeGraphBuilder(Zone* local_zone,
CompilationInfo* info,
- JSGraph* jsgraph)
+ JSGraph* jsgraph,
+ float invocation_frequency)
: local_zone_(local_zone),
jsgraph_(jsgraph),
+ invocation_frequency_(invocation_frequency),
bytecode_array_(handle(info->shared_info()->bytecode_array())),
exception_handler_table_(
handle(HandlerTable::cast(bytecode_array()->handler_table()))),
@@ -1354,7 +1356,10 @@ CompareOperationHint BytecodeGraphBuilder::GetCompareOperationHint() {
float BytecodeGraphBuilder::ComputeCallFrequency(int slot_id) const {
if (slot_id >= TypeFeedbackVector::kReservedIndexCount) {
CallICNexus nexus(feedback_vector(), feedback_vector()->ToSlot(slot_id));
- return nexus.ExtractCallCount();
+ double const call_count = nexus.ExtractCallCount();
+ double const invocation_count = feedback_vector()->invocation_count();
+ return static_cast<float>(call_count / invocation_count) *
mvstanton 2016/09/14 09:26:09 Here too.
Benedikt Meurer 2016/09/14 10:55:44 Done.
+ invocation_frequency_;
}
return 0.0f;
}

Powered by Google App Engine
This is Rietveld 408576698