Commit 850739bb authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

Revert "[heap] Add safepoints in Heap GC methods"

This reverts commit 1742d256.

Reason for revert: Longer safepoint can cause deadlocks with global handles.

Original change's description:
> [heap] Add safepoints in Heap GC methods
> 
> Add safepoints to GC methods in Heap. There is still stuff in
> Heap::CollectGarbage which might work better or more precise in a global
> safepoint. Be conservative here and move everything into the safepoint,
> eventually we can start to move code out that is fine to run outside
> the safepoint.
> 
> Bug: v8:10315
> Change-Id: I656dfd72f032eff6f386cec63a02777506650aa7
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2335192
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#69228}

TBR=ulan@chromium.org,dinfuehr@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: v8:10315
Change-Id: Idaf575911b34674c16d46b41c2ebee9f56dbac6d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2339617Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69261}
parent 0c918bd8
......@@ -1268,8 +1268,6 @@ TimedHistogram* Heap::GCTypeTimer(GarbageCollector collector) {
void Heap::CollectAllGarbage(int flags, GarbageCollectionReason gc_reason,
const v8::GCCallbackFlags gc_callback_flags) {
SafepointScope scope(this);
// Since we are ignoring the return value, the exact choice of space does
// not matter, so long as we do not specify NEW_SPACE, which would not
// cause a full GC.
......@@ -1339,8 +1337,6 @@ void ReportDuplicates(int size, std::vector<HeapObject>* objects) {
} // anonymous namespace
void Heap::CollectAllAvailableGarbage(GarbageCollectionReason gc_reason) {
SafepointScope scope(this);
// Since we are ignoring the return value, the exact choice of space does
// not matter, so long as we do not specify NEW_SPACE, which would not
// cause a full GC.
......@@ -1490,7 +1486,6 @@ Heap::DevToolsTraceEventScope::~DevToolsTraceEventScope() {
bool Heap::CollectGarbage(AllocationSpace space,
GarbageCollectionReason gc_reason,
const v8::GCCallbackFlags gc_callback_flags) {
SafepointScope scope(this);
const char* collector_reason = nullptr;
GarbageCollector collector = SelectGarbageCollector(space, &collector_reason);
is_current_gc_forced_ = gc_callback_flags & v8::kGCCallbackFlagForced ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment