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

Side by Side Diff: src/api.cc

Issue 1378693002: [api] Avoid recursive GCs through reaching external allocation limit (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 2 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 6821 matching lines...) Expand 10 before | Expand all | Expand 10 after
6832 return Integer::New(isolate, static_cast<int32_t>(value)); 6832 return Integer::New(isolate, static_cast<int32_t>(value));
6833 } 6833 }
6834 ENTER_V8(internal_isolate); 6834 ENTER_V8(internal_isolate);
6835 i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value); 6835 i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value);
6836 return Utils::IntegerToLocal(result); 6836 return Utils::IntegerToLocal(result);
6837 } 6837 }
6838 6838
6839 6839
6840 void Isolate::ReportExternalAllocationLimitReached() { 6840 void Isolate::ReportExternalAllocationLimitReached() {
6841 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap(); 6841 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap();
6842 DCHECK_EQ(heap->gc_state(), i::Heap::NOT_IN_GC); 6842 if (heap->gc_state() != i::Heap::NOT_IN_GC) return;
6843 heap->ReportExternalMemoryPressure( 6843 heap->ReportExternalMemoryPressure(
6844 "external memory allocation limit reached."); 6844 "external memory allocation limit reached.");
6845 } 6845 }
6846 6846
6847 6847
6848 HeapProfiler* Isolate::GetHeapProfiler() { 6848 HeapProfiler* Isolate::GetHeapProfiler() {
6849 i::HeapProfiler* heap_profiler = 6849 i::HeapProfiler* heap_profiler =
6850 reinterpret_cast<i::Isolate*>(this)->heap_profiler(); 6850 reinterpret_cast<i::Isolate*>(this)->heap_profiler();
6851 return reinterpret_cast<HeapProfiler*>(heap_profiler); 6851 return reinterpret_cast<HeapProfiler*>(heap_profiler);
6852 } 6852 }
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after
8357 Address callback_address = 8357 Address callback_address =
8358 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8358 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8359 VMState<EXTERNAL> state(isolate); 8359 VMState<EXTERNAL> state(isolate);
8360 ExternalCallbackScope call_scope(isolate, callback_address); 8360 ExternalCallbackScope call_scope(isolate, callback_address);
8361 callback(info); 8361 callback(info);
8362 } 8362 }
8363 8363
8364 8364
8365 } // namespace internal 8365 } // namespace internal
8366 } // namespace v8 8366 } // 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