Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(841)

Side by Side Diff: src/runtime-profiler.cc

Issue 1507903004: Type Feedback Vector: Calculate profiler counts on the fly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment response. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects-printer.cc ('k') | src/type-feedback-vector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/objects-printer.cc ('k') | src/type-feedback-vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698