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

Side by Side Diff: include/v8.h

Issue 1777883002: Add memory pressure interrupt for memory pressure notification Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 5857 matching lines...) Expand 10 before | Expand all | Expand 10 after
5868 * Request V8 to interrupt long running JavaScript code and invoke 5868 * Request V8 to interrupt long running JavaScript code and invoke
5869 * the given |callback| passing the given |data| to it. After |callback| 5869 * the given |callback| passing the given |data| to it. After |callback|
5870 * returns control will be returned to the JavaScript code. 5870 * returns control will be returned to the JavaScript code.
5871 * There may be a number of interrupt requests in flight. 5871 * There may be a number of interrupt requests in flight.
5872 * Can be called from another thread without acquiring a |Locker|. 5872 * Can be called from another thread without acquiring a |Locker|.
5873 * Registered |callback| must not reenter interrupted Isolate. 5873 * Registered |callback| must not reenter interrupted Isolate.
5874 */ 5874 */
5875 void RequestInterrupt(InterruptCallback callback, void* data); 5875 void RequestInterrupt(InterruptCallback callback, void* data);
5876 5876
5877 /** 5877 /**
5878 * Request V8 to interrupt long running JavaScript code and do GC,
5879 * when system memory is pressured.
5880 */
5881 void RequestMemoryPressureInterrupt();
jochen (gone - plz use gerrit) 2016/03/09 15:18:59 I'd prefer an API ReportMemoryPressure(level) wher
5882
5883 /**
5878 * Request garbage collection in this Isolate. It is only valid to call this 5884 * Request garbage collection in this Isolate. It is only valid to call this
5879 * function if --expose_gc was specified. 5885 * function if --expose_gc was specified.
5880 * 5886 *
5881 * This should only be used for testing purposes and not to enforce a garbage 5887 * This should only be used for testing purposes and not to enforce a garbage
5882 * collection schedule. It has strong negative impact on the garbage 5888 * collection schedule. It has strong negative impact on the garbage
5883 * collection performance. Use IdleNotificationDeadline() or 5889 * collection performance. Use IdleNotificationDeadline() or
5884 * LowMemoryNotification() instead to influence the garbage collection 5890 * LowMemoryNotification() instead to influence the garbage collection
5885 * schedule. 5891 * schedule.
5886 */ 5892 */
5887 void RequestGarbageCollectionForTesting(GarbageCollectionType type); 5893 void RequestGarbageCollectionForTesting(GarbageCollectionType type);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
6020 V8_DEPRECATED("use IdleNotificationDeadline()", 6026 V8_DEPRECATED("use IdleNotificationDeadline()",
6021 bool IdleNotification(int idle_time_in_ms)); 6027 bool IdleNotification(int idle_time_in_ms));
6022 6028
6023 /** 6029 /**
6024 * Optional notification that the system is running low on memory. 6030 * Optional notification that the system is running low on memory.
6025 * V8 uses these notifications to attempt to free memory. 6031 * V8 uses these notifications to attempt to free memory.
6026 */ 6032 */
6027 void LowMemoryNotification(); 6033 void LowMemoryNotification();
6028 6034
6029 /** 6035 /**
6036 * Optional notification that memory pressure interrupt is requested.
6037 * V8 uses these notifications to attempt to free memory.
6038 */
6039 void GCNotificationBasedOnMemoryPressureInterrupt();
jochen (gone - plz use gerrit) 2016/03/09 15:18:59 that shouldn't be required
6040
6041 /**
6030 * Optional notification that a context has been disposed. V8 uses 6042 * Optional notification that a context has been disposed. V8 uses
6031 * these notifications to guide the GC heuristic. Returns the number 6043 * these notifications to guide the GC heuristic. Returns the number
6032 * of context disposals - including this one - since the last time 6044 * of context disposals - including this one - since the last time
6033 * V8 had a chance to clean up. 6045 * V8 had a chance to clean up.
6034 * 6046 *
6035 * The optional parameter |dependant_context| specifies whether the disposed 6047 * The optional parameter |dependant_context| specifies whether the disposed
6036 * context was depending on state from other contexts or not. 6048 * context was depending on state from other contexts or not.
6037 */ 6049 */
6038 int ContextDisposedNotification(bool dependant_context = true); 6050 int ContextDisposedNotification(bool dependant_context = true);
6039 6051
(...skipping 2618 matching lines...) Expand 10 before | Expand all | Expand 10 after
8658 */ 8670 */
8659 8671
8660 8672
8661 } // namespace v8 8673 } // namespace v8
8662 8674
8663 8675
8664 #undef TYPE_CHECK 8676 #undef TYPE_CHECK
8665 8677
8666 8678
8667 #endif // INCLUDE_V8_H_ 8679 #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