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

Side by Side Diff: src/api.cc

Issue 750813003: Use deadline in IdleNotification. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 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 | « include/v8.h ('k') | src/heap/gc-idle-time-handler.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/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 6632 matching lines...) Expand 10 before | Expand all | Expand 10 after
6643 6643
6644 bool Isolate::IdleNotification(int idle_time_in_ms) { 6644 bool Isolate::IdleNotification(int idle_time_in_ms) {
6645 // Returning true tells the caller that it need not 6645 // Returning true tells the caller that it need not
6646 // continue to call IdleNotification. 6646 // continue to call IdleNotification.
6647 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 6647 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
6648 if (!i::FLAG_use_idle_notification) return true; 6648 if (!i::FLAG_use_idle_notification) return true;
6649 return isolate->heap()->IdleNotification(idle_time_in_ms); 6649 return isolate->heap()->IdleNotification(idle_time_in_ms);
6650 } 6650 }
6651 6651
6652 6652
6653 bool Isolate::IdleNotificationDeadline(double deadline_in_seconds) {
6654 // Returning true tells the caller that it need not
6655 // continue to call IdleNotification.
6656 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
6657 if (!i::FLAG_use_idle_notification) return true;
6658 return isolate->heap()->IdleNotification(deadline_in_seconds);
6659 }
6660
6661
6653 void Isolate::LowMemoryNotification() { 6662 void Isolate::LowMemoryNotification() {
6654 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 6663 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
6655 { 6664 {
6656 i::HistogramTimerScope idle_notification_scope( 6665 i::HistogramTimerScope idle_notification_scope(
6657 isolate->counters()->gc_low_memory_notification()); 6666 isolate->counters()->gc_low_memory_notification());
6658 isolate->heap()->CollectAllAvailableGarbage("low memory notification"); 6667 isolate->heap()->CollectAllAvailableGarbage("low memory notification");
6659 } 6668 }
6660 } 6669 }
6661 6670
6662 6671
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
7678 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7687 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7679 Address callback_address = 7688 Address callback_address =
7680 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7689 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7681 VMState<EXTERNAL> state(isolate); 7690 VMState<EXTERNAL> state(isolate);
7682 ExternalCallbackScope call_scope(isolate, callback_address); 7691 ExternalCallbackScope call_scope(isolate, callback_address);
7683 callback(info); 7692 callback(info);
7684 } 7693 }
7685 7694
7686 7695
7687 } } // namespace v8::internal 7696 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/heap/gc-idle-time-handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698