| OLD | NEW | 
|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "src/runtime-profiler.h" | 5 #include "src/runtime-profiler.h" | 
| 6 | 6 | 
| 7 #include "src/assembler.h" | 7 #include "src/assembler.h" | 
| 8 #include "src/ast/scopeinfo.h" | 8 #include "src/ast/scopeinfo.h" | 
| 9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" | 
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" | 
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 83     *type_info_percentage = 100 * *ic_with_type_info_count / *ic_total_count; | 83     *type_info_percentage = 100 * *ic_with_type_info_count / *ic_total_count; | 
| 84     *generic_percentage = 100 * *ic_generic_count / *ic_total_count; | 84     *generic_percentage = 100 * *ic_generic_count / *ic_total_count; | 
| 85   } else { | 85   } else { | 
| 86     *type_info_percentage = 100;  // Compared against lower bound. | 86     *type_info_percentage = 100;  // Compared against lower bound. | 
| 87     *generic_percentage = 0;      // Compared against upper bound. | 87     *generic_percentage = 0;      // Compared against upper bound. | 
| 88   } | 88   } | 
| 89 } | 89 } | 
| 90 | 90 | 
| 91 | 91 | 
| 92 void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) { | 92 void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) { | 
| 93   if (FLAG_trace_opt && function->PassesFilter(FLAG_hydrogen_filter)) { | 93   if (FLAG_trace_opt && | 
|  | 94       function->shared()->PassesFilter(FLAG_hydrogen_filter)) { | 
| 94     PrintF("[marking "); | 95     PrintF("[marking "); | 
| 95     function->ShortPrint(); | 96     function->ShortPrint(); | 
| 96     PrintF(" for recompilation, reason: %s", reason); | 97     PrintF(" for recompilation, reason: %s", reason); | 
| 97     if (FLAG_type_info_threshold > 0) { | 98     if (FLAG_type_info_threshold > 0) { | 
| 98       int typeinfo, generic, total, type_percentage, generic_percentage; | 99       int typeinfo, generic, total, type_percentage, generic_percentage; | 
| 99       GetICCounts(function->shared(), &typeinfo, &generic, &total, | 100       GetICCounts(function->shared(), &typeinfo, &generic, &total, | 
| 100                   &type_percentage, &generic_percentage); | 101                   &type_percentage, &generic_percentage); | 
| 101       PrintF(", ICs with typeinfo: %d/%d (%d%%)", typeinfo, total, | 102       PrintF(", ICs with typeinfo: %d/%d (%d%%)", typeinfo, total, | 
| 102              type_percentage); | 103              type_percentage); | 
| 103       PrintF(", generic ICs: %d/%d (%d%%)", generic, total, generic_percentage); | 104       PrintF(", generic ICs: %d/%d (%d%%)", generic, total, generic_percentage); | 
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 324     } else { | 325     } else { | 
| 325       MaybeOptimizeFullCodegen(function, frame_count, frame->is_optimized()); | 326       MaybeOptimizeFullCodegen(function, frame_count, frame->is_optimized()); | 
| 326     } | 327     } | 
| 327   } | 328   } | 
| 328   any_ic_changed_ = false; | 329   any_ic_changed_ = false; | 
| 329 } | 330 } | 
| 330 | 331 | 
| 331 | 332 | 
| 332 }  // namespace internal | 333 }  // namespace internal | 
| 333 }  // namespace v8 | 334 }  // namespace v8 | 
| OLD | NEW | 
|---|