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/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 4520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4531 | 4531 |
4532 bool Heap::IdleNotification(int idle_time_in_ms) { | 4532 bool Heap::IdleNotification(int idle_time_in_ms) { |
4533 return IdleNotification( | 4533 return IdleNotification( |
4534 V8::GetCurrentPlatform()->MonotonicallyIncreasingTime() + | 4534 V8::GetCurrentPlatform()->MonotonicallyIncreasingTime() + |
4535 (static_cast<double>(idle_time_in_ms) / | 4535 (static_cast<double>(idle_time_in_ms) / |
4536 static_cast<double>(base::Time::kMillisecondsPerSecond))); | 4536 static_cast<double>(base::Time::kMillisecondsPerSecond))); |
4537 } | 4537 } |
4538 | 4538 |
4539 | 4539 |
4540 bool Heap::IdleNotification(double deadline_in_seconds) { | 4540 bool Heap::IdleNotification(double deadline_in_seconds) { |
| 4541 CHECK(HasBeenSetUp()); // http://crbug.com/425035 |
4541 double deadline_in_ms = | 4542 double deadline_in_ms = |
4542 deadline_in_seconds * | 4543 deadline_in_seconds * |
4543 static_cast<double>(base::Time::kMillisecondsPerSecond); | 4544 static_cast<double>(base::Time::kMillisecondsPerSecond); |
4544 HistogramTimerScope idle_notification_scope( | 4545 HistogramTimerScope idle_notification_scope( |
4545 isolate_->counters()->gc_idle_notification()); | 4546 isolate_->counters()->gc_idle_notification()); |
4546 | 4547 |
4547 GCIdleTimeHandler::HeapState heap_state; | 4548 GCIdleTimeHandler::HeapState heap_state; |
4548 heap_state.contexts_disposed = contexts_disposed_; | 4549 heap_state.contexts_disposed = contexts_disposed_; |
4549 heap_state.contexts_disposal_rate = | 4550 heap_state.contexts_disposal_rate = |
4550 tracer()->ContextDisposalRateInMilliseconds(); | 4551 tracer()->ContextDisposalRateInMilliseconds(); |
(...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6487 static_cast<int>(object_sizes_last_time_[index])); | 6488 static_cast<int>(object_sizes_last_time_[index])); |
6488 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6489 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6489 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6490 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6490 | 6491 |
6491 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6492 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6492 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6493 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6493 ClearObjectStats(); | 6494 ClearObjectStats(); |
6494 } | 6495 } |
6495 } | 6496 } |
6496 } // namespace v8::internal | 6497 } // namespace v8::internal |
OLD | NEW |