| 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/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 // Harvest vector-ics as well | 114 // Harvest vector-ics as well |
| 115 TypeFeedbackVector* vector = function->feedback_vector(); | 115 TypeFeedbackVector* vector = function->feedback_vector(); |
| 116 int with = 0, gen = 0, type_vector_ic_count = 0; | 116 int with = 0, gen = 0, type_vector_ic_count = 0; |
| 117 const bool is_interpreted = | 117 const bool is_interpreted = |
| 118 function->shared()->code()->is_interpreter_trampoline_builtin(); | 118 function->shared()->code()->is_interpreter_trampoline_builtin(); |
| 119 | 119 |
| 120 vector->ComputeCounts(&with, &gen, &type_vector_ic_count, is_interpreted); | 120 vector->ComputeCounts(&with, &gen, &type_vector_ic_count, is_interpreted); |
| 121 if (is_interpreted) { | 121 *ic_total_count += type_vector_ic_count; |
| 122 DCHECK_EQ(*ic_total_count, 0); | |
| 123 *ic_total_count = type_vector_ic_count; | |
| 124 } | |
| 125 *ic_with_type_info_count += with; | 122 *ic_with_type_info_count += with; |
| 126 *ic_generic_count += gen; | 123 *ic_generic_count += gen; |
| 127 | 124 |
| 128 if (*ic_total_count > 0) { | 125 if (*ic_total_count > 0) { |
| 129 *type_info_percentage = 100 * *ic_with_type_info_count / *ic_total_count; | 126 *type_info_percentage = 100 * *ic_with_type_info_count / *ic_total_count; |
| 130 *generic_percentage = 100 * *ic_generic_count / *ic_total_count; | 127 *generic_percentage = 100 * *ic_generic_count / *ic_total_count; |
| 131 } else { | 128 } else { |
| 132 *type_info_percentage = 100; // Compared against lower bound. | 129 *type_info_percentage = 100; // Compared against lower bound. |
| 133 *generic_percentage = 0; // Compared against upper bound. | 130 *generic_percentage = 0; // Compared against upper bound. |
| 134 } | 131 } |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 } else { | 480 } else { |
| 484 DCHECK_EQ(next_tier, Compiler::OPTIMIZED); | 481 DCHECK_EQ(next_tier, Compiler::OPTIMIZED); |
| 485 MaybeOptimizeFullCodegen(function, frame, frame_count); | 482 MaybeOptimizeFullCodegen(function, frame, frame_count); |
| 486 } | 483 } |
| 487 } | 484 } |
| 488 any_ic_changed_ = false; | 485 any_ic_changed_ = false; |
| 489 } | 486 } |
| 490 | 487 |
| 491 } // namespace internal | 488 } // namespace internal |
| 492 } // namespace v8 | 489 } // namespace v8 |
| OLD | NEW |