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

Side by Side Diff: src/api.cc

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 | « include/v8.h ('k') | src/heap/heap.h » ('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 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 7639 matching lines...) Expand 10 before | Expand all | Expand 10 after
7650 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7650 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7651 return isolate->heap()->SetOptimizeForLatency(); 7651 return isolate->heap()->SetOptimizeForLatency();
7652 } 7652 }
7653 7653
7654 7654
7655 void Isolate::IsolateInBackgroundNotification() { 7655 void Isolate::IsolateInBackgroundNotification() {
7656 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7656 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7657 return isolate->heap()->SetOptimizeForMemoryUsage(); 7657 return isolate->heap()->SetOptimizeForMemoryUsage();
7658 } 7658 }
7659 7659
7660 void Isolate::MemoryPressureNotification(MemoryPressureLevel level) {
7661 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7662 return isolate->heap()->MemoryPressureNotification(level,
7663 Locker::IsLocked(this));
7664 }
7660 7665
7661 void Isolate::SetJitCodeEventHandler(JitCodeEventOptions options, 7666 void Isolate::SetJitCodeEventHandler(JitCodeEventOptions options,
7662 JitCodeEventHandler event_handler) { 7667 JitCodeEventHandler event_handler) {
7663 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7668 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7664 // Ensure that logging is initialized for our isolate. 7669 // Ensure that logging is initialized for our isolate.
7665 isolate->InitializeLoggingAndCounters(); 7670 isolate->InitializeLoggingAndCounters();
7666 isolate->logger()->SetCodeEventHandler(options, event_handler); 7671 isolate->logger()->SetCodeEventHandler(options, event_handler);
7667 } 7672 }
7668 7673
7669 7674
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
8756 Address callback_address = 8761 Address callback_address =
8757 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8762 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8758 VMState<EXTERNAL> state(isolate); 8763 VMState<EXTERNAL> state(isolate);
8759 ExternalCallbackScope call_scope(isolate, callback_address); 8764 ExternalCallbackScope call_scope(isolate, callback_address);
8760 callback(info); 8765 callback(info);
8761 } 8766 }
8762 8767
8763 8768
8764 } // namespace internal 8769 } // namespace internal
8765 } // namespace v8 8770 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698