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

Unified Diff: src/api.cc

Issue 1374203002: [heap] No leakage of incremental-marking.h outside of heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8.h ('k') | src/heap/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index d6727fab4b1ba1f0645601546bc6331f9b686c3d..c89a001e0740b4f62b934d8179da89b9d330861b 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -6818,32 +6818,11 @@ Local<Integer> v8::Integer::NewFromUnsigned(Isolate* isolate, uint32_t value) {
}
-void Isolate::CollectAllGarbage(const char* gc_reason) {
+void Isolate::ReportExternalAllocationLimitReached() {
i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap();
DCHECK_EQ(heap->gc_state(), i::Heap::NOT_IN_GC);
- if (heap->incremental_marking()->IsStopped()) {
- if (heap->incremental_marking()->CanBeActivated()) {
- heap->StartIncrementalMarking(
- i::Heap::kNoGCFlags,
- kGCCallbackFlagSynchronousPhantomCallbackProcessing, gc_reason);
- } else {
- heap->CollectAllGarbage(
- i::Heap::kNoGCFlags, gc_reason,
- kGCCallbackFlagSynchronousPhantomCallbackProcessing);
- }
- } else {
- // Incremental marking is turned on an has already been started.
-
- // TODO(mlippautz): Compute the time slice for incremental marking based on
- // memory pressure.
- double deadline = heap->MonotonicallyIncreasingTimeInMs() +
- i::FLAG_external_allocation_limit_incremental_time;
- heap->AdvanceIncrementalMarking(
- 0, deadline, i::IncrementalMarking::StepActions(
- i::IncrementalMarking::GC_VIA_STACK_GUARD,
- i::IncrementalMarking::FORCE_MARKING,
- i::IncrementalMarking::FORCE_COMPLETION));
- }
+ heap->ReportExternalMemoryPressure(
+ "external memory allocation limit reached.");
}
« 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