[heap] Retire the twin brother of CollectGarbage.
BUG= Review-Url: https://codereview.chromium.org/2936713002 Cr-Commit-Position: refs/heads/master@{#45885}
This commit is contained in:
parent
d7ad99ffdc
commit
91fb26ec83
@ -672,15 +672,6 @@ void Heap::RemoveAllocationSitePretenuringFeedback(AllocationSite* site) {
|
|||||||
site, static_cast<uint32_t>(bit_cast<uintptr_t>(site)));
|
site, static_cast<uint32_t>(bit_cast<uintptr_t>(site)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Heap::CollectGarbage(AllocationSpace space,
|
|
||||||
GarbageCollectionReason gc_reason,
|
|
||||||
const v8::GCCallbackFlags callbackFlags) {
|
|
||||||
const char* collector_reason = NULL;
|
|
||||||
GarbageCollector collector = SelectGarbageCollector(space, &collector_reason);
|
|
||||||
return CollectGarbage(collector, gc_reason, collector_reason, callbackFlags);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Isolate* Heap::isolate() {
|
Isolate* Heap::isolate() {
|
||||||
return reinterpret_cast<Isolate*>(
|
return reinterpret_cast<Isolate*>(
|
||||||
reinterpret_cast<intptr_t>(this) -
|
reinterpret_cast<intptr_t>(this) -
|
||||||
|
@ -917,7 +917,7 @@ void Heap::CollectAllAvailableGarbage(GarbageCollectionReason gc_reason) {
|
|||||||
const int kMaxNumberOfAttempts = 7;
|
const int kMaxNumberOfAttempts = 7;
|
||||||
const int kMinNumberOfAttempts = 2;
|
const int kMinNumberOfAttempts = 2;
|
||||||
for (int attempt = 0; attempt < kMaxNumberOfAttempts; attempt++) {
|
for (int attempt = 0; attempt < kMaxNumberOfAttempts; attempt++) {
|
||||||
if (!CollectGarbage(MARK_COMPACTOR, gc_reason, NULL,
|
if (!CollectGarbage(OLD_SPACE, gc_reason,
|
||||||
v8::kGCCallbackFlagCollectAllAvailableGarbage) &&
|
v8::kGCCallbackFlagCollectAllAvailableGarbage) &&
|
||||||
attempt + 1 >= kMinNumberOfAttempts) {
|
attempt + 1 >= kMinNumberOfAttempts) {
|
||||||
break;
|
break;
|
||||||
@ -978,14 +978,16 @@ void Heap::EnsureFillerObjectAtTop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Heap::CollectGarbage(GarbageCollector collector,
|
bool Heap::CollectGarbage(AllocationSpace space,
|
||||||
GarbageCollectionReason gc_reason,
|
GarbageCollectionReason gc_reason,
|
||||||
const char* collector_reason,
|
|
||||||
const v8::GCCallbackFlags gc_callback_flags) {
|
const v8::GCCallbackFlags gc_callback_flags) {
|
||||||
// The VM is in the GC state until exiting this function.
|
// The VM is in the GC state until exiting this function.
|
||||||
VMState<GC> state(isolate());
|
VMState<GC> state(isolate());
|
||||||
RuntimeCallTimerScope runtime_timer(isolate(), &RuntimeCallStats::GC);
|
RuntimeCallTimerScope runtime_timer(isolate(), &RuntimeCallStats::GC);
|
||||||
|
|
||||||
|
const char* collector_reason = NULL;
|
||||||
|
GarbageCollector collector = SelectGarbageCollector(space, &collector_reason);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// Reset the allocation timeout to the GC interval, but make sure to
|
// Reset the allocation timeout to the GC interval, but make sure to
|
||||||
// allow at least a few allocations after a collection. The reason
|
// allow at least a few allocations after a collection. The reason
|
||||||
|
@ -1140,7 +1140,7 @@ class Heap {
|
|||||||
// Performs garbage collection operation.
|
// Performs garbage collection operation.
|
||||||
// Returns whether there is a chance that another major GC could
|
// Returns whether there is a chance that another major GC could
|
||||||
// collect more garbage.
|
// collect more garbage.
|
||||||
inline bool CollectGarbage(
|
bool CollectGarbage(
|
||||||
AllocationSpace space, GarbageCollectionReason gc_reason,
|
AllocationSpace space, GarbageCollectionReason gc_reason,
|
||||||
const GCCallbackFlags gc_callback_flags = kNoGCCallbackFlags);
|
const GCCallbackFlags gc_callback_flags = kNoGCCallbackFlags);
|
||||||
|
|
||||||
@ -1700,14 +1700,6 @@ class Heap {
|
|||||||
// over all objects. May cause a GC.
|
// over all objects. May cause a GC.
|
||||||
void MakeHeapIterable();
|
void MakeHeapIterable();
|
||||||
|
|
||||||
// Performs garbage collection operation.
|
|
||||||
// Returns whether there is a chance that another major GC could
|
|
||||||
// collect more garbage.
|
|
||||||
bool CollectGarbage(
|
|
||||||
GarbageCollector collector, GarbageCollectionReason gc_reason,
|
|
||||||
const char* collector_reason,
|
|
||||||
const GCCallbackFlags gc_callback_flags = kNoGCCallbackFlags);
|
|
||||||
|
|
||||||
// Performs garbage collection
|
// Performs garbage collection
|
||||||
// Returns whether there is a chance another major GC could
|
// Returns whether there is a chance another major GC could
|
||||||
// collect more garbage.
|
// collect more garbage.
|
||||||
|
Loading…
Reference in New Issue
Block a user