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

Side by Side Diff: src/api.cc

Issue 2917853004: [heap] Activate memory reducer on external memory activity. (Closed)
Patch Set: check for memory_reducer_ Created 3 years, 6 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.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 #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 8124 matching lines...) Expand 10 before | Expand all | Expand 10 after
8135 return Utils::IntegerToLocal(result); 8135 return Utils::IntegerToLocal(result);
8136 } 8136 }
8137 8137
8138 8138
8139 void Isolate::ReportExternalAllocationLimitReached() { 8139 void Isolate::ReportExternalAllocationLimitReached() {
8140 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap(); 8140 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap();
8141 if (heap->gc_state() != i::Heap::NOT_IN_GC) return; 8141 if (heap->gc_state() != i::Heap::NOT_IN_GC) return;
8142 heap->ReportExternalMemoryPressure(); 8142 heap->ReportExternalMemoryPressure();
8143 } 8143 }
8144 8144
8145 void Isolate::CheckMemoryPressure() {
8146 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap();
8147 heap->CheckMemoryPressure();
8148 }
8145 8149
8146 HeapProfiler* Isolate::GetHeapProfiler() { 8150 HeapProfiler* Isolate::GetHeapProfiler() {
8147 i::HeapProfiler* heap_profiler = 8151 i::HeapProfiler* heap_profiler =
8148 reinterpret_cast<i::Isolate*>(this)->heap_profiler(); 8152 reinterpret_cast<i::Isolate*>(this)->heap_profiler();
8149 return reinterpret_cast<HeapProfiler*>(heap_profiler); 8153 return reinterpret_cast<HeapProfiler*>(heap_profiler);
8150 } 8154 }
8151 8155
8152 8156
8153 CpuProfiler* Isolate::GetCpuProfiler() { 8157 CpuProfiler* Isolate::GetCpuProfiler() {
8154 i::CpuProfiler* cpu_profiler = 8158 i::CpuProfiler* cpu_profiler =
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after
10501 Address callback_address = 10505 Address callback_address =
10502 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10506 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10503 VMState<EXTERNAL> state(isolate); 10507 VMState<EXTERNAL> state(isolate);
10504 ExternalCallbackScope call_scope(isolate, callback_address); 10508 ExternalCallbackScope call_scope(isolate, callback_address);
10505 callback(info); 10509 callback(info);
10506 } 10510 }
10507 10511
10508 10512
10509 } // namespace internal 10513 } // namespace internal
10510 } // namespace v8 10514 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698