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

Side by Side Diff: src/api.cc

Issue 1271253002: [GC] Change behavior when reaching external allocation limit (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 6866 matching lines...) Expand 10 before | Expand all | Expand 10 after
6877 if (fits_into_int32_t) { 6877 if (fits_into_int32_t) {
6878 return Integer::New(isolate, static_cast<int32_t>(value)); 6878 return Integer::New(isolate, static_cast<int32_t>(value));
6879 } 6879 }
6880 ENTER_V8(internal_isolate); 6880 ENTER_V8(internal_isolate);
6881 i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value); 6881 i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value);
6882 return Utils::IntegerToLocal(result); 6882 return Utils::IntegerToLocal(result);
6883 } 6883 }
6884 6884
6885 6885
6886 void Isolate::CollectAllGarbage(const char* gc_reason) { 6886 void Isolate::CollectAllGarbage(const char* gc_reason) {
6887 reinterpret_cast<i::Isolate*>(this)->heap()->CollectAllGarbage( 6887 using IM = i::IncrementalMarking;
6888 i::Heap::kNoGCFlags, gc_reason, v8::kGCCallbackFlagForced); 6888 using Heap = i::Heap;
jochen (gone - plz use gerrit) 2015/08/05 12:22:27 please don't use using.
Michael Lippautz 2015/08/05 12:55:58 Done.
6889 double kIncrementalMarkingIntervalInMs = 3;
Michael Lippautz 2015/08/05 12:08:26 keep local?
jochen (gone - plz use gerrit) 2015/08/05 12:22:27 maybe make it a flag?
Hannes Payer (out of office) 2015/08/05 12:39:36 I would prefer 1 instead of 3. The smaller the bet
Michael Lippautz 2015/08/05 12:55:58 1ms it is. Works on N9. Agree that it would be b
Michael Lippautz 2015/08/05 12:55:58 Done.
6890
6891 Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap();
6892 if (heap->incremental_marking()->IsStopped()) {
6893 heap->StartIncrementalMarking(Heap::kNoGCFlags, kGCCallbackFlagForced,
6894 gc_reason);
6895 }
6896 double deadline =
6897 heap->MonotonicallyIncreasingTimeInMs() + kIncrementalMarkingIntervalInMs;
6898 heap->AdvanceIncrementalMarking(
6899 0, deadline, IM::StepActions(IM::GC_VIA_STACK_GUARD, IM::FORCE_MARKING,
6900 IM::FORCE_COMPLETION));
6889 } 6901 }
6890 6902
6891 6903
6892 HeapProfiler* Isolate::GetHeapProfiler() { 6904 HeapProfiler* Isolate::GetHeapProfiler() {
6893 i::HeapProfiler* heap_profiler = 6905 i::HeapProfiler* heap_profiler =
6894 reinterpret_cast<i::Isolate*>(this)->heap_profiler(); 6906 reinterpret_cast<i::Isolate*>(this)->heap_profiler();
6895 return reinterpret_cast<HeapProfiler*>(heap_profiler); 6907 return reinterpret_cast<HeapProfiler*>(heap_profiler);
6896 } 6908 }
6897 6909
6898 6910
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after
8403 Address callback_address = 8415 Address callback_address =
8404 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8416 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8405 VMState<EXTERNAL> state(isolate); 8417 VMState<EXTERNAL> state(isolate);
8406 ExternalCallbackScope call_scope(isolate, callback_address); 8418 ExternalCallbackScope call_scope(isolate, callback_address);
8407 callback(info); 8419 callback(info);
8408 } 8420 }
8409 8421
8410 8422
8411 } // namespace internal 8423 } // namespace internal
8412 } // namespace v8 8424 } // 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