From b45c32cd4fb55fac4fc5161b9cd76415c69b203b Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Fri, 21 Feb 2025 19:09:38 +0000 Subject: [PATCH] 8350287: Cleanup SA's support for CodeBlob subclasses Reviewed-by: kvn, sspitsyn --- .../sun/jvm/hotspot/code/AdapterBlob.java | 56 -------------- .../sun/jvm/hotspot/code/BufferBlob.java | 52 ------------- .../sun/jvm/hotspot/code/CodeBlob.java | 77 ++++--------------- .../sun/jvm/hotspot/code/CodeCache.java | 7 -- .../jvm/hotspot/code/DeoptimizationBlob.java | 52 ------------- .../sun/jvm/hotspot/code/ExceptionBlob.java | 55 ------------- .../code/MethodHandlesAdapterBlob.java | 56 -------------- .../sun/jvm/hotspot/code/RuntimeBlob.java | 60 --------------- .../sun/jvm/hotspot/code/RuntimeStub.java | 64 --------------- .../sun/jvm/hotspot/code/SafepointBlob.java | 54 ------------- .../sun/jvm/hotspot/code/SingletonBlob.java | 52 ------------- .../jvm/hotspot/code/UncommonTrapBlob.java | 54 ------------- .../sun/jvm/hotspot/code/UpcallStub.java | 2 +- .../sun/jvm/hotspot/code/VtableBlob.java | 40 ---------- .../classes/sun/jvm/hotspot/tools/PStack.java | 22 +----- 15 files changed, 18 insertions(+), 685 deletions(-) delete mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/AdapterBlob.java delete mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/BufferBlob.java delete mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java delete mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java delete mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java delete mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/RuntimeBlob.java delete mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/RuntimeStub.java delete mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SafepointBlob.java delete mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SingletonBlob.java delete mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java delete mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/VtableBlob.java diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/AdapterBlob.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/AdapterBlob.java deleted file mode 100644 index 8fa69a2686c..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/AdapterBlob.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2011, 2025, 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. - * - */ - -package sun.jvm.hotspot.code; - -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.Observable; -import sun.jvm.hotspot.utilities.Observer; - -public class AdapterBlob extends RuntimeBlob { - static { - VM.registerVMInitializedObserver(new Observer() { - public void update(Observable o, Object data) { - initialize(VM.getVM().getTypeDataBase()); - } - }); - } - - private static void initialize(TypeDataBase db) { - // Type type = db.lookupType("AdapterBlob"); - - // // FIXME: add any needed fields - } - - public AdapterBlob(Address addr) { - super(addr); - } - - public String getName() { - return "AdapterBlob: " + super.getName(); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/BufferBlob.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/BufferBlob.java deleted file mode 100644 index 8f2ed2aa601..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/BufferBlob.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2000, 2025, 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. - * - */ - -package sun.jvm.hotspot.code; - -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.Observable; -import sun.jvm.hotspot.utilities.Observer; - -public class BufferBlob extends RuntimeBlob { - static { - VM.registerVMInitializedObserver(new Observer() { - public void update(Observable o, Object data) { - initialize(VM.getVM().getTypeDataBase()); - } - }); - } - - private static void initialize(TypeDataBase db) { - Type type = db.lookupType("BufferBlob"); - - // FIXME: add any needed fields - } - - public BufferBlob(Address addr) { - super(addr); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java index 326600d79f4..b401f3656f9 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java @@ -52,20 +52,12 @@ public class CodeBlob extends VMObject { private static CIntegerField dataOffsetField; private static CIntegerField frameSizeField; private static AddressField oopMapsField; + private static CIntegerField callerMustGCArgumentsField; - // Kinds of Codeblob + // Kinds of CodeBlobs that we need to know about. private static int NMethodKind; - private static int BufferKind; - private static int AdapterKind; - private static int VtableKind; - private static int MHAdapterKind; private static int RuntimeStubKind; - private static int DeoptimizationKind; - private static int ExceptionKind; - private static int SafepointKind; - private static int UncommonTrapKind; private static int UpcallKind; - private static int NumberOfKinds; private static Class[] wrapperClasses; @@ -89,6 +81,7 @@ public class CodeBlob extends VMObject { dataOffsetField = type.getCIntegerField("_data_offset"); frameSizeField = type.getCIntegerField("_frame_size"); oopMapsField = type.getAddressField("_oop_maps"); + callerMustGCArgumentsField = type.getCIntegerField("_caller_must_gc_arguments"); if (VM.getVM().isServerCompiler()) { matcherInterpreterFramePointerReg = @@ -96,38 +89,8 @@ public class CodeBlob extends VMObject { } NMethodKind = db.lookupIntConstant("CodeBlobKind::Nmethod").intValue(); - BufferKind = db.lookupIntConstant("CodeBlobKind::Buffer").intValue(); - AdapterKind = db.lookupIntConstant("CodeBlobKind::Adapter").intValue(); - VtableKind = db.lookupIntConstant("CodeBlobKind::Vtable").intValue(); - MHAdapterKind = db.lookupIntConstant("CodeBlobKind::MHAdapter").intValue(); RuntimeStubKind = db.lookupIntConstant("CodeBlobKind::RuntimeStub").intValue(); - DeoptimizationKind = db.lookupIntConstant("CodeBlobKind::Deoptimization").intValue(); - SafepointKind = db.lookupIntConstant("CodeBlobKind::Safepoint").intValue(); UpcallKind = db.lookupIntConstant("CodeBlobKind::Upcall").intValue(); - NumberOfKinds = db.lookupIntConstant("CodeBlobKind::Number_Of_Kinds").intValue(); - if (VM.getVM().isServerCompiler()) { - ExceptionKind = db.lookupIntConstant("CodeBlobKind::Exception").intValue(); - UncommonTrapKind = db.lookupIntConstant("CodeBlobKind::UncommonTrap").intValue(); - } else { - // Set invalid value to not match default. - ExceptionKind = NumberOfKinds + 1; - UncommonTrapKind = NumberOfKinds + 1; - } - - wrapperClasses = new Class[NumberOfKinds]; - wrapperClasses[NMethodKind] = NMethod.class; - wrapperClasses[BufferKind] = BufferBlob.class; - wrapperClasses[AdapterKind] = AdapterBlob.class; - wrapperClasses[VtableKind] = VtableBlob.class; - wrapperClasses[MHAdapterKind] = MethodHandlesAdapterBlob.class; - wrapperClasses[RuntimeStubKind] = RuntimeStub.class; - wrapperClasses[DeoptimizationKind] = DeoptimizationBlob.class; - wrapperClasses[SafepointKind] = SafepointBlob.class; - wrapperClasses[UpcallKind] = UpcallStub.class; - if (VM.getVM().isServerCompiler()) { - wrapperClasses[ExceptionKind] = ExceptionBlob.class; - wrapperClasses[UncommonTrapKind] = UncommonTrapBlob.class; - } } static { @@ -140,7 +103,16 @@ public class CodeBlob extends VMObject { public static Class getClassFor(Address addr) { CodeBlob cb = new CodeBlob(addr); - return wrapperClasses[cb.getKind()]; + int kind = cb.getKind(); + if (kind == NMethodKind) { + return NMethod.class; + } else if (kind == UpcallKind) { + return UpcallStub.class; + } else { + // All other CodeBlob kinds have no special functionality in SA and can be + // represented by the generic CodeBlob class. + return CodeBlob.class; + } } public Address headerBegin() { return getAddress(); } @@ -196,35 +168,16 @@ public class CodeBlob extends VMObject { // Typing - public boolean isBufferBlob() { return getKind() == BufferKind; } - public boolean isNMethod() { return getKind() == NMethodKind; } public boolean isRuntimeStub() { return getKind() == RuntimeStubKind; } public boolean isUpcallStub() { return getKind() == UpcallKind; } - public boolean isDeoptimizationBlob() { return getKind() == DeoptimizationKind; } - - public boolean isUncommonTrapBlob() { return getKind() == UncommonTrapKind; } - - public boolean isExceptionBlob() { return getKind() == ExceptionKind; } - - public boolean isSafepointBlob() { return getKind() == SafepointKind; } - - public boolean isAdapterBlob() { return getKind() == AdapterKind; } - - public boolean isMHAdapterBlob() { return getKind() == MHAdapterKind; } - - public boolean isVtableBlob() { return getKind() == VtableKind; } - - // Fine grain nmethod support: isNMethod() == isJavaMethod() || isNativeMethod() || isOSRMethod() public boolean isJavaMethod() { return false; } public boolean isNativeMethod() { return false; } - /** On-Stack Replacement method */ - public boolean isOSRMethod() { return false; } public NMethod asNMethodOrNull() { if (isNMethod()) return (NMethod)this; @@ -266,7 +219,9 @@ public class CodeBlob extends VMObject { } // Returns true, if the next frame is responsible for GC'ing oops passed as arguments - public boolean callerMustGCArguments() { return false; } + public boolean callerMustGCArguments() { + return callerMustGCArgumentsField.getValue(addr) != 0; + } public void print() { printOn(System.out); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeCache.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeCache.java index 73135a873e5..ff8b29ae12e 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeCache.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeCache.java @@ -96,13 +96,6 @@ public class CodeCache { // addr - address inside of a code blob public CodeBlob createCodeBlobWrapper(Address cbStart, Address addr) { Class cbClass = CodeBlob.getClassFor(cbStart); - if (cbClass == null) { - String message = "Couldn't deduce type of CodeBlob "; - message = message + "@" + cbStart + " "; - message = message + "for PC=" + addr; - - throw new RuntimeException(message); - } CodeBlob result = (CodeBlob) VMObjectFactory.newObject(cbClass, cbStart); if (Assert.ASSERTS_ENABLED) { // The pointer to the HeapBlock that contains this blob is outside of the blob, diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java deleted file mode 100644 index 51a5184ca85..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2000, 2025, 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. - * - */ - -package sun.jvm.hotspot.code; - -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.Observable; -import sun.jvm.hotspot.utilities.Observer; - -public class DeoptimizationBlob extends SingletonBlob { - static { - VM.registerVMInitializedObserver(new Observer() { - public void update(Observable o, Object data) { - initialize(VM.getVM().getTypeDataBase()); - } - }); - } - - private static void initialize(TypeDataBase db) { - Type type = db.lookupType("DeoptimizationBlob"); - - // FIXME: add any needed fields - } - - public DeoptimizationBlob(Address addr) { - super(addr); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java deleted file mode 100644 index 30025a41866..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2000, 2025, 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. - * - */ - -package sun.jvm.hotspot.code; - -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.Observable; -import sun.jvm.hotspot.utilities.Observer; - -/** ExceptionBlob: used for exception unwinding in compiled code - (currently only used by Compiler 2) */ - -public class ExceptionBlob extends SingletonBlob { - static { - VM.registerVMInitializedObserver(new Observer() { - public void update(Observable o, Object data) { - initialize(VM.getVM().getTypeDataBase()); - } - }); - } - - private static void initialize(TypeDataBase db) { - Type type = db.lookupType("ExceptionBlob"); - - // FIXME: add any needed fields - } - - public ExceptionBlob(Address addr) { - super(addr); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java deleted file mode 100644 index 53c9593d0b8..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2011, 2025, 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. - * - */ - -package sun.jvm.hotspot.code; - -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.Observable; -import sun.jvm.hotspot.utilities.Observer; - -public class MethodHandlesAdapterBlob extends AdapterBlob { - static { - VM.registerVMInitializedObserver(new Observer() { - public void update(Observable o, Object data) { - initialize(VM.getVM().getTypeDataBase()); - } - }); - } - - private static void initialize(TypeDataBase db) { - Type type = db.lookupType("MethodHandlesAdapterBlob"); - - // FIXME: add any needed fields - } - - public MethodHandlesAdapterBlob(Address addr) { - super(addr); - } - - public String getName() { - return "MethodHandlesAdapterBlob: " + super.getName(); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/RuntimeBlob.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/RuntimeBlob.java deleted file mode 100644 index d6f69d622b1..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/RuntimeBlob.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2016, 2020, 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. - * - */ - -package sun.jvm.hotspot.code; - -import java.util.*; - -import sun.jvm.hotspot.compiler.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; -import sun.jvm.hotspot.utilities.Observable; -import sun.jvm.hotspot.utilities.Observer; - -public class RuntimeBlob extends CodeBlob { - - // Only used by server compiler on x86; computed over in SA rather - // than relying on computation in target VM - private static final int NOT_YET_COMPUTED = -2; - private static final int UNDEFINED = -1; - private int linkOffset = NOT_YET_COMPUTED; - - static { - VM.registerVMInitializedObserver(new Observer() { - public void update(Observable o, Object data) { - initialize(VM.getVM().getTypeDataBase()); - } - }); - } - - private static void initialize(TypeDataBase db) { - Type type = db.lookupType("RuntimeBlob"); - } - - public RuntimeBlob(Address addr) { - super(addr); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/RuntimeStub.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/RuntimeStub.java deleted file mode 100644 index f51dcd76516..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/RuntimeStub.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2000, 2025, 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. - * - */ - -package sun.jvm.hotspot.code; - -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.Observable; -import sun.jvm.hotspot.utilities.Observer; - -public class RuntimeStub extends RuntimeBlob { - private static CIntegerField callerMustGCArgumentsField; - - static { - VM.registerVMInitializedObserver(new Observer() { - public void update(Observable o, Object data) { - initialize(VM.getVM().getTypeDataBase()); - } - }); - } - - private static void initialize(TypeDataBase db) { - Type type = db.lookupType("RuntimeStub"); - callerMustGCArgumentsField = type.getCIntegerField("_caller_must_gc_arguments"); - - // FIXME: add any needed fields - } - - public RuntimeStub(Address addr) { - super(addr); - } - - public boolean callerMustGCArguments() { - return callerMustGCArgumentsField.getValue(addr) != 0; - } - - - public String getName() { - return "RuntimeStub: " + super.getName(); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SafepointBlob.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SafepointBlob.java deleted file mode 100644 index 3f3ba79ff9f..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SafepointBlob.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2000, 2025, 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. - * - */ - -package sun.jvm.hotspot.code; - -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.Observable; -import sun.jvm.hotspot.utilities.Observer; - -/** SafepointBlob: handles illegal_instruction exceptions during a safepoint */ - -public class SafepointBlob extends SingletonBlob { - static { - VM.registerVMInitializedObserver(new Observer() { - public void update(Observable o, Object data) { - initialize(VM.getVM().getTypeDataBase()); - } - }); - } - - private static void initialize(TypeDataBase db) { - Type type = db.lookupType("SafepointBlob"); - - // FIXME: add any needed fields - } - - public SafepointBlob(Address addr) { - super(addr); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SingletonBlob.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SingletonBlob.java deleted file mode 100644 index 5a80b957e1d..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SingletonBlob.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2000, 2025, 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. - * - */ - -package sun.jvm.hotspot.code; - -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.Observable; -import sun.jvm.hotspot.utilities.Observer; - -public class SingletonBlob extends RuntimeBlob { - static { - VM.registerVMInitializedObserver(new Observer() { - public void update(Observable o, Object data) { - initialize(VM.getVM().getTypeDataBase()); - } - }); - } - - private static void initialize(TypeDataBase db) { - Type type = db.lookupType("SingletonBlob"); - - // FIXME: add any needed fields - } - - public SingletonBlob(Address addr) { - super(addr); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java deleted file mode 100644 index 077e49b5fe6..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2000, 2025, 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. - * - */ - -package sun.jvm.hotspot.code; - -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.Observable; -import sun.jvm.hotspot.utilities.Observer; - -/** UncommonTrapBlob (currently only used by Compiler 2) */ - -public class UncommonTrapBlob extends SingletonBlob { - static { - VM.registerVMInitializedObserver(new Observer() { - public void update(Observable o, Object data) { - initialize(VM.getVM().getTypeDataBase()); - } - }); - } - - private static void initialize(TypeDataBase db) { - Type type = db.lookupType("UncommonTrapBlob"); - - // FIXME: add any needed fields - } - - public UncommonTrapBlob(Address addr) { - super(addr); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/UpcallStub.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/UpcallStub.java index eeb5821bb60..360e047943b 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/UpcallStub.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/UpcallStub.java @@ -31,7 +31,7 @@ import sun.jvm.hotspot.types.*; import sun.jvm.hotspot.utilities.Observable; import sun.jvm.hotspot.utilities.Observer; -public class UpcallStub extends RuntimeBlob { +public class UpcallStub extends CodeBlob { private static CIntegerField frameDataOffsetField; private static AddressField lastJavaFPField; diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/VtableBlob.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/VtableBlob.java deleted file mode 100644 index a193d5ff340..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/VtableBlob.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, NTT DATA. - * 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. - * - */ - -package sun.jvm.hotspot.code; - -import sun.jvm.hotspot.debugger.Address; - -public class VtableBlob extends BufferBlob { - - public VtableBlob(Address addr) { - super(addr); - } - - public String getName() { - return "VtableBlob: " + super.getName(); - } - -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java index 945dd6bcc49..a0099b4c4de 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java @@ -160,28 +160,8 @@ public class PStack extends Tool { out.println(""); } } - } else if (cb.isBufferBlob()) { - out.println(""); - } else if (cb.isAdapterBlob()) { - out.println(""); - } else if (cb.isVtableBlob()) { - out.println(""); - } else if (cb.isMHAdapterBlob()) { - out.println(""); - } else if (cb.isRuntimeStub()) { - out.println(""); - } else if (cb.isUpcallStub()) { - out.println(""); - } else if (cb.isDeoptimizationBlob()) { - out.println(""); - } else if (cb.isUncommonTrapBlob()) { - out.println(""); - } else if (cb.isExceptionBlob()) { - out.println(""); - } else if (cb.isSafepointBlob()) { - out.println(""); } else { - out.println(""); + out.println("<" + cb.getName() + ">"); } } else { printUnknown(out);