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

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: 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') | src/api.cc » ('J')
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 5493 matching lines...) Expand 10 before | Expand all | Expand 10 after
5504 /** 5504 /**
5505 * Types of garbage collections that can be requested via 5505 * Types of garbage collections that can be requested via
5506 * RequestGarbageCollectionForTesting. 5506 * RequestGarbageCollectionForTesting.
5507 */ 5507 */
5508 enum GarbageCollectionType { 5508 enum GarbageCollectionType {
5509 kFullGarbageCollection, 5509 kFullGarbageCollection,
5510 kMinorGarbageCollection 5510 kMinorGarbageCollection
5511 }; 5511 };
5512 5512
5513 /** 5513 /**
5514 * Memory pressure level for the MemoryPressureNotification.
5515 * kNone hints V8 that there is no memory pressure.
5516 * kModerate hints V8 to speed up incremental garbage collection.
5517 * kCritical hints V8 to free memory as soon as possible.
5518 */
5519 enum class MemoryPressureLevel { kNone, kModerate, kCritical };
5520
5521 /**
5514 * Features reported via the SetUseCounterCallback callback. Do not change 5522 * Features reported via the SetUseCounterCallback callback. Do not change
5515 * assigned numbers of existing items; add new features to the end of this 5523 * assigned numbers of existing items; add new features to the end of this
5516 * list. 5524 * list.
5517 */ 5525 */
5518 enum UseCounterFeature { 5526 enum UseCounterFeature {
5519 kUseAsm = 0, 5527 kUseAsm = 0,
5520 kBreakIterator = 1, 5528 kBreakIterator = 1,
5521 kLegacyConst = 2, 5529 kLegacyConst = 2,
5522 kMarkDequeOverflow = 3, 5530 kMarkDequeOverflow = 3,
5523 kStoreBufferOverflow = 4, 5531 kStoreBufferOverflow = 4,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
5584 * then V8 will abort if either: 5592 * then V8 will abort if either:
5585 * - no custom callback is set. 5593 * - no custom callback is set.
5586 * - the custom callback set returns true. 5594 * - the custom callback set returns true.
5587 * Otherwise, the custom callback will not be called and V8 will not abort. 5595 * Otherwise, the custom callback will not be called and V8 will not abort.
5588 */ 5596 */
5589 typedef bool (*AbortOnUncaughtExceptionCallback)(Isolate*); 5597 typedef bool (*AbortOnUncaughtExceptionCallback)(Isolate*);
5590 void SetAbortOnUncaughtExceptionCallback( 5598 void SetAbortOnUncaughtExceptionCallback(
5591 AbortOnUncaughtExceptionCallback callback); 5599 AbortOnUncaughtExceptionCallback callback);
5592 5600
5593 /** 5601 /**
5602 * Optional notification that the system is running low on memory.
5603 * V8 uses these notifications to guide heuristics.
5604 * It is allowed to call this function from another thread while
5605 * the isolate is executing long running JavaScript code.
jochen (gone - plz use gerrit) 2016/03/17 19:33:39 do we expect the embedder to set the pressure leve
ulan 2016/03/18 12:49:40 That it nice to have, but we do not rely on that.
5606 */
5607 void MemoryPressureNotification(MemoryPressureLevel level);
5608
5609 /**
5594 * Methods below this point require holding a lock (using Locker) in 5610 * Methods below this point require holding a lock (using Locker) in
5595 * a multi-threaded environment. 5611 * a multi-threaded environment.
5596 */ 5612 */
5597 5613
5598 /** 5614 /**
5599 * Sets this isolate as the entered one for the current thread. 5615 * Sets this isolate as the entered one for the current thread.
5600 * Saves the previously entered one (if any), so that it can be 5616 * Saves the previously entered one (if any), so that it can be
5601 * restored when exiting. Re-entering an isolate is allowed. 5617 * restored when exiting. Re-entering an isolate is allowed.
5602 */ 5618 */
5603 void Enter(); 5619 void Enter();
(...skipping 3054 matching lines...) Expand 10 before | Expand all | Expand 10 after
8658 */ 8674 */
8659 8675
8660 8676
8661 } // namespace v8 8677 } // namespace v8
8662 8678
8663 8679
8664 #undef TYPE_CHECK 8680 #undef TYPE_CHECK
8665 8681
8666 8682
8667 #endif // INCLUDE_V8_H_ 8683 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698