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
This commit is contained in:
mike@belshe.com 2009-10-02 17:26:50 +00:00
parent 8925e8af0a
commit bec08c35ca
2 changed files with 7 additions and 6 deletions

View File

@ -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);
}

View File

@ -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();