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

Unified Diff: src/feedback-vector.cc

Issue 2731723002: [Turbofan] Don't inline if we never saw a function. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « src/compiler/js-inlining-heuristic.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/feedback-vector.cc
diff --git a/src/feedback-vector.cc b/src/feedback-vector.cc
index 4003068e9b5960e7af1b332c2b926abd9b5c68ba..5d842763994c75d047839b9423b2d2be298b744d 100644
--- a/src/feedback-vector.cc
+++ b/src/feedback-vector.cc
@@ -591,6 +591,10 @@ int CallICNexus::ExtractCallCount() {
float CallICNexus::ComputeCallFrequency() {
double const invocation_count = vector()->invocation_count();
double const call_count = ExtractCallCount();
+ if (invocation_count == 0) {
+ // Prevent division by 0.
+ return 0.0f;
+ }
return static_cast<float>(call_count / invocation_count);
}
« no previous file with comments | « src/compiler/js-inlining-heuristic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698