From bec08c35cabde5c80422568a850cd457e7c1d66f Mon Sep 17 00:00:00 2001 From: "mike@belshe.com" Date: Fri, 2 Oct 2009 17:26:50 +0000 Subject: [PATCH] The error cases were returning false instead of true. So if the caller does something like: while(!IdleNotification()) it could spin forever if v8 were not initialized. I'd like to further remove the is_high_priority flag, because it is not in use. Mads - is there any reason not to remove it? git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3014 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/api.cc | 7 +++---- src/v8.cc | 6 ++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/api.cc b/src/api.cc index a69fc94..fd3d921 100644 --- a/src/api.cc +++ b/src/api.cc @@ -107,9 +107,6 @@ int i::Internals::kProxyType = PROXY_TYPE; static void DefaultFatalErrorHandler(const char* location, const char* message) { -#ifdef DEBUG - i::PrintF("Fatal Error: %s: %s\n", location, message); -#endif ENTER_V8; API_Fatal(location, message); } @@ -2606,7 +2603,9 @@ bool v8::V8::Dispose() { bool v8::V8::IdleNotification(bool is_high_priority) { - if (!i::V8::IsRunning()) return false; + // Returning true tells the caller that it need not + // continue to call IdleNotification. + if (!i::V8::IsRunning()) return true; return i::V8::IdleNotification(is_high_priority); } diff --git a/src/v8.cc b/src/v8.cc index f976536..f0115ec 100644 --- a/src/v8.cc +++ b/src/v8.cc @@ -170,9 +170,11 @@ uint32_t V8::Random() { bool V8::IdleNotification(bool is_high_priority) { - if (!FLAG_use_idle_notification) return false; + // Returning true tells the caller that there is no need to call + // IdleNotification again. + if (!FLAG_use_idle_notification) return true; // Ignore high priority instances of V8. - if (is_high_priority) return false; + if (is_high_priority) return true; // Tell the heap that it may want to adjust. return Heap::IdleNotification(); -- 2.7.4