Added idle notification to the API.

The implementation is still empty.

Review URL: http://codereview.chromium.org/165445

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2674 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
bak@chromium.org 2009-08-13 09:35:51 +00:00
parent d7474a61a8
commit 7f18bef0d2
4 changed files with 19 additions and 0 deletions

View File

@ -2201,6 +2201,14 @@ class V8EXPORT V8 {
*/
static bool Dispose();
/**
* Optional notification that the embedder is idle.
* V8 uses the notification to reduce memory footprint.
* \param is_high_priority tells whether the embedder is high priority.
*/
static void IdleNotification(bool is_high_priority);
private:
V8();

View File

@ -2558,6 +2558,10 @@ bool v8::V8::Dispose() {
}
void v8::V8::IdleNotification(bool is_high_priority) {
i::V8::IdleNotification(is_high_priority);
}
const char* v8::V8::GetVersion() {
static v8::internal::EmbeddedVector<char, 128> buffer;
v8::internal::Version::GetString(buffer);

View File

@ -156,6 +156,10 @@ uint32_t V8::Random() {
return (hi << 16) + (lo & 0xFFFF);
}
void V8::IdleNotification(bool is_high_priority) {
// todo(bak): Reduce memory footprint.
}
Smi* V8::RandomPositiveSmi() {
uint32_t random = Random();

View File

@ -99,6 +99,9 @@ class V8 : public AllStatic {
static uint32_t Random();
static Smi* RandomPositiveSmi();
// Idle notification directly from the API.
static void IdleNotification(bool is_high_priority);
private:
// True if engine is currently running
static bool is_running_;