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

Side by Side Diff: src/heap/heap.cc

Issue 892413006: Check that we're called on a valid heap during idle notifications (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | 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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698