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

Side by Side Diff: src/api.cc

Issue 2929463002: [heap] Guard against re-entering GC on external memory change. (Closed)
Patch Set: 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 | « no previous file | no next file » | 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 8132 matching lines...) Expand 10 before | Expand all | Expand 10 after
8143 8143
8144 8144
8145 void Isolate::ReportExternalAllocationLimitReached() { 8145 void Isolate::ReportExternalAllocationLimitReached() {
8146 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap(); 8146 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap();
8147 if (heap->gc_state() != i::Heap::NOT_IN_GC) return; 8147 if (heap->gc_state() != i::Heap::NOT_IN_GC) return;
8148 heap->ReportExternalMemoryPressure(); 8148 heap->ReportExternalMemoryPressure();
8149 } 8149 }
8150 8150
8151 void Isolate::CheckMemoryPressure() { 8151 void Isolate::CheckMemoryPressure() {
8152 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap(); 8152 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap();
8153 if (heap->gc_state() != i::Heap::NOT_IN_GC) return;
8153 heap->CheckMemoryPressure(); 8154 heap->CheckMemoryPressure();
8154 } 8155 }
8155 8156
8156 HeapProfiler* Isolate::GetHeapProfiler() { 8157 HeapProfiler* Isolate::GetHeapProfiler() {
8157 i::HeapProfiler* heap_profiler = 8158 i::HeapProfiler* heap_profiler =
8158 reinterpret_cast<i::Isolate*>(this)->heap_profiler(); 8159 reinterpret_cast<i::Isolate*>(this)->heap_profiler();
8159 return reinterpret_cast<HeapProfiler*>(heap_profiler); 8160 return reinterpret_cast<HeapProfiler*>(heap_profiler);
8160 } 8161 }
8161 8162
8162 8163
(...skipping 2348 matching lines...) Expand 10 before | Expand all | Expand 10 after
10511 Address callback_address = 10512 Address callback_address =
10512 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10513 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10513 VMState<EXTERNAL> state(isolate); 10514 VMState<EXTERNAL> state(isolate);
10514 ExternalCallbackScope call_scope(isolate, callback_address); 10515 ExternalCallbackScope call_scope(isolate, callback_address);
10515 callback(info); 10516 callback(info);
10516 } 10517 }
10517 10518
10518 10519
10519 } // namespace internal 10520 } // namespace internal
10520 } // namespace v8 10521 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698