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

Side by Side Diff: include/v8.h

Issue 1813963002: Add memory pressure notification API (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: GC interrupt on kModerate to start incremental marking Created 4 years, 9 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
« 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 5332 matching lines...) Expand 10 before | Expand all | Expand 10 after
5343 /** 5343 /**
5344 * Interface for iterating through all the persistent handles in the heap. 5344 * Interface for iterating through all the persistent handles in the heap.
5345 */ 5345 */
5346 class V8_EXPORT PersistentHandleVisitor { // NOLINT 5346 class V8_EXPORT PersistentHandleVisitor { // NOLINT
5347 public: 5347 public:
5348 virtual ~PersistentHandleVisitor() {} 5348 virtual ~PersistentHandleVisitor() {}
5349 virtual void VisitPersistentHandle(Persistent<Value>* value, 5349 virtual void VisitPersistentHandle(Persistent<Value>* value,
5350 uint16_t class_id) {} 5350 uint16_t class_id) {}
5351 }; 5351 };
5352 5352
5353 /**
5354 * Memory pressure level for the MemoryPressureNotification.
5355 * kNone hints V8 that there is no memory pressure.
5356 * kModerate hints V8 to speed up incremental garbage collection at the cost of
5357 * of higher latency due to garbage collection pauses.
5358 * kCritical hints V8 to free memory as soon as possible. Garbage collection
5359 * pauses at this level will be large.
5360 */
5361 enum class MemoryPressureLevel { kNone, kModerate, kCritical };
5353 5362
5354 /** 5363 /**
5355 * Isolate represents an isolated instance of the V8 engine. V8 isolates have 5364 * Isolate represents an isolated instance of the V8 engine. V8 isolates have
5356 * completely separate states. Objects from one isolate must not be used in 5365 * completely separate states. Objects from one isolate must not be used in
5357 * other isolates. The embedder can create multiple isolates and use them in 5366 * other isolates. The embedder can create multiple isolates and use them in
5358 * parallel in multiple threads. An isolate can be entered by at most one 5367 * parallel in multiple threads. An isolate can be entered by at most one
5359 * thread at any given time. The Locker/Unlocker API must be used to 5368 * thread at any given time. The Locker/Unlocker API must be used to
5360 * synchronize. 5369 * synchronize.
5361 */ 5370 */
5362 class V8_EXPORT Isolate { 5371 class V8_EXPORT Isolate {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
5584 * then V8 will abort if either: 5593 * then V8 will abort if either:
5585 * - no custom callback is set. 5594 * - no custom callback is set.
5586 * - the custom callback set returns true. 5595 * - the custom callback set returns true.
5587 * Otherwise, the custom callback will not be called and V8 will not abort. 5596 * Otherwise, the custom callback will not be called and V8 will not abort.
5588 */ 5597 */
5589 typedef bool (*AbortOnUncaughtExceptionCallback)(Isolate*); 5598 typedef bool (*AbortOnUncaughtExceptionCallback)(Isolate*);
5590 void SetAbortOnUncaughtExceptionCallback( 5599 void SetAbortOnUncaughtExceptionCallback(
5591 AbortOnUncaughtExceptionCallback callback); 5600 AbortOnUncaughtExceptionCallback callback);
5592 5601
5593 /** 5602 /**
5603 * Optional notification that the system is running low on memory.
5604 * V8 uses these notifications to guide heuristics.
5605 * It is allowed to call this function from another thread while
5606 * the isolate is executing long running JavaScript code.
5607 */
5608 void MemoryPressureNotification(MemoryPressureLevel level);
5609
5610 /**
5594 * Methods below this point require holding a lock (using Locker) in 5611 * Methods below this point require holding a lock (using Locker) in
5595 * a multi-threaded environment. 5612 * a multi-threaded environment.
5596 */ 5613 */
5597 5614
5598 /** 5615 /**
5599 * Sets this isolate as the entered one for the current thread. 5616 * Sets this isolate as the entered one for the current thread.
5600 * Saves the previously entered one (if any), so that it can be 5617 * Saves the previously entered one (if any), so that it can be
5601 * restored when exiting. Re-entering an isolate is allowed. 5618 * restored when exiting. Re-entering an isolate is allowed.
5602 */ 5619 */
5603 void Enter(); 5620 void Enter();
(...skipping 3066 matching lines...) Expand 10 before | Expand all | Expand 10 after
8670 */ 8687 */
8671 8688
8672 8689
8673 } // namespace v8 8690 } // namespace v8
8674 8691
8675 8692
8676 #undef TYPE_CHECK 8693 #undef TYPE_CHECK
8677 8694
8678 8695
8679 #endif // INCLUDE_V8_H_ 8696 #endif // INCLUDE_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