8357307: VM GC operations should have a public gc_succeeded()

Reviewed-by: ayang, iwalulya
This commit is contained in:
Thomas Schatzl 2025-05-28 15:49:34 +00:00
parent 4ced4e73fc
commit 2e6838a20d
5 changed files with 5 additions and 7 deletions

View File

@ -41,7 +41,6 @@ public:
VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
VMOp_Type type() const override { return VMOp_G1CollectFull; }
void doit() override;
bool gc_succeeded() const { return prologue_succeeded(); }
};
class VM_G1TryInitiateConcMark : public VM_GC_Operation {
@ -63,7 +62,7 @@ public:
bool cycle_already_in_progress() const { return _cycle_already_in_progress; }
bool whitebox_attached() const { return _whitebox_attached; }
bool terminating() const { return _terminating; }
bool gc_succeeded() const { return _gc_succeeded; }
bool gc_succeeded() const { return _gc_succeeded && VM_GC_Operation::gc_succeeded(); }
};
class VM_G1CollectForAllocation : public VM_CollectForAllocation {
@ -74,7 +73,6 @@ public:
GCCause::Cause gc_cause);
virtual VMOp_Type type() const { return VMOp_G1CollectForAllocation; }
virtual void doit();
bool gc_succeeded() const { return prologue_succeeded(); }
};
// Concurrent G1 stop-the-world operations such as remark and cleanup.

View File

@ -327,7 +327,7 @@ HeapWord* ParallelScavengeHeap::mem_allocate_work(size_t size,
// Did the VM operation execute? If so, return the result directly.
// This prevents us from looping until time out on requests that can
// not be satisfied.
if (op.prologue_succeeded()) {
if (op.gc_succeeded()) {
assert(is_in_or_null(op.result()), "result not in heap");
// Exit the loop if the gc time limit has been exceeded.

View File

@ -339,7 +339,7 @@ HeapWord* SerialHeap::mem_allocate_work(size_t size, bool is_tlab) {
VM_SerialCollectForAllocation op(size, is_tlab, gc_count_before);
VMThread::execute(&op);
if (op.prologue_succeeded()) {
if (op.gc_succeeded()) {
result = op.result();
assert(result == nullptr || is_in_reserved(result),

View File

@ -382,7 +382,7 @@ MetaWord* CollectedHeap::satisfy_failed_metadata_allocation(ClassLoaderData* loa
VMThread::execute(&op);
if (op.prologue_succeeded()) {
if (op.gc_succeeded()) {
return op.result();
}
loop_count++;

View File

@ -143,7 +143,7 @@ class VM_GC_Operation: public VM_GC_Sync_Operation {
virtual void doit_epilogue();
virtual bool allow_nested_vm_operations() const { return true; }
bool prologue_succeeded() const { return _prologue_succeeded; }
virtual bool gc_succeeded() const { return _prologue_succeeded; }
static void notify_gc_begin(bool full = false);
static void notify_gc_end();