This repository has been archived by the owner on Aug 27, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8261125: Move VM_Operation to vmOperation.hpp
Reviewed-by: coleenp, stuefe
- Loading branch information
Showing
23 changed files
with
204 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
/* | ||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
* | ||
*/ | ||
|
||
#ifndef SHARE_RUNTIME_VMOPERATION_HPP | ||
#define SHARE_RUNTIME_VMOPERATION_HPP | ||
|
||
#include "memory/allocation.hpp" | ||
|
||
// The following classes are used for operations | ||
// initiated by a Java thread but that must | ||
// take place in the VMThread. | ||
|
||
#define VM_OP_ENUM(type) VMOp_##type, | ||
|
||
// Note: When new VM_XXX comes up, add 'XXX' to the template table. | ||
#define VM_OPS_DO(template) \ | ||
template(None) \ | ||
template(Cleanup) \ | ||
template(ThreadDump) \ | ||
template(PrintThreads) \ | ||
template(FindDeadlocks) \ | ||
template(ClearICs) \ | ||
template(ForceSafepoint) \ | ||
template(ForceAsyncSafepoint) \ | ||
template(DeoptimizeFrame) \ | ||
template(DeoptimizeAll) \ | ||
template(ZombieAll) \ | ||
template(Verify) \ | ||
template(PrintJNI) \ | ||
template(HeapDumper) \ | ||
template(DeoptimizeTheWorld) \ | ||
template(CollectForMetadataAllocation) \ | ||
template(GC_HeapInspection) \ | ||
template(GenCollectFull) \ | ||
template(GenCollectFullConcurrent) \ | ||
template(GenCollectForAllocation) \ | ||
template(ParallelGCFailedAllocation) \ | ||
template(ParallelGCSystemGC) \ | ||
template(G1CollectForAllocation) \ | ||
template(G1CollectFull) \ | ||
template(G1Concurrent) \ | ||
template(G1TryInitiateConcMark) \ | ||
template(ZMarkStart) \ | ||
template(ZMarkEnd) \ | ||
template(ZRelocateStart) \ | ||
template(ZVerify) \ | ||
template(HandshakeOneThread) \ | ||
template(HandshakeAllThreads) \ | ||
template(HandshakeFallback) \ | ||
template(EnableBiasedLocking) \ | ||
template(BulkRevokeBias) \ | ||
template(PopulateDumpSharedSpace) \ | ||
template(JNIFunctionTableCopier) \ | ||
template(RedefineClasses) \ | ||
template(GetObjectMonitorUsage) \ | ||
template(GetAllStackTraces) \ | ||
template(GetThreadListStackTraces) \ | ||
template(ChangeBreakpoints) \ | ||
template(GetOrSetLocal) \ | ||
template(ChangeSingleStep) \ | ||
template(HeapWalkOperation) \ | ||
template(HeapIterateOperation) \ | ||
template(ReportJavaOutOfMemory) \ | ||
template(JFRCheckpoint) \ | ||
template(ShenandoahFullGC) \ | ||
template(ShenandoahInitMark) \ | ||
template(ShenandoahFinalMarkStartEvac) \ | ||
template(ShenandoahInitUpdateRefs) \ | ||
template(ShenandoahFinalUpdateRefs) \ | ||
template(ShenandoahDegeneratedGC) \ | ||
template(Exit) \ | ||
template(LinuxDllLoad) \ | ||
template(RotateGCLog) \ | ||
template(WhiteBoxOperation) \ | ||
template(JVMCIResizeCounters) \ | ||
template(ClassLoaderStatsOperation) \ | ||
template(ClassLoaderHierarchyOperation) \ | ||
template(DumpHashtable) \ | ||
template(DumpTouchedMethods) \ | ||
template(CleanClassLoaderDataMetaspaces) \ | ||
template(PrintCompileQueue) \ | ||
template(PrintClassHierarchy) \ | ||
template(ThreadSuspend) \ | ||
template(ThreadsSuspendJVMTI) \ | ||
template(ICBufferFull) \ | ||
template(ScavengeMonitors) \ | ||
template(PrintMetadata) \ | ||
template(GTestExecuteAtSafepoint) \ | ||
template(JFROldObject) \ | ||
template(JvmtiPostObjectFree) | ||
|
||
class Thread; | ||
class outputStream; | ||
|
||
class VM_Operation : public StackObj { | ||
public: | ||
enum VMOp_Type { | ||
VM_OPS_DO(VM_OP_ENUM) | ||
VMOp_Terminating | ||
}; | ||
|
||
private: | ||
Thread* _calling_thread; | ||
|
||
// The VM operation name array | ||
static const char* _names[]; | ||
|
||
public: | ||
VM_Operation() : _calling_thread(NULL) {} | ||
|
||
// VM operation support (used by VM thread) | ||
Thread* calling_thread() const { return _calling_thread; } | ||
void set_calling_thread(Thread* thread); | ||
|
||
// Called by VM thread - does in turn invoke doit(). Do not override this | ||
void evaluate(); | ||
|
||
// evaluate() is called by the VMThread and in turn calls doit(). | ||
// If the thread invoking VMThread::execute((VM_Operation*) is a JavaThread, | ||
// doit_prologue() is called in that thread before transferring control to | ||
// the VMThread. | ||
// If doit_prologue() returns true the VM operation will proceed, and | ||
// doit_epilogue() will be called by the JavaThread once the VM operation | ||
// completes. If doit_prologue() returns false the VM operation is cancelled. | ||
virtual void doit() = 0; | ||
virtual bool doit_prologue() { return true; }; | ||
virtual void doit_epilogue() {}; | ||
|
||
// Configuration. Override these appropriately in subclasses. | ||
virtual VMOp_Type type() const = 0; | ||
virtual bool allow_nested_vm_operations() const { return false; } | ||
|
||
// You may override skip_thread_oop_barriers to return true if the operation | ||
// does not access thread-private oops (including frames). | ||
virtual bool skip_thread_oop_barriers() const { return false; } | ||
|
||
// An operation can either be done inside a safepoint | ||
// or concurrently with Java threads running. | ||
virtual bool evaluate_at_safepoint() const { return true; } | ||
|
||
// Debugging | ||
virtual void print_on_error(outputStream* st) const; | ||
virtual const char* name() const { return _names[type()]; } | ||
static const char* name(int type) { | ||
assert(type >= 0 && type < VMOp_Terminating, "invalid VM operation type"); | ||
return _names[type]; | ||
} | ||
#ifndef PRODUCT | ||
void print_on(outputStream* st) const { print_on_error(st); } | ||
#endif | ||
}; | ||
|
||
#endif // SHARE_RUNTIME_VMOPERATION_HPP |
Oops, something went wrong.