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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/runtime-profiler.h" | 7 #include "src/runtime-profiler.h" |
8 | 8 |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 int* type_info_percentage, int* generic_percentage) { | 62 int* type_info_percentage, int* generic_percentage) { |
63 *ic_total_count = 0; | 63 *ic_total_count = 0; |
64 *ic_generic_count = 0; | 64 *ic_generic_count = 0; |
65 *ic_with_type_info_count = 0; | 65 *ic_with_type_info_count = 0; |
66 Object* raw_info = shared_code->type_feedback_info(); | 66 Object* raw_info = shared_code->type_feedback_info(); |
67 if (raw_info->IsTypeFeedbackInfo()) { | 67 if (raw_info->IsTypeFeedbackInfo()) { |
68 TypeFeedbackInfo* info = TypeFeedbackInfo::cast(raw_info); | 68 TypeFeedbackInfo* info = TypeFeedbackInfo::cast(raw_info); |
69 *ic_with_type_info_count = info->ic_with_type_info_count(); | 69 *ic_with_type_info_count = info->ic_with_type_info_count(); |
70 *ic_generic_count = info->ic_generic_count(); | 70 *ic_generic_count = info->ic_generic_count(); |
71 *ic_total_count = info->ic_total_count(); | 71 *ic_total_count = info->ic_total_count(); |
72 // Harvest vector-ics as well | |
Jakob Kummerow
2014/10/14 15:27:20
I think this should be moved out of the if-block (
mvstanton
2014/10/16 10:54:14
Hmm, I don't get it. If we have a TypeFeedbackInfo
| |
73 TypeFeedbackVector* vector = info->feedback_vector(); | |
74 *ic_with_type_info_count += vector->ic_with_type_info_count(); | |
75 *ic_generic_count += vector->ic_generic_count(); | |
72 } | 76 } |
73 if (*ic_total_count > 0) { | 77 if (*ic_total_count > 0) { |
74 *type_info_percentage = 100 * *ic_with_type_info_count / *ic_total_count; | 78 *type_info_percentage = 100 * *ic_with_type_info_count / *ic_total_count; |
75 *generic_percentage = 100 * *ic_generic_count / *ic_total_count; | 79 *generic_percentage = 100 * *ic_generic_count / *ic_total_count; |
76 } else { | 80 } else { |
77 *type_info_percentage = 100; // Compared against lower bound. | 81 *type_info_percentage = 100; // Compared against lower bound. |
78 *generic_percentage = 0; // Compared against upper bound. | 82 *generic_percentage = 0; // Compared against upper bound. |
79 } | 83 } |
80 } | 84 } |
81 | 85 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 } | 273 } |
270 } else { | 274 } else { |
271 shared_code->set_profiler_ticks(ticks + 1); | 275 shared_code->set_profiler_ticks(ticks + 1); |
272 } | 276 } |
273 } | 277 } |
274 any_ic_changed_ = false; | 278 any_ic_changed_ = false; |
275 } | 279 } |
276 | 280 |
277 | 281 |
278 } } // namespace v8::internal | 282 } } // namespace v8::internal |
OLD | NEW |