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

Side by Side Diff: src/counters.cc

Issue 1973473002: [runtime] Record runtime call stats for Map::TransitionTo*Property, JSObject::OptimizeAsPrototype t… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@handler-counters2
Patch Set: Addressing comments and rebasing Created 4 years, 7 months 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/counters.h ('k') | src/counters-inl.h » ('j') | src/lookup.cc » ('J')
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/counters.h" 5 #include "src/counters.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 8
9 #include "src/base/platform/platform.h" 9 #include "src/base/platform/platform.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 CounterId counter_id) { 293 CounterId counter_id) {
294 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); 294 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats();
295 DCHECK_NOT_NULL(stats->current_timer_); 295 DCHECK_NOT_NULL(stats->current_timer_);
296 RuntimeCallCounter* counter = &(stats->*counter_id); 296 RuntimeCallCounter* counter = &(stats->*counter_id);
297 stats->current_timer_->counter_ = counter; 297 stats->current_timer_->counter_ = counter;
298 } 298 }
299 299
300 void RuntimeCallStats::Print(std::ostream& os) { 300 void RuntimeCallStats::Print(std::ostream& os) {
301 RuntimeCallStatEntries entries; 301 RuntimeCallStatEntries entries;
302 302
303 #define PRINT_COUNTER(name) entries.Add(&this->name);
304 FOR_EACH_MANUAL_COUNTER(PRINT_COUNTER)
305 #undef PRINT_COUNTER
306
303 #define PRINT_COUNTER(name, nargs, ressize) entries.Add(&this->Runtime_##name); 307 #define PRINT_COUNTER(name, nargs, ressize) entries.Add(&this->Runtime_##name);
304 FOR_EACH_INTRINSIC(PRINT_COUNTER) 308 FOR_EACH_INTRINSIC(PRINT_COUNTER)
305 #undef PRINT_COUNTER 309 #undef PRINT_COUNTER
306 310
307 #define PRINT_COUNTER(name, type) entries.Add(&this->Builtin_##name); 311 #define PRINT_COUNTER(name, type) entries.Add(&this->Builtin_##name);
308 BUILTIN_LIST_C(PRINT_COUNTER) 312 BUILTIN_LIST_C(PRINT_COUNTER)
309 #undef PRINT_COUNTER 313 #undef PRINT_COUNTER
310 314
311 #define PRINT_COUNTER(name) entries.Add(&this->Handler_##name); 315 #define PRINT_COUNTER(name) entries.Add(&this->Handler_##name);
312 FOR_EACH_HANDLER_COUNTER(PRINT_COUNTER) 316 FOR_EACH_HANDLER_COUNTER(PRINT_COUNTER)
313 #undef PRINT_COUNTER 317 #undef PRINT_COUNTER
314 318
315 entries.Add(&this->ExternalCallback);
316 entries.Add(&this->GC);
317 entries.Add(&this->UnexpectedStubMiss);
318
319 entries.Print(os); 319 entries.Print(os);
320 } 320 }
321 321
322 void RuntimeCallStats::Reset() { 322 void RuntimeCallStats::Reset() {
323 if (!FLAG_runtime_call_stats) return; 323 if (!FLAG_runtime_call_stats) return;
324 #define RESET_COUNTER(name, nargs, ressize) this->Runtime_##name.Reset(); 324 #define RESET_COUNTER(name, nargs, ressize) this->Runtime_##name.Reset();
325 FOR_EACH_INTRINSIC(RESET_COUNTER) 325 FOR_EACH_INTRINSIC(RESET_COUNTER)
326 #undef RESET_COUNTER 326 #undef RESET_COUNTER
327 #define RESET_COUNTER(name, type) this->Builtin_##name.Reset(); 327 #define RESET_COUNTER(name, type) this->Builtin_##name.Reset();
328 BUILTIN_LIST_C(RESET_COUNTER) 328 BUILTIN_LIST_C(RESET_COUNTER)
329 #undef RESET_COUNTER 329 #undef RESET_COUNTER
330 this->ExternalCallback.Reset(); 330 this->ExternalCallback.Reset();
331 this->GC.Reset(); 331 this->GC.Reset();
332 this->UnexpectedStubMiss.Reset(); 332 this->UnexpectedStubMiss.Reset();
333 } 333 }
334 334
335 } // namespace internal 335 } // namespace internal
336 } // namespace v8 336 } // namespace v8
OLDNEW
« no previous file with comments | « src/counters.h ('k') | src/counters-inl.h » ('j') | src/lookup.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698