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/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 6611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6622 | 6622 |
6623 bool Isolate::IdleNotification(int idle_time_in_ms) { | 6623 bool Isolate::IdleNotification(int idle_time_in_ms) { |
6624 // Returning true tells the caller that it need not | 6624 // Returning true tells the caller that it need not |
6625 // continue to call IdleNotification. | 6625 // continue to call IdleNotification. |
6626 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 6626 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
6627 if (!i::FLAG_use_idle_notification) return true; | 6627 if (!i::FLAG_use_idle_notification) return true; |
6628 return isolate->heap()->IdleNotification(idle_time_in_ms); | 6628 return isolate->heap()->IdleNotification(idle_time_in_ms); |
6629 } | 6629 } |
6630 | 6630 |
6631 | 6631 |
6632 bool Isolate::IdleNotification(double deadline_in_seconds) { | |
6633 // Returning true tells the caller that it need not | |
6634 // continue to call IdleNotification. | |
6635 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | |
6636 if (!i::FLAG_use_idle_notification) return true; | |
6637 return isolate->heap()->IdleNotification(deadline_in_seconds); | |
rmcilroy
2014/11/25 14:28:06
you need to multiply by 1000 right? Could we just
Hannes Payer (out of office)
2014/11/25 16:01:36
I moved the conversion to the actual IdleNotificat
| |
6638 } | |
6639 | |
6640 | |
6632 void Isolate::LowMemoryNotification() { | 6641 void Isolate::LowMemoryNotification() { |
6633 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 6642 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
6634 { | 6643 { |
6635 i::HistogramTimerScope idle_notification_scope( | 6644 i::HistogramTimerScope idle_notification_scope( |
6636 isolate->counters()->gc_low_memory_notification()); | 6645 isolate->counters()->gc_low_memory_notification()); |
6637 isolate->heap()->CollectAllAvailableGarbage("low memory notification"); | 6646 isolate->heap()->CollectAllAvailableGarbage("low memory notification"); |
6638 } | 6647 } |
6639 } | 6648 } |
6640 | 6649 |
6641 | 6650 |
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7657 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7666 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7658 Address callback_address = | 7667 Address callback_address = |
7659 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7668 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7660 VMState<EXTERNAL> state(isolate); | 7669 VMState<EXTERNAL> state(isolate); |
7661 ExternalCallbackScope call_scope(isolate, callback_address); | 7670 ExternalCallbackScope call_scope(isolate, callback_address); |
7662 callback(info); | 7671 callback(info); |
7663 } | 7672 } |
7664 | 7673 |
7665 | 7674 |
7666 } } // namespace v8::internal | 7675 } } // namespace v8::internal |
OLD | NEW |