OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 } | 382 } |
383 } | 383 } |
384 } | 384 } |
385 | 385 |
386 | 386 |
387 void RuntimeProfiler::SetUp() { | 387 void RuntimeProfiler::SetUp() { |
388 ASSERT(has_been_globally_set_up_); | 388 ASSERT(has_been_globally_set_up_); |
389 if (!FLAG_watch_ic_patching) { | 389 if (!FLAG_watch_ic_patching) { |
390 ClearSampleBuffer(); | 390 ClearSampleBuffer(); |
391 } | 391 } |
392 // If the ticker hasn't already started, make sure to do so to get | |
393 // the ticks for the runtime profiler. | |
394 if (IsEnabled()) isolate_->logger()->EnsureTickerStarted(); | |
395 } | 392 } |
396 | 393 |
397 | 394 |
398 void RuntimeProfiler::Reset() { | 395 void RuntimeProfiler::Reset() { |
399 if (!FLAG_watch_ic_patching) { | 396 if (!FLAG_watch_ic_patching) { |
400 sampler_threshold_ = kSamplerThresholdInit; | 397 sampler_threshold_ = kSamplerThresholdInit; |
401 sampler_threshold_size_factor_ = kSamplerThresholdSizeFactorInit; | 398 sampler_threshold_size_factor_ = kSamplerThresholdSizeFactorInit; |
402 sampler_ticks_until_threshold_adjustment_ = | 399 sampler_ticks_until_threshold_adjustment_ = |
403 kSamplerTicksBetweenThresholdAdjustment; | 400 kSamplerTicksBetweenThresholdAdjustment; |
404 } | 401 } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 | 482 |
486 | 483 |
487 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) { | 484 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) { |
488 for (int i = 0; i < kSamplerWindowSize; i++) { | 485 for (int i = 0; i < kSamplerWindowSize; i++) { |
489 visitor->VisitPointer(&sampler_window_[i]); | 486 visitor->VisitPointer(&sampler_window_[i]); |
490 } | 487 } |
491 } | 488 } |
492 | 489 |
493 | 490 |
494 } } // namespace v8::internal | 491 } } // namespace v8::internal |
OLD | NEW |