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

Unified Diff: src/compiler/ast-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/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index fda3c7ad44cb90803a44c5faf3ef55711ec3316f..56b1f8c2d2852ebdf23f268784bc650091b2a7e7 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -411,14 +411,15 @@ class AstGraphBuilder::ControlScopeForFinally : public ControlScope {
TryFinallyBuilder* control_;
};
-
AstGraphBuilder::AstGraphBuilder(Zone* local_zone, CompilationInfo* info,
- JSGraph* jsgraph, LoopAssignmentAnalysis* loop,
+ JSGraph* jsgraph, float invocation_frequency,
+ LoopAssignmentAnalysis* loop,
TypeHintAnalysis* type_hint_analysis)
: isolate_(info->isolate()),
local_zone_(local_zone),
info_(info),
jsgraph_(jsgraph),
+ invocation_frequency_(invocation_frequency),
environment_(nullptr),
ast_context_(nullptr),
globals_(0, local_zone),
@@ -3104,7 +3105,10 @@ float AstGraphBuilder::ComputeCallFrequency(FeedbackVectorSlot slot) const {
Handle<TypeFeedbackVector> feedback_vector(
info()->closure()->feedback_vector(), isolate());
CallICNexus nexus(feedback_vector, slot);
- return nexus.ExtractCallCount();
+ double const invocation_count = feedback_vector->invocation_count();
+ double const call_count = nexus.ExtractCallCount();
+ return static_cast<float>(call_count / invocation_count) *
+ invocation_frequency_;
mvstanton 2016/09/14 09:26:09 How about giving the CallICNexus responsibility fo
Benedikt Meurer 2016/09/14 10:55:44 Done.
}
Node* AstGraphBuilder::ProcessArguments(const Operator* op, int arity) {

Powered by Google App Engine
This is Rietveld 408576698