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

Side by Side Diff: include/v8.h

Issue 412163003: Move gc notifications from V8 to Isolate and make idle hint mandatory (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/api.cc » ('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 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 4441 matching lines...) Expand 10 before | Expand all | Expand 10 after
4452 4452
4453 /** 4453 /**
4454 * Enables the host application to provide a mechanism for recording 4454 * Enables the host application to provide a mechanism for recording
4455 * histograms. The CreateHistogram function returns a 4455 * histograms. The CreateHistogram function returns a
4456 * histogram which will later be passed to the AddHistogramSample 4456 * histogram which will later be passed to the AddHistogramSample
4457 * function. 4457 * function.
4458 */ 4458 */
4459 void SetCreateHistogramFunction(CreateHistogramCallback); 4459 void SetCreateHistogramFunction(CreateHistogramCallback);
4460 void SetAddHistogramSampleFunction(AddHistogramSampleCallback); 4460 void SetAddHistogramSampleFunction(AddHistogramSampleCallback);
4461 4461
4462 /**
4463 * Optional notification that the embedder is idle.
4464 * V8 uses the notification to reduce memory footprint.
4465 * This call can be used repeatedly if the embedder remains idle.
4466 * Returns true if the embedder should stop calling IdleNotification
4467 * until real work has been done. This indicates that V8 has done
4468 * as much cleanup as it will be able to do.
4469 *
4470 * The idle_time_in_ms argument specifies the time V8 has to do reduce
4471 * the memory footprint. There is no guarantee that the actual work will be
4472 * done within the time limit.
4473 */
4474 bool IdleNotification(int idle_time_in_ms);
4475
4476 /**
4477 * Optional notification that the system is running low on memory.
4478 * V8 uses these notifications to attempt to free memory.
4479 */
4480 void LowMemoryNotification();
4481
4482 /**
4483 * Optional notification that a context has been disposed. V8 uses
4484 * these notifications to guide the GC heuristic. Returns the number
4485 * of context disposals - including this one - since the last time
4486 * V8 had a chance to clean up.
4487 */
4488 int ContextDisposedNotification();
4489
4462 private: 4490 private:
4463 template<class K, class V, class Traits> friend class PersistentValueMap; 4491 template<class K, class V, class Traits> friend class PersistentValueMap;
4464 4492
4465 Isolate(); 4493 Isolate();
4466 Isolate(const Isolate&); 4494 Isolate(const Isolate&);
4467 ~Isolate(); 4495 ~Isolate();
4468 Isolate& operator=(const Isolate&); 4496 Isolate& operator=(const Isolate&);
4469 void* operator new(size_t size); 4497 void* operator new(size_t size);
4470 void operator delete(void*, size_t); 4498 void operator delete(void*, size_t);
4471 4499
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
4962 * Optional notification that the embedder is idle. 4990 * Optional notification that the embedder is idle.
4963 * V8 uses the notification to reduce memory footprint. 4991 * V8 uses the notification to reduce memory footprint.
4964 * This call can be used repeatedly if the embedder remains idle. 4992 * This call can be used repeatedly if the embedder remains idle.
4965 * Returns true if the embedder should stop calling IdleNotification 4993 * Returns true if the embedder should stop calling IdleNotification
4966 * until real work has been done. This indicates that V8 has done 4994 * until real work has been done. This indicates that V8 has done
4967 * as much cleanup as it will be able to do. 4995 * as much cleanup as it will be able to do.
4968 * 4996 *
4969 * The hint argument specifies the amount of work to be done in the function 4997 * The hint argument specifies the amount of work to be done in the function
4970 * on scale from 1 to 1000. There is no guarantee that the actual work will 4998 * on scale from 1 to 1000. There is no guarantee that the actual work will
4971 * match the hint. 4999 * match the hint.
5000 *
5001 * Deprecated, please use Isolate::IdleNotification.
4972 */ 5002 */
4973 static bool IdleNotification(int hint = 1000); 5003 static bool IdleNotification(int hint = 1000);
4974 5004
4975 /** 5005 /**
4976 * Optional notification that the system is running low on memory. 5006 * Optional notification that the system is running low on memory.
4977 * V8 uses these notifications to attempt to free memory. 5007 * V8 uses these notifications to attempt to free memory.
5008 *
5009 * Deprecated, please use Isolate::LowMemoryNotification.
4978 */ 5010 */
4979 static void LowMemoryNotification(); 5011 static void LowMemoryNotification();
4980 5012
4981 /** 5013 /**
4982 * Optional notification that a context has been disposed. V8 uses 5014 * Optional notification that a context has been disposed. V8 uses
4983 * these notifications to guide the GC heuristic. Returns the number 5015 * these notifications to guide the GC heuristic. Returns the number
4984 * of context disposals - including this one - since the last time 5016 * of context disposals - including this one - since the last time
4985 * V8 had a chance to clean up. 5017 * V8 had a chance to clean up.
5018 *
5019 * Deprecated, please use Isolate::ContextDisposedNotification.
4986 */ 5020 */
4987 static int ContextDisposedNotification(); 5021 static int ContextDisposedNotification();
4988 5022
4989 /** 5023 /**
4990 * Initialize the ICU library bundled with V8. The embedder should only 5024 * Initialize the ICU library bundled with V8. The embedder should only
4991 * invoke this method when using the bundled ICU. Returns true on success. 5025 * invoke this method when using the bundled ICU. Returns true on success.
4992 * 5026 *
4993 * If V8 was compiled with the ICU data in an external file, the location 5027 * If V8 was compiled with the ICU data in an external file, the location
4994 * of the data file has to be provided. 5028 * of the data file has to be provided.
4995 */ 5029 */
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
6728 */ 6762 */
6729 6763
6730 6764
6731 } // namespace v8 6765 } // namespace v8
6732 6766
6733 6767
6734 #undef TYPE_CHECK 6768 #undef TYPE_CHECK
6735 6769
6736 6770
6737 #endif // V8_H_ 6771 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698