| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 Object* raw_info = shared_code->type_feedback_info(); | 65 Object* raw_info = shared_code->type_feedback_info(); |
| 66 if (raw_info->IsTypeFeedbackInfo()) { | 66 if (raw_info->IsTypeFeedbackInfo()) { |
| 67 TypeFeedbackInfo* info = TypeFeedbackInfo::cast(raw_info); | 67 TypeFeedbackInfo* info = TypeFeedbackInfo::cast(raw_info); |
| 68 *ic_with_type_info_count = info->ic_with_type_info_count(); | 68 *ic_with_type_info_count = info->ic_with_type_info_count(); |
| 69 *ic_generic_count = info->ic_generic_count(); | 69 *ic_generic_count = info->ic_generic_count(); |
| 70 *ic_total_count = info->ic_total_count(); | 70 *ic_total_count = info->ic_total_count(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 // Harvest vector-ics as well | 73 // Harvest vector-ics as well |
| 74 TypeFeedbackVector* vector = shared->feedback_vector(); | 74 TypeFeedbackVector* vector = shared->feedback_vector(); |
| 75 *ic_with_type_info_count += vector->ic_with_type_info_count(); | 75 int with = 0, gen = 0; |
| 76 *ic_generic_count += vector->ic_generic_count(); | 76 vector->ComputeCounts(&with, &gen); |
| 77 *ic_with_type_info_count += with; |
| 78 *ic_generic_count += gen; |
| 77 | 79 |
| 78 if (*ic_total_count > 0) { | 80 if (*ic_total_count > 0) { |
| 79 *type_info_percentage = 100 * *ic_with_type_info_count / *ic_total_count; | 81 *type_info_percentage = 100 * *ic_with_type_info_count / *ic_total_count; |
| 80 *generic_percentage = 100 * *ic_generic_count / *ic_total_count; | 82 *generic_percentage = 100 * *ic_generic_count / *ic_total_count; |
| 81 } else { | 83 } else { |
| 82 *type_info_percentage = 100; // Compared against lower bound. | 84 *type_info_percentage = 100; // Compared against lower bound. |
| 83 *generic_percentage = 0; // Compared against upper bound. | 85 *generic_percentage = 0; // Compared against upper bound. |
| 84 } | 86 } |
| 85 } | 87 } |
| 86 | 88 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 } else { | 257 } else { |
| 256 shared_code->set_profiler_ticks(ticks + 1); | 258 shared_code->set_profiler_ticks(ticks + 1); |
| 257 } | 259 } |
| 258 } | 260 } |
| 259 any_ic_changed_ = false; | 261 any_ic_changed_ = false; |
| 260 } | 262 } |
| 261 | 263 |
| 262 | 264 |
| 263 } // namespace internal | 265 } // namespace internal |
| 264 } // namespace v8 | 266 } // namespace v8 |
| OLD | NEW |