Merge V8 5.3.332.45. DO NOT MERGE
Test: Manual
FPIIM-449
Change-Id: Id3254828b068abdea3cb10442e0172a8c9a98e03
(cherry picked from commit 13e2dadd00298019ed862f2b2fc5068bba730bcf)
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc
index 1b571a7..6500b9a 100644
--- a/src/runtime-profiler.cc
+++ b/src/runtime-profiler.cc
@@ -21,7 +21,7 @@
// Number of times a function has to be seen on the stack before it is
// compiled for baseline.
-static const int kProfilerTicksBeforeBaseline = 2;
+static const int kProfilerTicksBeforeBaseline = 1;
// Number of times a function has to be seen on the stack before it is
// optimized.
static const int kProfilerTicksBeforeOptimization = 2;
@@ -56,16 +56,14 @@
any_ic_changed_(false) {
}
-
-static void GetICCounts(SharedFunctionInfo* shared,
- int* ic_with_type_info_count, int* ic_generic_count,
- int* ic_total_count, int* type_info_percentage,
- int* generic_percentage) {
+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) {
*ic_total_count = 0;
*ic_generic_count = 0;
*ic_with_type_info_count = 0;
- if (shared->code()->kind() == Code::FUNCTION) {
- Code* shared_code = shared->code();
+ if (function->code()->kind() == Code::FUNCTION) {
+ Code* shared_code = function->shared()->code();
Object* raw_info = shared_code->type_feedback_info();
if (raw_info->IsTypeFeedbackInfo()) {
TypeFeedbackInfo* info = TypeFeedbackInfo::cast(raw_info);
@@ -76,7 +74,7 @@
}
// Harvest vector-ics as well
- TypeFeedbackVector* vector = shared->feedback_vector();
+ TypeFeedbackVector* vector = function->feedback_vector();
int with = 0, gen = 0;
vector->ComputeCounts(&with, &gen);
*ic_with_type_info_count += with;
@@ -100,8 +98,8 @@
PrintF(" for %s recompilation, reason: %s", type, reason);
if (FLAG_type_info_threshold > 0) {
int typeinfo, generic, total, type_percentage, generic_percentage;
- GetICCounts(function->shared(), &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);
@@ -219,7 +217,7 @@
if (ticks >= kProfilerTicksBeforeOptimization) {
int typeinfo, generic, total, type_percentage, generic_percentage;
- GetICCounts(shared, &typeinfo, &generic, &total, &type_percentage,
+ GetICCounts(function, &typeinfo, &generic, &total, &type_percentage,
&generic_percentage);
if (type_percentage >= FLAG_type_info_threshold &&
generic_percentage <= FLAG_generic_ic_threshold) {
@@ -242,7 +240,7 @@
// If no IC was patched since the last tick and this function is very
// small, optimistically optimize it now.
int typeinfo, generic, total, type_percentage, generic_percentage;
- GetICCounts(shared, &typeinfo, &generic, &total, &type_percentage,
+ GetICCounts(function, &typeinfo, &generic, &total, &type_percentage,
&generic_percentage);
if (type_percentage >= FLAG_type_info_threshold &&
generic_percentage <= FLAG_generic_ic_threshold) {