6964458: Reimplement class meta-data storage to use native memory
authorcoleenp
Sat Sep 01 13:25:18 2012 -0400 (9 months ago)
changeset 3599da91efe96a93
parent 359836d1d483d5d6
child 360003049e0e8544
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
agent/doc/clhsdb.html
agent/src/os/bsd/ps_core.c
agent/src/os/linux/ps_core.c
agent/src/os/solaris/proc/saproc.cpp
agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java
agent/src/share/classes/sun/jvm/hotspot/HSDB.java
agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciArrayKlassKlass.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciBaseObject.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciInstanceKlassKlass.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciKlassKlass.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciMetadata.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodKlass.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlassKlass.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciObject.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciReceiverTypeData.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciSymbol.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciType.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciTypeArrayKlassKlass.java
agent/src/share/classes/sun/jvm/hotspot/ci/ciVirtualCallData.java
agent/src/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java
agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java
agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java
agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java
agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java
agent/src/share/classes/sun/jvm/hotspot/gc_implementation/parallelScavenge/PSPermGen.java
agent/src/share/classes/sun/jvm/hotspot/gc_implementation/parallelScavenge/ParallelScavengeHeap.java
agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java
agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java
agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java
agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java
agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithKlass.java
agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java
agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java
agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java
agent/src/share/classes/sun/jvm/hotspot/memory/CMSPermGen.java
agent/src/share/classes/sun/jvm/hotspot/memory/CMSPermGenGen.java
agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java
agent/src/share/classes/sun/jvm/hotspot/memory/CompactingPermGen.java
agent/src/share/classes/sun/jvm/hotspot/memory/CompactingPermGenGen.java
agent/src/share/classes/sun/jvm/hotspot/memory/ContigPermSpace.java
agent/src/share/classes/sun/jvm/hotspot/memory/Dictionary.java
agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java
agent/src/share/classes/sun/jvm/hotspot/memory/GenCollectedHeap.java
agent/src/share/classes/sun/jvm/hotspot/memory/Generation.java
agent/src/share/classes/sun/jvm/hotspot/memory/GenerationFactory.java
agent/src/share/classes/sun/jvm/hotspot/memory/PermGen.java
agent/src/share/classes/sun/jvm/hotspot/memory/PlaceholderEntry.java
agent/src/share/classes/sun/jvm/hotspot/memory/SharedHeap.java
agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java
agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java
agent/src/share/classes/sun/jvm/hotspot/oops/AccessFlags.java
agent/src/share/classes/sun/jvm/hotspot/oops/Array.java
agent/src/share/classes/sun/jvm/hotspot/oops/ArrayData.java
agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlassKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/BooleanField.java
agent/src/share/classes/sun/jvm/hotspot/oops/ByteField.java
agent/src/share/classes/sun/jvm/hotspot/oops/CIntField.java
agent/src/share/classes/sun/jvm/hotspot/oops/CharField.java
agent/src/share/classes/sun/jvm/hotspot/oops/CheckedExceptionElement.java
agent/src/share/classes/sun/jvm/hotspot/oops/CompiledICHolder.java
agent/src/share/classes/sun/jvm/hotspot/oops/CompiledICHolderKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java
agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethodKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java
agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java
agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java
agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/DataLayout.java
agent/src/share/classes/sun/jvm/hotspot/oops/DefaultMetadataVisitor.java
agent/src/share/classes/sun/jvm/hotspot/oops/DefaultOopVisitor.java
agent/src/share/classes/sun/jvm/hotspot/oops/DoubleField.java
agent/src/share/classes/sun/jvm/hotspot/oops/ExceptionTableElement.java
agent/src/share/classes/sun/jvm/hotspot/oops/Field.java
agent/src/share/classes/sun/jvm/hotspot/oops/FieldVisitor.java
agent/src/share/classes/sun/jvm/hotspot/oops/FloatField.java
agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java
agent/src/share/classes/sun/jvm/hotspot/oops/Instance.java
agent/src/share/classes/sun/jvm/hotspot/oops/InstanceClassLoaderKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlassKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/InstanceMirrorKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/InstanceRefKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/IntField.java
agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java
agent/src/share/classes/sun/jvm/hotspot/oops/KlassKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/LocalVariableTableElement.java
agent/src/share/classes/sun/jvm/hotspot/oops/LongField.java
agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java
agent/src/share/classes/sun/jvm/hotspot/oops/MetadataField.java
agent/src/share/classes/sun/jvm/hotspot/oops/MetadataVisitor.java
agent/src/share/classes/sun/jvm/hotspot/oops/Method.java
agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java
agent/src/share/classes/sun/jvm/hotspot/oops/MethodDataKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/MethodKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlassKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java
agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java
agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java
agent/src/share/classes/sun/jvm/hotspot/oops/OopField.java
agent/src/share/classes/sun/jvm/hotspot/oops/OopPrinter.java
agent/src/share/classes/sun/jvm/hotspot/oops/OopVisitor.java
agent/src/share/classes/sun/jvm/hotspot/oops/ProfileData.java
agent/src/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java
agent/src/share/classes/sun/jvm/hotspot/oops/ShortField.java
agent/src/share/classes/sun/jvm/hotspot/oops/TypeArray.java
agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlassKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java
agent/src/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java
agent/src/share/classes/sun/jvm/hotspot/opto/Compile.java
agent/src/share/classes/sun/jvm/hotspot/opto/InlineTree.java
agent/src/share/classes/sun/jvm/hotspot/opto/JVMState.java
agent/src/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java
agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java
agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java
agent/src/share/classes/sun/jvm/hotspot/runtime/JNIid.java
agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
agent/src/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java
agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualBaseConstructor.java
agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64Frame.java
agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java
agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java
agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java
agent/src/share/classes/sun/jvm/hotspot/tools/PermStat.java
agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java
agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java
agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java
agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java
agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/CodeViewerPanel.java
agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java
agent/src/share/classes/sun/jvm/hotspot/ui/tree/BadAddressTreeNodeAdapter.java
agent/src/share/classes/sun/jvm/hotspot/ui/tree/BadOopTreeNodeAdapter.java
agent/src/share/classes/sun/jvm/hotspot/ui/tree/CTypeTreeNodeAdapter.java
agent/src/share/classes/sun/jvm/hotspot/ui/tree/MetadataTreeNodeAdapter.java
agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java
agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java
agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java
agent/src/share/classes/sun/jvm/hotspot/utilities/GenericArray.java
agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java
agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java
agent/src/share/classes/sun/jvm/hotspot/utilities/IntArray.java
agent/src/share/classes/sun/jvm/hotspot/utilities/KlassArray.java
agent/src/share/classes/sun/jvm/hotspot/utilities/MethodArray.java
agent/src/share/classes/sun/jvm/hotspot/utilities/ObjectReader.java
agent/src/share/classes/sun/jvm/hotspot/utilities/PointerFinder.java
agent/src/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java
agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java
agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java
agent/src/share/classes/sun/jvm/hotspot/utilities/U1Array.java
agent/src/share/classes/sun/jvm/hotspot/utilities/U2Array.java
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactory.java
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactoryImpl.java
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFrame.java
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaMethod.java
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaScriptEngine.java
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSMetadata.java
agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
make/solaris/makefiles/fastdebug.make
make/solaris/makefiles/launcher.make
make/solaris/makefiles/mapfile-vers-COMPILER1
make/solaris/makefiles/mapfile-vers-COMPILER2
make/solaris/makefiles/mapfile-vers-TIERED
make/solaris/makefiles/product.make
make/solaris/makefiles/profiled.make
make/solaris/makefiles/reorder_COMPILER1_amd64
make/solaris/makefiles/reorder_COMPILER1_i486
make/solaris/makefiles/reorder_COMPILER1_sparc
make/solaris/makefiles/reorder_COMPILER1_sparcv9
make/solaris/makefiles/reorder_COMPILER2_amd64
make/solaris/makefiles/reorder_COMPILER2_i486
make/solaris/makefiles/reorder_COMPILER2_sparc
make/solaris/makefiles/reorder_COMPILER2_sparcv9
make/solaris/makefiles/reorder_CORE_i486
make/solaris/makefiles/reorder_CORE_sparc
make/solaris/makefiles/reorder_CORE_sparcv9
make/solaris/makefiles/reorder_TIERED_amd64
make/solaris/makefiles/reorder_TIERED_i486
make/solaris/makefiles/reorder_TIERED_sparc
make/solaris/makefiles/reorder_TIERED_sparcv9
make/solaris/makefiles/sparc.make
make/solaris/makefiles/sparcWorks.make
make/solaris/makefiles/vm.make
make/solaris/reorder.sh
make/windows/create_obj_files.sh
src/cpu/sparc/vm/assembler_sparc.cpp
src/cpu/sparc/vm/assembler_sparc.hpp
src/cpu/sparc/vm/assembler_sparc.inline.hpp
src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp
src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
src/cpu/sparc/vm/c1_globals_sparc.hpp
src/cpu/sparc/vm/c2_globals_sparc.hpp
src/cpu/sparc/vm/cppInterpreter_sparc.cpp
src/cpu/sparc/vm/debug_sparc.cpp
src/cpu/sparc/vm/dump_sparc.cpp
src/cpu/sparc/vm/frame_sparc.cpp
src/cpu/sparc/vm/frame_sparc.hpp
src/cpu/sparc/vm/frame_sparc.inline.hpp
src/cpu/sparc/vm/icBuffer_sparc.cpp
src/cpu/sparc/vm/interp_masm_sparc.cpp
src/cpu/sparc/vm/interp_masm_sparc.hpp
src/cpu/sparc/vm/interpreterRT_sparc.cpp
src/cpu/sparc/vm/interpreter_sparc.cpp
src/cpu/sparc/vm/metaspaceShared_sparc.cpp
src/cpu/sparc/vm/methodHandles_sparc.cpp
src/cpu/sparc/vm/methodHandles_sparc.hpp
src/cpu/sparc/vm/nativeInst_sparc.cpp
src/cpu/sparc/vm/nativeInst_sparc.hpp
src/cpu/sparc/vm/relocInfo_sparc.cpp
src/cpu/sparc/vm/sharedRuntime_sparc.cpp
src/cpu/sparc/vm/sparc.ad
src/cpu/sparc/vm/stubGenerator_sparc.cpp
src/cpu/sparc/vm/templateInterpreter_sparc.cpp
src/cpu/sparc/vm/templateTable_sparc.cpp
src/cpu/sparc/vm/templateTable_sparc.hpp
src/cpu/sparc/vm/vtableStubs_sparc.cpp
src/cpu/x86/vm/assembler_x86.cpp
src/cpu/x86/vm/assembler_x86.hpp
src/cpu/x86/vm/bytecodeInterpreter_x86.cpp
src/cpu/x86/vm/c1_CodeStubs_x86.cpp
src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
src/cpu/x86/vm/c1_MacroAssembler_x86.cpp
src/cpu/x86/vm/c1_Runtime1_x86.cpp
src/cpu/x86/vm/c1_globals_x86.hpp
src/cpu/x86/vm/c2_globals_x86.hpp
src/cpu/x86/vm/cppInterpreter_x86.cpp
src/cpu/x86/vm/dump_x86_32.cpp
src/cpu/x86/vm/dump_x86_64.cpp
src/cpu/x86/vm/frame_x86.cpp
src/cpu/x86/vm/frame_x86.hpp
src/cpu/x86/vm/frame_x86.inline.hpp
src/cpu/x86/vm/icBuffer_x86.cpp
src/cpu/x86/vm/interp_masm_x86_32.cpp
src/cpu/x86/vm/interp_masm_x86_32.hpp
src/cpu/x86/vm/interp_masm_x86_64.cpp
src/cpu/x86/vm/interp_masm_x86_64.hpp
src/cpu/x86/vm/interpreterRT_x86_32.cpp
src/cpu/x86/vm/interpreterRT_x86_64.cpp
src/cpu/x86/vm/interpreter_x86_32.cpp
src/cpu/x86/vm/interpreter_x86_64.cpp
src/cpu/x86/vm/metaspaceShared_x86_32.cpp
src/cpu/x86/vm/metaspaceShared_x86_64.cpp
src/cpu/x86/vm/methodHandles_x86.cpp
src/cpu/x86/vm/methodHandles_x86.hpp
src/cpu/x86/vm/relocInfo_x86.cpp
src/cpu/x86/vm/sharedRuntime_x86_32.cpp
src/cpu/x86/vm/sharedRuntime_x86_64.cpp
src/cpu/x86/vm/stubGenerator_x86_32.cpp
src/cpu/x86/vm/stubGenerator_x86_64.cpp
src/cpu/x86/vm/templateInterpreter_x86_32.cpp
src/cpu/x86/vm/templateInterpreter_x86_64.cpp
src/cpu/x86/vm/templateTable_x86_32.cpp
src/cpu/x86/vm/templateTable_x86_64.cpp
src/cpu/x86/vm/vtableStubs_x86_32.cpp
src/cpu/x86/vm/vtableStubs_x86_64.cpp
src/cpu/x86/vm/x86.ad
src/cpu/x86/vm/x86_32.ad
src/cpu/x86/vm/x86_64.ad
src/cpu/zero/vm/bytecodeInterpreter_zero.cpp
src/cpu/zero/vm/bytecodeInterpreter_zero.hpp
src/cpu/zero/vm/cppInterpreter_zero.cpp
src/cpu/zero/vm/cppInterpreter_zero.hpp
src/cpu/zero/vm/dump_zero.cpp
src/cpu/zero/vm/entry_zero.hpp
src/cpu/zero/vm/frame_zero.cpp
src/cpu/zero/vm/frame_zero.inline.hpp
src/cpu/zero/vm/icBuffer_zero.cpp
src/cpu/zero/vm/interp_masm_zero.cpp
src/cpu/zero/vm/interpreterFrame_zero.hpp
src/cpu/zero/vm/interpreterRT_zero.cpp
src/cpu/zero/vm/interpreter_zero.cpp
src/cpu/zero/vm/interpreter_zero.hpp
src/cpu/zero/vm/metaspaceShared_zero.cpp
src/cpu/zero/vm/sharedRuntime_zero.cpp
src/cpu/zero/vm/sharkFrame_zero.hpp
src/cpu/zero/vm/shark_globals_zero.hpp
src/cpu/zero/vm/stubGenerator_zero.cpp
src/cpu/zero/vm/templateInterpreter_zero.cpp
src/cpu/zero/vm/templateTable_zero.cpp
src/os/bsd/dtrace/generateJvmOffsets.cpp
src/os/bsd/dtrace/jhelper.d
src/os/bsd/dtrace/libjvm_db.c
src/os/solaris/dtrace/generateJvmOffsets.cpp
src/os/solaris/dtrace/jhelper.d
src/os/solaris/dtrace/libjvm_db.c
src/os/solaris/vm/dtraceJSDT_solaris.cpp
src/os/solaris/vm/os_solaris.cpp
src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp
src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp
src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp
src/os_cpu/linux_x86/vm/globals_linux_x86.hpp
src/os_cpu/linux_zero/vm/globals_linux_zero.hpp
src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp
src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp
src/os_cpu/windows_x86/vm/globals_windows_x86.hpp
src/share/tools/whitebox/sun/hotspot/WhiteBox.java
src/share/vm/adlc/formssel.cpp
src/share/vm/adlc/main.cpp
src/share/vm/adlc/output_c.cpp
src/share/vm/adlc/output_h.cpp
src/share/vm/asm/codeBuffer.cpp
src/share/vm/asm/codeBuffer.hpp
src/share/vm/c1/c1_CodeStubs.hpp
src/share/vm/c1/c1_GraphBuilder.cpp
src/share/vm/c1/c1_Instruction.cpp
src/share/vm/c1/c1_Instruction.hpp
src/share/vm/c1/c1_InstructionPrinter.cpp
src/share/vm/c1/c1_LIR.cpp
src/share/vm/c1/c1_LIR.hpp
src/share/vm/c1/c1_LIRAssembler.cpp
src/share/vm/c1/c1_LIRAssembler.hpp
src/share/vm/c1/c1_LIRGenerator.cpp
src/share/vm/c1/c1_LIRGenerator.hpp
src/share/vm/c1/c1_MacroAssembler.hpp
src/share/vm/c1/c1_Runtime1.cpp
src/share/vm/c1/c1_Runtime1.hpp
src/share/vm/c1/c1_ValueType.cpp
src/share/vm/c1/c1_ValueType.hpp
src/share/vm/c1/c1_globals.hpp
src/share/vm/ci/bcEscapeAnalyzer.cpp
src/share/vm/ci/bcEscapeAnalyzer.hpp
src/share/vm/ci/ciArrayKlass.cpp
src/share/vm/ci/ciArrayKlass.hpp
src/share/vm/ci/ciArrayKlassKlass.hpp
src/share/vm/ci/ciBaseObject.cpp
src/share/vm/ci/ciBaseObject.hpp
src/share/vm/ci/ciCPCache.cpp
src/share/vm/ci/ciCPCache.hpp
src/share/vm/ci/ciClassList.hpp
src/share/vm/ci/ciConstantPoolCache.hpp
src/share/vm/ci/ciEnv.cpp
src/share/vm/ci/ciEnv.hpp
src/share/vm/ci/ciField.cpp
src/share/vm/ci/ciInstance.cpp
src/share/vm/ci/ciInstanceKlass.cpp
src/share/vm/ci/ciInstanceKlass.hpp
src/share/vm/ci/ciInstanceKlassKlass.cpp
src/share/vm/ci/ciInstanceKlassKlass.hpp
src/share/vm/ci/ciKlass.cpp
src/share/vm/ci/ciKlass.hpp
src/share/vm/ci/ciKlassKlass.cpp
src/share/vm/ci/ciKlassKlass.hpp
src/share/vm/ci/ciMemberName.cpp
src/share/vm/ci/ciMetadata.cpp
src/share/vm/ci/ciMetadata.hpp
src/share/vm/ci/ciMethod.cpp
src/share/vm/ci/ciMethod.hpp
src/share/vm/ci/ciMethodData.cpp
src/share/vm/ci/ciMethodData.hpp
src/share/vm/ci/ciMethodHandle.cpp
src/share/vm/ci/ciMethodKlass.cpp
src/share/vm/ci/ciMethodKlass.hpp
src/share/vm/ci/ciObjArrayKlass.cpp
src/share/vm/ci/ciObjArrayKlass.hpp
src/share/vm/ci/ciObjArrayKlassKlass.cpp
src/share/vm/ci/ciObjArrayKlassKlass.hpp
src/share/vm/ci/ciObject.cpp
src/share/vm/ci/ciObject.hpp
src/share/vm/ci/ciObjectFactory.cpp
src/share/vm/ci/ciObjectFactory.hpp
src/share/vm/ci/ciStreams.cpp
src/share/vm/ci/ciStreams.hpp
src/share/vm/ci/ciSymbol.hpp
src/share/vm/ci/ciType.cpp
src/share/vm/ci/ciType.hpp
src/share/vm/ci/ciTypeArrayKlass.cpp
src/share/vm/ci/ciTypeArrayKlass.hpp
src/share/vm/ci/ciTypeArrayKlassKlass.cpp
src/share/vm/ci/ciTypeArrayKlassKlass.hpp
src/share/vm/ci/ciTypeFlow.cpp
src/share/vm/ci/compilerInterface.hpp
src/share/vm/classfile/altHashing.cpp
src/share/vm/classfile/classFileParser.cpp
src/share/vm/classfile/classFileParser.hpp
src/share/vm/classfile/classLoader.cpp
src/share/vm/classfile/classLoaderData.cpp
src/share/vm/classfile/classLoaderData.hpp
src/share/vm/classfile/classLoaderData.inline.hpp
src/share/vm/classfile/dictionary.cpp
src/share/vm/classfile/dictionary.hpp
src/share/vm/classfile/javaAssertions.cpp
src/share/vm/classfile/javaClasses.cpp
src/share/vm/classfile/javaClasses.hpp
src/share/vm/classfile/loaderConstraints.cpp
src/share/vm/classfile/loaderConstraints.hpp
src/share/vm/classfile/placeholders.cpp
src/share/vm/classfile/placeholders.hpp
src/share/vm/classfile/resolutionErrors.cpp
src/share/vm/classfile/resolutionErrors.hpp
src/share/vm/classfile/stackMapFrame.hpp
src/share/vm/classfile/stackMapTable.hpp
src/share/vm/classfile/symbolTable.cpp
src/share/vm/classfile/symbolTable.hpp
src/share/vm/classfile/systemDictionary.cpp
src/share/vm/classfile/systemDictionary.hpp
src/share/vm/classfile/verificationType.cpp
src/share/vm/classfile/verifier.cpp
src/share/vm/classfile/verifier.hpp
src/share/vm/classfile/vmSymbols.cpp
src/share/vm/classfile/vmSymbols.hpp
src/share/vm/code/codeBlob.cpp
src/share/vm/code/codeBlob.hpp
src/share/vm/code/codeCache.cpp
src/share/vm/code/codeCache.hpp
src/share/vm/code/compiledIC.cpp
src/share/vm/code/compiledIC.hpp
src/share/vm/code/debugInfo.cpp
src/share/vm/code/debugInfo.hpp
src/share/vm/code/debugInfoRec.cpp
src/share/vm/code/debugInfoRec.hpp
src/share/vm/code/dependencies.cpp
src/share/vm/code/dependencies.hpp
src/share/vm/code/exceptionHandlerTable.hpp
src/share/vm/code/icBuffer.cpp
src/share/vm/code/icBuffer.hpp
src/share/vm/code/nmethod.cpp
src/share/vm/code/nmethod.hpp
src/share/vm/code/oopRecorder.cpp
src/share/vm/code/oopRecorder.hpp
src/share/vm/code/relocInfo.cpp
src/share/vm/code/relocInfo.hpp
src/share/vm/code/scopeDesc.cpp
src/share/vm/code/scopeDesc.hpp
src/share/vm/code/vtableStubs.cpp
src/share/vm/code/vtableStubs.hpp
src/share/vm/compiler/compileBroker.cpp
src/share/vm/compiler/compileBroker.hpp
src/share/vm/compiler/compileLog.cpp
src/share/vm/compiler/compileLog.hpp
src/share/vm/compiler/compilerOracle.cpp
src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp
src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp
src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp
src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.cpp
src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.hpp
src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp
src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp
src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.hpp
src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp
src/share/vm/gc_implementation/g1/concurrentMark.cpp
src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp
src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp
src/share/vm/gc_implementation/g1/g1OopClosures.hpp
src/share/vm/gc_implementation/g1/g1RemSet.cpp
src/share/vm/gc_implementation/g1/g1RemSet.hpp
src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp
src/share/vm/gc_implementation/g1/heapRegion.cpp
src/share/vm/gc_implementation/g1/heapRegion.hpp
src/share/vm/gc_implementation/g1/satbQueue.cpp
src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
src/share/vm/gc_implementation/parNew/parOopClosures.hpp
src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp
src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp
src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp
src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp
src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp
src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp
src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp
src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp
src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp
src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp
src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp
src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp
src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.hpp
src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp
src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp
src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp
src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp
src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp
src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp
src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp
src/share/vm/gc_implementation/parallelScavenge/psPermGen.hpp
src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp
src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp
src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp
src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp
src/share/vm/gc_implementation/parallelScavenge/psYoungGen.hpp
src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp
src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp
src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp
src/share/vm/gc_implementation/shared/cSpaceCounters.cpp
src/share/vm/gc_implementation/shared/cSpaceCounters.hpp
src/share/vm/gc_implementation/shared/concurrentGCThread.cpp
src/share/vm/gc_implementation/shared/immutableSpace.cpp
src/share/vm/gc_implementation/shared/immutableSpace.hpp
src/share/vm/gc_implementation/shared/markSweep.cpp
src/share/vm/gc_implementation/shared/markSweep.hpp
src/share/vm/gc_implementation/shared/markSweep.inline.hpp
src/share/vm/gc_implementation/shared/mutableSpace.cpp
src/share/vm/gc_implementation/shared/mutableSpace.hpp
src/share/vm/gc_implementation/shared/vmGCOperations.cpp
src/share/vm/gc_implementation/shared/vmGCOperations.hpp
src/share/vm/gc_interface/collectedHeap.cpp
src/share/vm/gc_interface/collectedHeap.hpp
src/share/vm/gc_interface/collectedHeap.inline.hpp
src/share/vm/gc_interface/gcCause.cpp
src/share/vm/gc_interface/gcCause.hpp
src/share/vm/interpreter/abstractInterpreter.hpp
src/share/vm/interpreter/bytecode.cpp
src/share/vm/interpreter/bytecode.hpp
src/share/vm/interpreter/bytecodeInterpreter.cpp
src/share/vm/interpreter/bytecodeInterpreter.hpp
src/share/vm/interpreter/bytecodeStream.hpp
src/share/vm/interpreter/bytecodeTracer.cpp
src/share/vm/interpreter/bytecodes.cpp
src/share/vm/interpreter/bytecodes.hpp
src/share/vm/interpreter/interpreter.cpp
src/share/vm/interpreter/interpreterRuntime.cpp
src/share/vm/interpreter/interpreterRuntime.hpp
src/share/vm/interpreter/linkResolver.cpp
src/share/vm/interpreter/linkResolver.hpp
src/share/vm/interpreter/oopMapCache.cpp
src/share/vm/interpreter/oopMapCache.hpp
src/share/vm/interpreter/rewriter.cpp
src/share/vm/interpreter/rewriter.hpp
src/share/vm/interpreter/templateInterpreter.cpp
src/share/vm/interpreter/templateInterpreter.hpp
src/share/vm/interpreter/templateTable.cpp
src/share/vm/interpreter/templateTable.hpp
src/share/vm/memory/allocation.cpp
src/share/vm/memory/allocation.hpp
src/share/vm/memory/barrierSet.hpp
src/share/vm/memory/binaryTreeDictionary.hpp
src/share/vm/memory/blockOffsetTable.cpp
src/share/vm/memory/blockOffsetTable.hpp
src/share/vm/memory/blockOffsetTable.inline.hpp
src/share/vm/memory/cardTableModRefBS.hpp
src/share/vm/memory/cardTableRS.cpp
src/share/vm/memory/cardTableRS.hpp
src/share/vm/memory/classify.cpp
src/share/vm/memory/classify.hpp
src/share/vm/memory/collectorPolicy.cpp
src/share/vm/memory/collectorPolicy.hpp
src/share/vm/memory/compactPermGen.hpp
src/share/vm/memory/compactingPermGenGen.cpp
src/share/vm/memory/compactingPermGenGen.hpp
src/share/vm/memory/defNewGeneration.cpp
src/share/vm/memory/defNewGeneration.hpp
src/share/vm/memory/dump.cpp
src/share/vm/memory/filemap.cpp
src/share/vm/memory/filemap.hpp
src/share/vm/memory/freeBlockDictionary.hpp
src/share/vm/memory/genCollectedHeap.cpp
src/share/vm/memory/genCollectedHeap.hpp
src/share/vm/memory/genMarkSweep.cpp
src/share/vm/memory/genOopClosures.hpp
src/share/vm/memory/genOopClosures.inline.hpp
src/share/vm/memory/genRemSet.cpp
src/share/vm/memory/genRemSet.hpp
src/share/vm/memory/generation.cpp
src/share/vm/memory/generation.hpp
src/share/vm/memory/generationSpec.cpp
src/share/vm/memory/generationSpec.hpp
src/share/vm/memory/heapInspection.cpp
src/share/vm/memory/heapInspection.hpp
src/share/vm/memory/iterator.cpp
src/share/vm/memory/iterator.hpp
src/share/vm/memory/memRegion.hpp
src/share/vm/memory/metadataFactory.hpp
src/share/vm/memory/metaspace.cpp
src/share/vm/memory/metaspace.hpp
src/share/vm/memory/metaspaceCounters.cpp
src/share/vm/memory/metaspaceCounters.hpp
src/share/vm/memory/metaspaceShared.cpp
src/share/vm/memory/metaspaceShared.hpp
src/share/vm/memory/modRefBarrierSet.hpp
src/share/vm/memory/oopFactory.cpp
src/share/vm/memory/oopFactory.hpp
src/share/vm/memory/permGen.cpp
src/share/vm/memory/permGen.hpp
src/share/vm/memory/referenceProcessor.cpp
src/share/vm/memory/referenceProcessor.hpp
src/share/vm/memory/restore.cpp
src/share/vm/memory/serialize.cpp
src/share/vm/memory/sharedHeap.cpp
src/share/vm/memory/sharedHeap.hpp
src/share/vm/memory/space.cpp
src/share/vm/memory/space.hpp
src/share/vm/memory/specialized_oop_closures.hpp
src/share/vm/memory/universe.cpp
src/share/vm/memory/universe.hpp
src/share/vm/oops/annotations.cpp
src/share/vm/oops/annotations.hpp
src/share/vm/oops/arrayKlass.cpp
src/share/vm/oops/arrayKlass.hpp
src/share/vm/oops/arrayKlassKlass.cpp
src/share/vm/oops/arrayKlassKlass.hpp
src/share/vm/oops/arrayOop.hpp
src/share/vm/oops/compiledICHolder.cpp
src/share/vm/oops/compiledICHolder.hpp
src/share/vm/oops/compiledICHolderKlass.cpp
src/share/vm/oops/compiledICHolderKlass.hpp
src/share/vm/oops/compiledICHolderOop.cpp
src/share/vm/oops/compiledICHolderOop.hpp
src/share/vm/oops/constMethod.cpp
src/share/vm/oops/constMethod.hpp
src/share/vm/oops/constMethodKlass.cpp
src/share/vm/oops/constMethodKlass.hpp
src/share/vm/oops/constMethodOop.cpp
src/share/vm/oops/constMethodOop.hpp
src/share/vm/oops/constantPool.cpp
src/share/vm/oops/constantPool.hpp
src/share/vm/oops/constantPoolKlass.cpp
src/share/vm/oops/constantPoolKlass.hpp
src/share/vm/oops/constantPoolOop.cpp
src/share/vm/oops/constantPoolOop.hpp
src/share/vm/oops/cpCache.cpp
src/share/vm/oops/cpCache.hpp
src/share/vm/oops/cpCacheKlass.cpp
src/share/vm/oops/cpCacheKlass.hpp
src/share/vm/oops/cpCacheOop.cpp
src/share/vm/oops/cpCacheOop.hpp
src/share/vm/oops/fieldInfo.hpp
src/share/vm/oops/fieldStreams.hpp
src/share/vm/oops/generateOopMap.cpp
src/share/vm/oops/generateOopMap.hpp
src/share/vm/oops/instanceClassLoaderKlass.cpp
src/share/vm/oops/instanceClassLoaderKlass.hpp
src/share/vm/oops/instanceKlass.cpp
src/share/vm/oops/instanceKlass.hpp
src/share/vm/oops/instanceKlassKlass.cpp
src/share/vm/oops/instanceKlassKlass.hpp
src/share/vm/oops/instanceMirrorKlass.cpp
src/share/vm/oops/instanceMirrorKlass.hpp
src/share/vm/oops/instanceOop.hpp
src/share/vm/oops/instanceRefKlass.cpp
src/share/vm/oops/instanceRefKlass.hpp
src/share/vm/oops/klass.cpp
src/share/vm/oops/klass.hpp
src/share/vm/oops/klassKlass.cpp
src/share/vm/oops/klassKlass.hpp
src/share/vm/oops/klassOop.cpp
src/share/vm/oops/klassOop.hpp
src/share/vm/oops/klassVtable.cpp
src/share/vm/oops/klassVtable.hpp
src/share/vm/oops/markOop.cpp
src/share/vm/oops/markOop.hpp
src/share/vm/oops/markOop.inline.hpp
src/share/vm/oops/metadata.cpp
src/share/vm/oops/metadata.hpp
src/share/vm/oops/method.cpp
src/share/vm/oops/method.hpp
src/share/vm/oops/methodData.cpp
src/share/vm/oops/methodData.hpp
src/share/vm/oops/methodDataKlass.cpp
src/share/vm/oops/methodDataKlass.hpp
src/share/vm/oops/methodDataOop.cpp
src/share/vm/oops/methodDataOop.hpp
src/share/vm/oops/methodKlass.cpp
src/share/vm/oops/methodKlass.hpp
src/share/vm/oops/methodOop.cpp
src/share/vm/oops/methodOop.hpp
src/share/vm/oops/objArrayKlass.cpp
src/share/vm/oops/objArrayKlass.hpp
src/share/vm/oops/objArrayKlass.inline.hpp
src/share/vm/oops/objArrayKlassKlass.cpp
src/share/vm/oops/objArrayKlassKlass.hpp
src/share/vm/oops/objArrayOop.cpp
src/share/vm/oops/oop.cpp
src/share/vm/oops/oop.hpp
src/share/vm/oops/oop.inline.hpp
src/share/vm/oops/oop.inline2.hpp
src/share/vm/oops/oop.pcgc.inline.hpp
src/share/vm/oops/oop.psgc.inline.hpp
src/share/vm/oops/oopsHierarchy.hpp
src/share/vm/oops/symbol.cpp
src/share/vm/oops/symbol.hpp
src/share/vm/oops/typeArrayKlass.cpp
src/share/vm/oops/typeArrayKlass.hpp
src/share/vm/oops/typeArrayKlassKlass.cpp
src/share/vm/oops/typeArrayKlassKlass.hpp
src/share/vm/oops/typeArrayOop.hpp
src/share/vm/opto/callGenerator.cpp
src/share/vm/opto/callnode.cpp
src/share/vm/opto/cfgnode.cpp
src/share/vm/opto/compile.cpp
src/share/vm/opto/compile.hpp
src/share/vm/opto/connode.cpp
src/share/vm/opto/doCall.cpp
src/share/vm/opto/graphKit.cpp
src/share/vm/opto/graphKit.hpp
src/share/vm/opto/idealGraphPrinter.cpp
src/share/vm/opto/library_call.cpp
src/share/vm/opto/machnode.cpp
src/share/vm/opto/machnode.hpp
src/share/vm/opto/macro.cpp
src/share/vm/opto/matcher.cpp
src/share/vm/opto/matcher.hpp
src/share/vm/opto/memnode.cpp
src/share/vm/opto/multnode.cpp
src/share/vm/opto/node.cpp
src/share/vm/opto/output.cpp
src/share/vm/opto/parse1.cpp
src/share/vm/opto/parse2.cpp
src/share/vm/opto/parseHelper.cpp
src/share/vm/opto/reg_split.cpp
src/share/vm/opto/runtime.cpp
src/share/vm/opto/runtime.hpp
src/share/vm/opto/subnode.cpp
src/share/vm/opto/type.cpp
src/share/vm/opto/type.hpp
src/share/vm/precompiled/precompiled.hpp
src/share/vm/prims/forte.cpp
src/share/vm/prims/jni.cpp
src/share/vm/prims/jniCheck.cpp
src/share/vm/prims/jniCheck.hpp
src/share/vm/prims/jvm.cpp
src/share/vm/prims/jvm.h
src/share/vm/prims/jvm_misc.hpp
src/share/vm/prims/jvmtiClassFileReconstituter.cpp
src/share/vm/prims/jvmtiClassFileReconstituter.hpp
src/share/vm/prims/jvmtiEnter.xsl
src/share/vm/prims/jvmtiEnv.cpp
src/share/vm/prims/jvmtiEnv.xsl
src/share/vm/prims/jvmtiEnvBase.cpp
src/share/vm/prims/jvmtiEnvBase.hpp
src/share/vm/prims/jvmtiEnvThreadState.cpp
src/share/vm/prims/jvmtiEnvThreadState.hpp
src/share/vm/prims/jvmtiExport.cpp
src/share/vm/prims/jvmtiExport.hpp
src/share/vm/prims/jvmtiGetLoadedClasses.cpp
src/share/vm/prims/jvmtiImpl.cpp
src/share/vm/prims/jvmtiImpl.hpp
src/share/vm/prims/jvmtiLib.xsl
src/share/vm/prims/jvmtiRedefineClasses.cpp
src/share/vm/prims/jvmtiRedefineClasses.hpp
src/share/vm/prims/jvmtiTagMap.cpp
src/share/vm/prims/jvmtiThreadState.cpp
src/share/vm/prims/jvmtiThreadState.hpp
src/share/vm/prims/jvmtiTrace.cpp
src/share/vm/prims/methodComparator.cpp
src/share/vm/prims/methodComparator.hpp
src/share/vm/prims/methodHandles.cpp
src/share/vm/prims/methodHandles.hpp
src/share/vm/prims/nativeLookup.cpp
src/share/vm/prims/privilegedStack.cpp
src/share/vm/prims/privilegedStack.hpp
src/share/vm/prims/unsafe.cpp
src/share/vm/prims/wbtestmethods/parserTests.cpp
src/share/vm/prims/whitebox.cpp
src/share/vm/runtime/advancedThresholdPolicy.cpp
src/share/vm/runtime/advancedThresholdPolicy.hpp
src/share/vm/runtime/aprofiler.cpp
src/share/vm/runtime/aprofiler.hpp
src/share/vm/runtime/arguments.cpp
src/share/vm/runtime/biasedLocking.cpp
src/share/vm/runtime/compilationPolicy.cpp
src/share/vm/runtime/compilationPolicy.hpp
src/share/vm/runtime/deoptimization.cpp
src/share/vm/runtime/deoptimization.hpp
src/share/vm/runtime/dtraceJSDT.cpp
src/share/vm/runtime/fieldDescriptor.cpp
src/share/vm/runtime/fieldDescriptor.hpp
src/share/vm/runtime/fprofiler.cpp
src/share/vm/runtime/fprofiler.hpp
src/share/vm/runtime/frame.cpp
src/share/vm/runtime/frame.hpp
src/share/vm/runtime/frame.inline.hpp
src/share/vm/runtime/globals.hpp
src/share/vm/runtime/handles.cpp
src/share/vm/runtime/handles.hpp
src/share/vm/runtime/handles.inline.hpp
src/share/vm/runtime/init.cpp
src/share/vm/runtime/java.cpp
src/share/vm/runtime/javaCalls.cpp
src/share/vm/runtime/javaCalls.hpp
src/share/vm/runtime/jfieldIDWorkaround.hpp
src/share/vm/runtime/jniHandles.cpp
src/share/vm/runtime/jniHandles.hpp
src/share/vm/runtime/memprofiler.cpp
src/share/vm/runtime/mutexLocker.cpp
src/share/vm/runtime/objectMonitor.cpp
src/share/vm/runtime/os.cpp
src/share/vm/runtime/perfData.cpp
src/share/vm/runtime/perfData.hpp
src/share/vm/runtime/reflection.cpp
src/share/vm/runtime/reflection.hpp
src/share/vm/runtime/reflectionUtils.cpp
src/share/vm/runtime/reflectionUtils.hpp
src/share/vm/runtime/relocator.cpp
src/share/vm/runtime/relocator.hpp
src/share/vm/runtime/rframe.hpp
src/share/vm/runtime/sharedRuntime.cpp
src/share/vm/runtime/sharedRuntime.hpp
src/share/vm/runtime/signature.cpp
src/share/vm/runtime/signature.hpp
src/share/vm/runtime/simpleThresholdPolicy.cpp
src/share/vm/runtime/simpleThresholdPolicy.hpp
src/share/vm/runtime/simpleThresholdPolicy.inline.hpp
src/share/vm/runtime/stackValue.cpp
src/share/vm/runtime/stubRoutines.hpp
src/share/vm/runtime/sweeper.cpp
src/share/vm/runtime/sweeper.hpp
src/share/vm/runtime/synchronizer.cpp
src/share/vm/runtime/thread.cpp
src/share/vm/runtime/thread.hpp
src/share/vm/runtime/unhandledOops.cpp
src/share/vm/runtime/vframe.cpp
src/share/vm/runtime/vframe.hpp
src/share/vm/runtime/vframeArray.cpp
src/share/vm/runtime/vframeArray.hpp
src/share/vm/runtime/vframe_hp.cpp
src/share/vm/runtime/vframe_hp.hpp
src/share/vm/runtime/virtualspace.cpp
src/share/vm/runtime/virtualspace.hpp
src/share/vm/runtime/vmStructs.cpp
src/share/vm/runtime/vmStructs.hpp
src/share/vm/runtime/vmThread.cpp
src/share/vm/runtime/vm_operations.hpp
src/share/vm/services/attachListener.cpp
src/share/vm/services/classLoadingService.cpp
src/share/vm/services/classLoadingService.hpp
src/share/vm/services/diagnosticCommand.cpp
src/share/vm/services/gcNotifier.cpp
src/share/vm/services/heapDumper.cpp
src/share/vm/services/heapDumper.hpp
src/share/vm/services/lowMemoryDetector.cpp
src/share/vm/services/management.cpp
src/share/vm/services/management.hpp
src/share/vm/services/memoryManager.cpp
src/share/vm/services/memoryPool.cpp
src/share/vm/services/memoryPool.hpp
src/share/vm/services/memoryService.cpp
src/share/vm/services/memoryService.hpp
src/share/vm/services/psMemoryPool.cpp
src/share/vm/services/psMemoryPool.hpp
src/share/vm/services/serviceUtil.hpp
src/share/vm/services/threadService.cpp
src/share/vm/services/threadService.hpp
src/share/vm/shark/sharkBuilder.cpp
src/share/vm/shark/sharkCacheDecache.cpp
src/share/vm/shark/sharkContext.cpp
src/share/vm/shark/sharkContext.hpp
src/share/vm/shark/sharkRuntime.cpp
src/share/vm/shark/sharkRuntime.hpp
src/share/vm/shark/sharkStack.cpp
src/share/vm/shark/sharkState.cpp
src/share/vm/shark/sharkTopLevelBlock.cpp
src/share/vm/shark/sharkType.hpp
src/share/vm/utilities/accessFlags.cpp
src/share/vm/utilities/accessFlags.hpp
src/share/vm/utilities/array.hpp
src/share/vm/utilities/constantTag.cpp
src/share/vm/utilities/constantTag.hpp
src/share/vm/utilities/debug.cpp
src/share/vm/utilities/debug.hpp
src/share/vm/utilities/exceptions.cpp
src/share/vm/utilities/exceptions.hpp
src/share/vm/utilities/globalDefinitions.cpp
src/share/vm/utilities/globalDefinitions.hpp
src/share/vm/utilities/growableArray.hpp
src/share/vm/utilities/hashtable.cpp
src/share/vm/utilities/hashtable.hpp
src/share/vm/utilities/xmlstream.cpp
src/share/vm/utilities/xmlstream.hpp
test/compiler/6859338/Test6859338.java
--- a/agent/doc/clhsdb.html Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/doc/clhsdb.html Sat Sep 01 13:25:18 2012 -0400
@@ -38,10 +38,10 @@ Available commands:
assert true | false <font color="red">turn on/off asserts in SA code</font>
attach pid | exec core <font color="red">attach SA to a process or core</font>
class name <font color="red">find a Java class from debuggee and print oop</font>
- classes <font color="red">print all loaded Java classes with klassOop</font>
+ classes <font color="red">print all loaded Java classes with Klass*</font>
detach <font color="red">detach SA from current target</font>
dis address [ length ] <font color="red">disassemble (sparc/x86) specified number of instructions from given address</font>
- dumpclass { address | name } [ directory ] <font color="red">dump .class file for given klassOop or class name</font>
+ dumpclass { address | name } [ directory ] <font color="red">dump .class file for given Klass* or class name</font>
dumpheap [ file ] <font color="red">dump heap in hprof binary format</font>
echo [ true | false ] <font color="red">turn on/off command echo mode</font>
examine [ address/count ] | [ address,address] <font color="red">show contents of memory from given address</font>
@@ -51,7 +51,7 @@ Available commands:
help [ command ] <font color="red">print help message for all commands or just given command</font>
history <font color="red">show command history. usual !command-number syntax works.</font>
inspect expression <font color="red">inspect a given oop</font>
- jdis address <font color="red">show bytecode disassembly of a given methodOop</font>
+ jdis address <font color="red">show bytecode disassembly of a given Method*</font>
jhisto <font color="red">show Java heap histogram</font>
jseval script <font color="red">evaluate a given string as JavaScript code</font>
jsload file <font color="red">load and evaluate a JavaScript file</font>
@@ -59,7 +59,7 @@ Available commands:
livenmethods <font color="red">show all live nmethods</font>
mem address [ length ] <font color="red">show contents of memory -- also shows closest ELF/COFF symbol if found</font>
pmap <font color="red">show Solaris pmap-like output</font>
- print expression <font color="red">print given klassOop, methodOop or arbitrary address</font>
+ print expression <font color="red">print given Klass*, Method* or arbitrary address</font>
printas type expression <font color="red">print given address as given HotSpot type. eg. print JavaThread &lt;address&gt;</font>
printstatics [ type ] <font color="red">print static fields of given HotSpot type (or all types if none specified)</font>
pstack [-v] <font color="red">show mixed mode stack trace for all Java, non-Java threads. -v is verbose mode</font>
--- a/agent/src/os/bsd/ps_core.c Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/os/bsd/ps_core.c Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -210,7 +210,6 @@ static map_info* core_lookup(struct ps_p
// mapped. This structure gets written to a file. It is not a class,
// so that the compilers don't add any compiler-private data to it.
-// Refer to CompactingPermGenGen::n_regions in compactingPermGenGen.hpp
#define NUM_SHARED_MAPS 4
// Refer to FileMapInfo::_current_version in filemap.hpp
@@ -234,7 +233,7 @@ struct FileMapHeader {
char _read_only; // read only space?
char _allow_exec; // executable code in space?
- } _space[NUM_SHARED_MAPS]; // was _space[CompactingPermGenGen::n_regions];
+ } _space[NUM_SHARED_MAPS];
// Ignore the rest of the FileMapHeader. We don't need those fields here.
};
--- a/agent/src/os/linux/ps_core.c Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/os/linux/ps_core.c Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -209,7 +209,6 @@ static map_info* core_lookup(struct ps_p
// mapped. This structure gets written to a file. It is not a class,
// so that the compilers don't add any compiler-private data to it.
-// Refer to CompactingPermGenGen::n_regions in compactingPermGenGen.hpp
#define NUM_SHARED_MAPS 4
// Refer to FileMapInfo::_current_version in filemap.hpp
@@ -233,7 +232,7 @@ struct FileMapHeader {
char _read_only; // read only space?
char _allow_exec; // executable code in space?
- } _space[NUM_SHARED_MAPS]; // was _space[CompactingPermGenGen::n_regions];
+ } _space[NUM_SHARED_MAPS];
// Ignore the rest of the FileMapHeader. We don't need those fields here.
};
--- a/agent/src/os/solaris/proc/saproc.cpp Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/os/solaris/proc/saproc.cpp Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -510,7 +510,6 @@ wrapper_fill_cframe_list(void *cd, const
// mapped. This structure gets written to a file. It is not a class, so
// that the compilers don't add any compiler-private data to it.
-// Refer to CompactingPermGenGen::n_regions in compactingPermGenGen.hpp
const int NUM_SHARED_MAPS = 4;
// Refer to FileMapInfo::_current_version in filemap.hpp
@@ -531,7 +530,7 @@ struct FileMapHeader {
bool _read_only; // read only space?
bool _allow_exec; // executable code in space?
- } _space[NUM_SHARED_MAPS]; // was _space[CompactingPermGenGen::n_regions];
+ } _space[NUM_SHARED_MAPS];
// Ignore the rest of the FileMapHeader. We don't need those fields here.
};
--- a/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
@@ -634,26 +634,54 @@ public class CommandProcessor {
} else {
String s = t.nextToken();
if (s.equals("-a")) {
- HeapVisitor iterator = new DefaultHeapVisitor() {
- public boolean doObj(Oop obj) {
- if (obj instanceof MethodData) {
- Method m = ((MethodData)obj).getMethod();
- out.println("MethodData " + obj.getHandle() + " for " +
+ SystemDictionary sysDict = VM.getVM().getSystemDictionary();
+ sysDict.allClassesDo(new SystemDictionary.ClassVisitor() {
+ public void visit(Klass k) {
+ if (k instanceof InstanceKlass) {
+ MethodArray methods = ((InstanceKlass)k).getMethods();
+ for (int i = 0; i < methods.length(); i++) {
+ Method m = methods.at(i);
+ MethodData mdo = m.getMethodData();
+ if (mdo != null) {
+ out.println("MethodData " + mdo.getAddress() + " for " +
"method " + m.getMethodHolder().getName().asString() + "." +
m.getName().asString() +
- m.getSignature().asString() + "@" + m.getHandle());
- ((MethodData)obj).printDataOn(out);
+ m.getSignature().asString() + "@" + m.getAddress());
+ mdo.printDataOn(out);
}
- return false;
}
- };
- VM.getVM().getObjectHeap().iteratePerm(iterator);
+ }
+ }
+ }
+ );
} else {
Address a = VM.getVM().getDebugger().parseAddress(s);
- OopHandle handle = a.addOffsetToAsOopHandle(0);
- MethodData mdo = (MethodData)VM.getVM().getObjectHeap().newOop(handle);
+ MethodData mdo = (MethodData) Metadata.instantiateWrapperFor(a);
mdo.printDataOn(out);
}
+ }
+ }
+ },
+ new Command("printall", "printall", false) {
+ // Print every MDO in the heap or the one referenced by expression.
+ public void doit(Tokens t) {
+ if (t.countTokens() != 0) {
+ usage();
+ } else {
+ SystemDictionary sysDict = VM.getVM().getSystemDictionary();
+ sysDict.allClassesDo(new SystemDictionary.ClassVisitor() {
+ public void visit(Klass k) {
+ if (k instanceof InstanceKlass && ((InstanceKlass)k).getConstants().getCache() != null) {
+ MethodArray methods = ((InstanceKlass)k).getMethods();
+ for (int i = 0; i < methods.length(); i++) {
+ Method m = methods.at(i);
+ HTMLGenerator gen = new HTMLGenerator(false);
+ out.println(gen.genHTML(m));
+ }
+ }
+ }
+ }
+ );
}
}
},
@@ -1229,7 +1257,7 @@ public class CommandProcessor {
}
};
VM.getVM().getObjectHeap().iterateRaw(iterator);
- } else if (type.equals("heap") || type.equals("perm")) {
+ } else if (type.equals("heap")) {
HeapVisitor iterator = new DefaultHeapVisitor() {
public boolean doObj(Oop obj) {
int index = 0;
@@ -1246,11 +1274,7 @@ public class CommandProcessor {
return false;
}
};
- if (type.equals("heap")) {
VM.getVM().getObjectHeap().iterate(iterator);
- } else {
- VM.getVM().getObjectHeap().iteratePerm(iterator);
- }
} else if (type.equals("codecache")) {
CodeCacheVisitor v = new CodeCacheVisitor() {
public void prologue(Address start, Address end) {
--- a/agent/src/share/classes/sun/jvm/hotspot/HSDB.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/HSDB.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -998,7 +998,7 @@ public class HSDB implements ObjectHisto
curFrame.addressOfInterpreterFrameLocal((int) interpreterFrameMethod.getMaxLocals() + offset),
"Interpreter locals area for frame with SP = " + curFrame.getSP()));
}
- String methodAnno = "Interpreter frame methodOop";
+ String methodAnno = "Interpreter frame Method*";
if (interpreterFrameMethod == null) {
methodAnno += " (BAD OOP)";
}
@@ -1054,13 +1054,6 @@ public class HSDB implements ObjectHisto
}
}
- if (bad) {
- // Try perm gen
- if (heap.permGen().isIn(handle)) {
- anno = "PermGen ";
- bad = false;
- }
- }
} else if (collHeap instanceof ParallelScavengeHeap) {
ParallelScavengeHeap heap = (ParallelScavengeHeap) collHeap;
if (heap.youngGen().isIn(handle)) {
@@ -1068,9 +1061,6 @@ public class HSDB implements ObjectHisto
bad = false;
} else if (heap.oldGen().isIn(handle)) {
anno = "PSOldGen ";
- bad = false;
- } else if (heap.permGen().isIn(handle)) {
- anno = "PSPermGen ";
bad = false;
}
} else {
--- a/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -50,6 +50,7 @@ public class HotSpotTypeDataBase extends
private static final int C_INT8_SIZE = 1;
private static final int C_INT32_SIZE = 4;
private static final int C_INT64_SIZE = 8;
+ private static int pointerSize = UNINITIALIZED_SIZE;
private static final boolean DEBUG;
static {
@@ -185,6 +186,9 @@ public class HotSpotTypeDataBase extends
long size = entryAddr.getCIntegerAt(typeEntrySizeOffset, C_INT64_SIZE, true);
createType(typeName, superclassName, isOopType, isIntegerType, isUnsigned, size);
+ if (pointerSize == UNINITIALIZED_SIZE && typeName.equals("void*")) {
+ pointerSize = (int)size;
+ }
}
entryAddr = entryAddr.addOffsetTo(typeEntryArrayStride);
@@ -678,7 +682,11 @@ public class HotSpotTypeDataBase extends
}
}
result = new BasicPointerType(this, typeName, targetType);
- result.setSize(UNINITIALIZED_SIZE);
+ if (pointerSize == UNINITIALIZED_SIZE && !typeName.equals("void*")) {
+ // void* must be declared early so that other pointer types can use that to set their size.
+ throw new InternalError("void* type hasn't been seen when parsing " + typeName);
+ }
+ result.setSize(pointerSize);
addType(result);
return result;
}
@@ -731,8 +739,10 @@ public class HotSpotTypeDataBase extends
"had its size redefined (old was " + curType.getSize() + ", new is " + size + ").");
}
+ if (!typeNameIsPointerType(typeName)) {
System.err.println("Warning: the type \"" + typeName + "\" (declared in the remote VM in VMStructs::localHotSpotVMTypes) " +
"had its size declared as " + size + " twice. Continuing.");
+ }
}
}
--- a/agent/src/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -47,8 +47,8 @@ public class ciInstanceKlass extends ciK
Type type = db.lookupType("ciInstanceKlass");
initStateField = new CIntField(type.getCIntegerField("_init_state"), 0);
isSharedField = new CIntField(type.getCIntegerField("_is_shared"), 0);
- CLASS_STATE_LINKED = db.lookupIntConstant("instanceKlass::linked").intValue();
- CLASS_STATE_FULLY_INITIALIZED = db.lookupIntConstant("instanceKlass::fully_initialized").intValue();
+ CLASS_STATE_LINKED = db.lookupIntConstant("InstanceKlass::linked").intValue();
+ CLASS_STATE_FULLY_INITIALIZED = db.lookupIntConstant("InstanceKlass::fully_initialized").intValue();
}
private static CIntField initStateField;
@@ -63,7 +63,7 @@ public class ciInstanceKlass extends ciK
public int initState() {
int initState = (int)initStateField.getValue(getAddress());
if (isShared() && initState < CLASS_STATE_LINKED) {
- InstanceKlass ik = (InstanceKlass)getOop();
+ InstanceKlass ik = (InstanceKlass)getMetadata();
initState = ik.getInitStateAsInt();
}
return initState;
--- a/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -32,7 +32,7 @@ import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.types.*;
-public class ciMethod extends ciObject {
+public class ciMethod extends ciMetadata {
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@@ -61,7 +61,7 @@ public class ciMethod extends ciObject {
}
public Method method() {
- return (Method)getOop();
+ return (Method)getMetadata();
}
public int interpreterThrowoutCount() {
@@ -75,7 +75,7 @@ public class ciMethod extends ciObject {
public int instructionsSize() {
if (instructionsSizeField == null) {
// XXX
- Method method = (Method)getOop();
+ Method method = method();
NMethod nm = method.getNativeMethod();
if (nm != null) return (int)nm.codeEnd().minus(nm.getVerifiedEntryPoint());
return 0;
@@ -84,7 +84,7 @@ public class ciMethod extends ciObject {
}
public void printShortName(PrintStream st) {
- Method method = (Method)getOop();
+ Method method = method();
st.printf(" %s::%s", method.getMethodHolder().getName().asString().replace('/', '.'),
method.getName().asString());
}
--- a/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -31,7 +31,7 @@ import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.types.*;
-public class ciMethodData extends ciObject {
+public class ciMethodData extends ciMetadata {
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@@ -54,7 +54,7 @@ public class ciMethodData extends ciObje
extraDataSizeField = new CIntField(type.getCIntegerField("_extra_data_size"), 0);
dataSizeField = new CIntField(type.getCIntegerField("_data_size"), 0);
stateField = new CIntField(type.getCIntegerField("_state"), 0);
- sizeofMethodDataOopDesc = (int)db.lookupType("methodDataOopDesc").getSize();;
+ sizeofMethodDataOopDesc = (int)db.lookupType("MethodData").getSize();;
}
private static AddressField origField;
@@ -83,7 +83,7 @@ public class ciMethodData extends ciObje
}
public byte[] orig() {
- // fetch the orig methodDataOopDesc data between header and dataSize
+ // fetch the orig MethodData data between header and dataSize
Address base = getAddress().addOffsetTo(origField.getOffset());
byte[] result = new byte[MethodData.sizeofMethodDataOopDesc];
for (int i = 0; i < MethodData.sizeofMethodDataOopDesc; i++) {
--- a/agent/src/share/classes/sun/jvm/hotspot/ci/ciObject.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ci/ciObject.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -31,7 +31,7 @@ import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.types.*;
-public class ciObject extends VMObject {
+public class ciObject extends ciBaseObject {
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@@ -42,12 +42,10 @@ public class ciObject extends VMObject {
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
Type type = db.lookupType("ciObject");
- identField = new CIntField(type.getCIntegerField("_ident"), 0);
klassField = type.getAddressField("_klass");
handleField = type.getAddressField("_handle");
}
- private static CIntField identField;
private static AddressField klassField;
private static AddressField handleField;
--- a/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -44,18 +44,20 @@ public class ciObjectFactory extends VMO
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
Type type = db.lookupType("ciObjectFactory");
unloadedMethodsField = type.getAddressField("_unloaded_methods");
- ciObjectsField = type.getAddressField("_ci_objects");
+ ciMetadataField = type.getAddressField("_ci_metadata");
symbolsField = type.getAddressField("_symbols");
ciObjectConstructor = new VirtualBaseConstructor<ciObject>(db, db.lookupType("ciObject"), "sun.jvm.hotspot.ci", ciObject.class);
+ ciMetadataConstructor = new VirtualBaseConstructor<ciMetadata>(db, db.lookupType("ciMetadata"), "sun.jvm.hotspot.ci", ciMetadata.class);
ciSymbolConstructor = new VirtualBaseConstructor<ciSymbol>(db, db.lookupType("ciSymbol"), "sun.jvm.hotspot.ci", ciSymbol.class);
}
private static AddressField unloadedMethodsField;
- private static AddressField ciObjectsField;
+ private static AddressField ciMetadataField;
private static AddressField symbolsField;
private static VirtualBaseConstructor<ciObject> ciObjectConstructor;
+ private static VirtualBaseConstructor<ciMetadata> ciMetadataConstructor;
private static VirtualBaseConstructor<ciSymbol> ciSymbolConstructor;
public static ciObject get(Address addr) {
@@ -64,8 +66,14 @@ public class ciObjectFactory extends VMO
return (ciObject)ciObjectConstructor.instantiateWrapperFor(addr);
}
- public GrowableArray<ciObject> objects() {
- return GrowableArray.create(ciObjectsField.getValue(getAddress()), ciObjectConstructor);
+ public static ciMetadata getMetadata(Address addr) {
+ if (addr == null) return null;
+
+ return (ciMetadata)ciMetadataConstructor.instantiateWrapperFor(addr);
+ }
+
+ public GrowableArray<ciMetadata> objects() {
+ return GrowableArray.create(ciMetadataField.getValue(getAddress()), ciMetadataConstructor);
}
public GrowableArray<ciSymbol> symbols() {
--- a/agent/src/share/classes/sun/jvm/hotspot/ci/ciReceiverTypeData.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ci/ciReceiverTypeData.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -42,7 +42,7 @@ public class ciReceiverTypeData extends
public ciKlass receiverAt(int row) {
//assert((uint)row < rowLimit(), "oob");
- ciObject recv = ciObjectFactory.get(addressAt(receiverCellIndex(row)));
+ ciMetadata recv = ciObjectFactory.getMetadata(addressAt(receiverCellIndex(row)));
if (recv != null && !(recv instanceof ciKlass)) {
System.err.println(recv);
}
--- a/agent/src/share/classes/sun/jvm/hotspot/ci/ciSymbol.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ci/ciSymbol.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -31,7 +31,7 @@ import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.types.*;
-public class ciSymbol extends VMObject {
+public class ciSymbol extends ciMetadata {
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@@ -42,12 +42,10 @@ public class ciSymbol extends VMObject {
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
Type type = db.lookupType("ciSymbol");
- identField = type.getCIntegerField("_ident");
symbolField = type.getAddressField("_symbol");
}
private static AddressField symbolField;
- private static CIntegerField identField;
public String asUtf88() {
Symbol sym = Symbol.create(symbolField.getValue(getAddress()));
--- a/agent/src/share/classes/sun/jvm/hotspot/ci/ciType.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ci/ciType.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -30,7 +30,7 @@ import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.types.*;
-public class ciType extends ciObject {
+public class ciType extends ciMetadata {
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
--- a/agent/src/share/classes/sun/jvm/hotspot/ci/ciVirtualCallData.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ci/ciVirtualCallData.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -42,7 +42,7 @@ public class ciVirtualCallData extends V
public ciKlass receiverAt(int row) {
//assert((uint)row < rowLimit(), "oob");
- ciObject recv = ciObjectFactory.get(addressAt(receiverCellIndex(row)));
+ ciMetadata recv = ciObjectFactory.getMetadata(addressAt(receiverCellIndex(row)));
if (recv != null && !(recv instanceof ciKlass)) {
System.err.println(recv);
}
--- a/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -29,6 +29,7 @@ import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.utilities.*;
+import sun.jvm.hotspot.oops.Method;
public class DebugInfoReadStream extends CompressedReadStream {
private NMethod code;
@@ -51,6 +52,10 @@ public class DebugInfoReadStream extends
public OopHandle readOopHandle() {
return code.getOopAt(readInt());
+ }
+
+ public Method readMethod() {
+ return code.getMethodAt(readInt());
}
ScopeValue readObjectValue() {
--- a/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -35,7 +35,7 @@ import sun.jvm.hotspot.utilities.*;
public class NMethod extends CodeBlob {
private static long pcDescSize;
- private static sun.jvm.hotspot.types.OopField methodField;
+ private static AddressField methodField;
/** != InvocationEntryBci if this nmethod is an on-stack replacement method */
private static CIntegerField entryBCIField;
/** To support simple linked-list chaining of nmethods */
@@ -50,6 +50,7 @@ public class NMethod extends CodeBlob {
private static CIntegerField origPCOffsetField;
private static CIntegerField stubOffsetField;
private static CIntegerField oopsOffsetField;
+ private static CIntegerField metadataOffsetField;
private static CIntegerField scopesDataOffsetField;
private static CIntegerField scopesPCsOffsetField;
private static CIntegerField dependenciesOffsetField;
@@ -88,7 +89,7 @@ public class NMethod extends CodeBlob {
private static void initialize(TypeDataBase db) {
Type type = db.lookupType("nmethod");
- methodField = type.getOopField("_method");
+ methodField = type.getAddressField("_method");
entryBCIField = type.getCIntegerField("_entry_bci");
osrLinkField = type.getAddressField("_osr_link");
scavengeRootLinkField = type.getAddressField("_scavenge_root_link");
@@ -100,6 +101,7 @@ public class NMethod extends CodeBlob {
origPCOffsetField = type.getCIntegerField("_orig_pc_offset");
stubOffsetField = type.getCIntegerField("_stub_offset");
oopsOffsetField = type.getCIntegerField("_oops_offset");
+ metadataOffsetField = type.getCIntegerField("_metadata_offset");
scopesDataOffsetField = type.getCIntegerField("_scopes_data_offset");
scopesPCsOffsetField = type.getCIntegerField("_scopes_pcs_offset");
dependenciesOffsetField = type.getCIntegerField("_dependencies_offset");
@@ -126,7 +128,7 @@ public class NMethod extends CodeBlob {
}
public Method getMethod() {
- return (Method) VM.getVM().getObjectHeap().newOop(methodField.getValue(addr));
+ return (Method)Metadata.instantiateWrapperFor(methodField.getValue(addr));
}
// Type info
@@ -146,7 +148,9 @@ public class NMethod extends CodeBlob {
public Address stubBegin() { return headerBegin().addOffsetTo(getStubOffset()); }
public Address stubEnd() { return headerBegin().addOffsetTo(getOopsOffset()); }
public Address oopsBegin() { return headerBegin().addOffsetTo(getOopsOffset()); }
- public Address oopsEnd() { return headerBegin().addOffsetTo(getScopesDataOffset()); }
+ public Address oopsEnd() { return headerBegin().addOffsetTo(getMetadataOffset()); }
+ public Address metadataBegin() { return headerBegin().addOffsetTo(getMetadataOffset()); }
+ public Address metadataEnd() { return headerBegin().addOffsetTo(getScopesDataOffset()); }
public Address scopesDataBegin() { return headerBegin().addOffsetTo(getScopesDataOffset()); }
public Address scopesDataEnd() { return headerBegin().addOffsetTo(getScopesPCsOffset()); }
public Address scopesPCsBegin() { return headerBegin().addOffsetTo(getScopesPCsOffset()); }
@@ -162,6 +166,7 @@ public class NMethod extends CodeBlob {
public int instsSize() { return (int) instsEnd() .minus(instsBegin()); }
public int stubSize() { return (int) stubEnd() .minus(stubBegin()); }
public int oopsSize() { return (int) oopsEnd() .minus(oopsBegin()); }
+ public int metadataSize() { return (int) metadataEnd() .minus(metadataBegin()); }
public int scopesDataSize() { return (int) scopesDataEnd() .minus(scopesDataBegin()); }
public int scopesPCsSize() { return (int) scopesPCsEnd() .minus(scopesPCsBegin()); }
public int dependenciesSize() { return (int) dependenciesEnd().minus(dependenciesBegin()); }
@@ -185,12 +190,14 @@ public class NMethod extends CodeBlob {
public boolean instsContains (Address addr) { return instsBegin() .lessThanOrEqual(addr) && instsEnd() .greaterThan(addr); }
public boolean stubContains (Address addr) { return stubBegin() .lessThanOrEqual(addr) && stubEnd() .greaterThan(addr); }
public boolean oopsContains (Address addr) { return oopsBegin() .lessThanOrEqual(addr) && oopsEnd() .greaterThan(addr); }
+ public boolean metadataContains (Address addr) { return metadataBegin() .lessThanOrEqual(addr) && metadataEnd() .greaterThan(addr); }
public boolean scopesDataContains (Address addr) { return scopesDataBegin() .lessThanOrEqual(addr) && scopesDataEnd() .greaterThan(addr); }
public boolean scopesPCsContains (Address addr) { return scopesPCsBegin() .lessThanOrEqual(addr) && scopesPCsEnd() .greaterThan(addr); }
public boolean handlerTableContains(Address addr) { return handlerTableBegin().lessThanOrEqual(addr) && handlerTableEnd().greaterThan(addr); }
public boolean nulChkTableContains (Address addr) { return nulChkTableBegin() .lessThanOrEqual(addr) && nulChkTableEnd() .greaterThan(addr); }
public int getOopsLength() { return (int) (oopsSize() / VM.getVM().getOopSize()); }
+ public int getMetadataLength() { return (int) (metadataSize() / VM.getVM().getOopSize()); }
/** Entry points */
public Address getEntryPoint() { return entryPointField.getValue(addr); }
@@ -203,6 +210,19 @@ public class NMethod extends CodeBlob {
Assert.that(index > 0 && index <= getOopsLength(), "must be a valid non-zero index");
}
return oopsBegin().getOopHandleAt((index - 1) * VM.getVM().getOopSize());
+ }
+
+ /** Support for metadata in scopes and relocs. Note: index 0 is reserved for null. */
+ public Address getMetadataAt(int index) {
+ if (index == 0) return null;
+ if (Assert.ASSERTS_ENABLED) {
+ Assert.that(index > 0 && index <= getMetadataLength(), "must be a valid non-zero index");
+ }
+ return metadataBegin().getAddressAt((index - 1) * VM.getVM().getOopSize());
+ }
+
+ public Method getMethodAt(int index) {
+ return (Method)Metadata.instantiateWrapperFor(getMetadataAt(index));
}
// FIXME: add interpreter_entry_point()
@@ -412,6 +432,7 @@ public class NMethod extends CodeBlob {
private int getDeoptMhOffset() { return (int) deoptMhOffsetField .getValue(addr); }
private int getStubOffset() { return (int) stubOffsetField .getValue(addr); }
private int getOopsOffset() { return (int) oopsOffsetField .getValue(addr); }
+ private int getMetadataOffset() { return (int) metadataOffsetField .getValue(addr); }
private int getScopesDataOffset() { return (int) scopesDataOffsetField .getValue(addr); }
private int getScopesPCsOffset() { return (int) scopesPCsOffsetField .getValue(addr); }
private int getDependenciesOffset() { return (int) dependenciesOffsetField.getValue(addr); }
--- a/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -61,7 +61,7 @@ public class ScopeDesc {
DebugInfoReadStream stream = streamAt(decodeOffset);
senderDecodeOffset = stream.readInt();
- method = (Method) VM.getVM().getObjectHeap().newOop(stream.readOopHandle());
+ method = stream.readMethod();
bci = stream.readBCI();
// Decode offsets for body and sender
localsDecodeOffset = stream.readInt();
@@ -79,7 +79,7 @@ public class ScopeDesc {
DebugInfoReadStream stream = streamAt(decodeOffset);
senderDecodeOffset = stream.readInt();
- method = (Method) VM.getVM().getObjectHeap().newOop(stream.readOopHandle());
+ method = stream.readMethod();
bci = stream.readBCI();
// Decode offsets for body and sender
localsDecodeOffset = stream.readInt();
--- a/agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -56,8 +56,8 @@ public class CompileTask extends VMObjec
}
public Method method() {
- OopHandle oh = methodField.getValue(getAddress()).getOopHandleAt(0);
- return (Method)VM.getVM().getObjectHeap().newOop(oh);
+ Address oh = methodField.getValue(getAddress()).getAddressAt(0);
+ return (Method)Metadata.instantiateWrapperFor(oh);
}
public int osrBci() {
--- a/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/parallelScavenge/ParallelScavengeHeap.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/parallelScavenge/ParallelScavengeHeap.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -45,7 +45,6 @@ public class ParallelScavengeHeap extend
Type type = db.lookupType("ParallelScavengeHeap");
youngGenField = type.getAddressField("_young_gen");
oldGenField = type.getAddressField("_old_gen");
- permGenField = type.getAddressField("_perm_gen");
}
public ParallelScavengeHeap(Address addr) {
@@ -55,7 +54,6 @@ public class ParallelScavengeHeap extend
// Fields
private static AddressField youngGenField;
private static AddressField oldGenField;
- private static AddressField permGenField;
// Accessors
public PSYoungGen youngGen() {
@@ -64,10 +62,6 @@ public class ParallelScavengeHeap extend
public PSOldGen oldGen() {
return (PSOldGen) VMObjectFactory.newObject(PSOldGen.class, oldGenField.getValue());
- }
-
- public PSPermGen permGen() {
- return (PSPermGen) VMObjectFactory.newObject(PSPermGen.class, permGenField.getValue());
}
public long capacity() {
@@ -87,10 +81,6 @@ public class ParallelScavengeHeap extend
return true;
}
- if (permGen().isIn(a)) {
- return true;
- }
-
return false;
}
@@ -102,7 +92,6 @@ public class ParallelScavengeHeap extend
tty.print("ParallelScavengeHeap [ ");
youngGen().printOn(tty);
oldGen().printOn(tty);
- permGen().printOn(tty);
tty.print(" ] ");
}
}
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -138,9 +138,9 @@ public class BytecodeDisassembler {
}
}
- Object bytecodeObj = null;
+ Bytecode bytecodeObj = null;
try {
- bytecodeObj = cstr.newInstance(new Object[] { method, new Integer(bci) });
+ bytecodeObj = (Bytecode)cstr.newInstance(new Object[] { method, new Integer(bci) });
} catch (Exception exp) {
if (Assert.ASSERTS_ENABLED) {
Assert.that(false, "Bytecode instance of class "
@@ -153,11 +153,10 @@ public class BytecodeDisassembler {
}
try {
- visitor.visit((Bytecode) bytecodeObj);
+ visitor.visit(bytecodeObj);
} catch(ClassCastException castfail) {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(false, clazz.getName() + " is not derived from Bytecode!");
- }
+ castfail.printStackTrace();
+ System.err.println(method.getAddress() + " " + bci);
}
}
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
@@ -55,8 +55,7 @@ public class BytecodeInvoke extends Byte
public Symbol name() {
ConstantPool cp = method().getConstants();
if (isInvokedynamic()) {
- int[] nt = cp.getNameAndTypeAt(indexForFieldOrMethod());
- return cp.getSymbolAt(nt[0]);
+ return cp.uncachedGetNameRefAt(indexForFieldOrMethod());
}
return cp.getNameRefAt(index());
}
@@ -65,18 +64,9 @@ public class BytecodeInvoke extends Byte
public Symbol signature() {
ConstantPool cp = method().getConstants();
if (isInvokedynamic()) {
- int[] nt = cp.getNameAndTypeAt(indexForFieldOrMethod());
- return cp.getSymbolAt(nt[1]);
+ return cp.uncachedGetSignatureRefAt(indexForFieldOrMethod());
}
return cp.getSignatureRefAt(index());
- }
-
- public int getSecondaryIndex() {
- if (isInvokedynamic()) {
- // change byte-ordering of 4-byte integer
- return VM.getVM().getBytes().swapInt(javaSignedWordAt(1));
- }
- return super.getSecondaryIndex(); // throw an error
}
public Method getInvokedMethod() {
@@ -123,7 +113,7 @@ public class BytecodeInvoke extends Byte
buf.append(Integer.toString(indexForFieldOrMethod()));
if (isInvokedynamic()) {
buf.append('(');
- buf.append(Integer.toString(getSecondaryIndex()));
+ buf.append(Integer.toString(index()));
buf.append(')');
}
buf.append(" [Method ");
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -46,12 +46,11 @@ public class BytecodeLoadConstant extend
}
public int poolIndex() {
- int i = rawIndex();
- if (hasCacheIndex()) {
- ConstantPoolCache cpCache = method().getConstants().getCache();
- return cpCache.getEntryAt(i).getConstantPoolIndex();
- } else {
- return i;
+ int index = rawIndex();
+ if (hasCacheIndex()) {
+ return method().getConstants().objectToCPIndex(index);
+ } else {
+ return index;
}
}
@@ -72,8 +71,7 @@ public class BytecodeLoadConstant extend
private Oop getCachedConstant() {
int i = cacheIndex();
if (i >= 0) {
- ConstantPoolCache cpCache = method().getConstants().getCache();
- return cpCache.getEntryAt(i).getF1();
+ throw new InternalError("invokedynamic not implemented yet");
}
return null;
}
@@ -96,7 +94,7 @@ public class BytecodeLoadConstant extend
return (ctag.isDouble() || ctag.isLong()) ? true: false;
} else {
// has to be int or float or String or Klass
- return (ctag.isUnresolvedString() || ctag.isString()
+ return (ctag.isString()
|| ctag.isUnresolvedKlass() || ctag.isKlass()
|| ctag.isMethodHandle() || ctag.isMethodType()
|| ctag.isInt() || ctag.isFloat())? true: false;
@@ -124,9 +122,9 @@ public class BytecodeLoadConstant extend
ConstantPool cpool = method().getConstants();
int cpIndex = poolIndex();
ConstantPool.CPSlot oop = cpool.getSlotAt(cpIndex);
- if (oop.isOop()) {
- return (Klass) oop.getOop();
- } else if (oop.isMetaData()) {
+ if (oop.isResolved()) {
+ return oop.getKlass();
+ } else if (oop.isUnresolved()) {
return oop.getSymbol();
} else {
throw new RuntimeException("should not reach here");
@@ -163,28 +161,21 @@ public class BytecodeLoadConstant extend
return "<float " + Float.toString(cpool.getFloatAt(cpIndex)) + "F>";
} else if (ctag.isDouble()) {
return "<double " + Double.toString(cpool.getDoubleAt(cpIndex)) + "D>";
- } else if (ctag.isString() || ctag.isUnresolvedString()) {
+ } else if (ctag.isString()) {
// tag change from 'unresolved' to 'string' does not happen atomically.
// We just look at the object at the corresponding index and
// decide based on the oop type.
- ConstantPool.CPSlot obj = cpool.getSlotAt(cpIndex);
- if (obj.isMetaData()) {
- Symbol sym = obj.getSymbol();
+ Symbol sym = cpool.getUnresolvedStringAt(cpIndex);
return "<String \"" + sym.asString() + "\">";
- } else if (obj.isOop()) {
- return "<String \"" + OopUtilities.stringOopToString(obj.getOop()) + "\">";
- } else {
- throw new RuntimeException("should not reach here");
- }
} else if (ctag.isKlass() || ctag.isUnresolvedKlass()) {
// tag change from 'unresolved' to 'klass' does not happen atomically.
// We just look at the object at the corresponding index and
// decide based on the oop type.
ConstantPool.CPSlot obj = cpool.getSlotAt(cpIndex);
- if (obj.isOop()) {
- Klass k = (Klass) obj.getOop();
- return "<Class " + k.getName().asString() + "@" + k.getHandle() + ">";
- } else if (obj.isMetaData()) {
+ if (obj.isResolved()) {
+ Klass k = obj.getKlass();
+ return "<Class " + k.getName().asString() + "@" + k.getAddress() + ">";
+ } else if (obj.isUnresolved()) {
Symbol sym = obj.getSymbol();
return "<Class " + sym.asString() + ">";
} else {
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -35,10 +35,17 @@ public abstract class BytecodeWithCPInde
}
// the constant pool index for this bytecode
- public int index() { return getIndexU2(code(), false); }
-
- public int getSecondaryIndex() {
- throw new IllegalArgumentException("must be invokedynamic");
+ public int index() {
+ if (code() == Bytecodes._invokedynamic) {
+ int index = getIndexU4();
+ if (ConstantPool.isInvokedynamicIndex(index)) {
+ return ConstantPool.decodeInvokedynamicIndex(index);
+ } else {
+ return index;
+ }
+ } else {
+ return getIndexU2(code(), false);
+ }
}
protected int indexForFieldOrMethod() {
@@ -47,12 +54,8 @@ public abstract class BytecodeWithCPInde
int cpCacheIndex = index();
if (cpCache == null) {
return cpCacheIndex;
- } else if (code() == Bytecodes._invokedynamic) {
- int secondaryIndex = getSecondaryIndex();
- return cpCache.getMainEntryAt(secondaryIndex).getConstantPoolIndex();
} else {
- // change byte-ordering and go via cache
- return cpCache.getEntryAt((int) (0xFFFF & VM.getVM().getBytes().swapShort((short) cpCacheIndex))).getConstantPoolIndex();
+ return cpCache.getEntryAt((int) (0xFFFF & cpCacheIndex)).getConstantPoolIndex();
}
}
}
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithKlass.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithKlass.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -33,15 +33,15 @@ public class BytecodeWithKlass extends B
}
protected Klass getKlass() {
- return method().getConstants().getKlassRefAt(index());
+ return method().getConstants().getKlassAt(index());
}
public Symbol getClassName() {
ConstantPool.CPSlot obj = method().getConstants().getSlotAt(index());
- if (obj.isMetaData()) {
+ if (obj.isUnresolved()) {
return obj.getSymbol();
} else {
- return ((Klass)obj.getOop()).getName();
+ return obj.getKlass().getName();
}
}
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
@@ -362,7 +362,7 @@ public class Bytecodes {
// find a bytecode, behind a breakpoint if necessary:
// FIXME: not yet implementable
- // static Code non_breakpoint_code_at(address bcp, methodOop method = null);
+ // static Code non_breakpoint_code_at(address bcp, Method* method = null);
// Bytecode attributes
public static boolean isDefined (int code) { return 0 <= code && code < number_of_codes && flags(code, false) != 0; }
@@ -743,7 +743,7 @@ public class Bytecodes {
def(_invokespecial , "invokespecial" , "bJJ" , null , BasicType.getTIllegal(), -1, true );
def(_invokestatic , "invokestatic" , "bJJ" , null , BasicType.getTIllegal(), 0, true );
def(_invokeinterface , "invokeinterface" , "bJJ__", null , BasicType.getTIllegal(), -1, true );
- def(_invokedynamic , "invokedynamic" , "bJJJJ", null , BasicType.getTIllegal(), -1, true );
+ def(_invokedynamic , "invokedynamic" , "bJJJJ", null , BasicType.getTIllegal(), 0, true );
def(_new , "new" , "bkk" , null , BasicType.getTObject() , 1, true );
def(_newarray , "newarray" , "bc" , null , BasicType.getTObject() , 0, true );
def(_anewarray , "anewarray" , "bkk" , null , BasicType.getTObject() , 0, true );
@@ -763,6 +763,7 @@ public class Bytecodes {
// JVM bytecodes
// bytecode bytecode name format wide f. result tp stk traps std code
+
def(_fast_agetfield , "fast_agetfield" , "bJJ" , null , BasicType.getTObject() , 0, true , _getfield );
def(_fast_bgetfield , "fast_bgetfield" , "bJJ" , null , BasicType.getTInt() , 0, true , _getfield );
def(_fast_cgetfield , "fast_cgetfield" , "bJJ" , null , BasicType.getTChar() , 0, true , _getfield );
--- a/agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java Sat Sep 01 13:25:18 2012 -0400
@@ -135,15 +135,15 @@ implements ReferenceType {
ReferenceTypeImpl other = (ReferenceTypeImpl)refType;
int comp = name().compareTo(other.name());
if (comp == 0) {
- Oop rf1 = ref();
- Oop rf2 = other.ref();
+ Klass rf1 = ref();
+ Klass rf2 = other.ref();
// optimize for typical case: refs equal and VMs equal
if (rf1.equals(rf2)) {
// sequenceNumbers are always positive
comp = vm.sequenceNumber -
((VirtualMachineImpl)(other.virtualMachine())).sequenceNumber;
} else {
- comp = rf1.getHandle().minus(rf2.getHandle()) < 0? -1 : 1;
+ comp = rf1.getAddress().minus(rf2.getAddress()) < 0? -1 : 1;
}
}
return comp;
@@ -225,7 +225,7 @@ implements ReferenceType {
private boolean isThrowableBacktraceField(sun.jvm.hotspot.oops.Field fld) {
// refer to JvmtiEnv::GetClassFields in jvmtiEnv.cpp.
// We want to filter out java.lang.Throwable.backtrace (see 4446677).
- // It contains some methodOops that aren't quite real Objects.
+ // It contains some Method*s that aren't quite real Objects.
if (fld.getFieldHolder().getName().equals(vm.javaLangThrowable()) &&
fld.getID().getName().equals("backtrace")) {
return true;
@@ -932,7 +932,7 @@ implements ReferenceType {
}
long uniqueID() {
- return vm.getAddressValue(ref());
+ return vm.getAddressValue(ref().getJavaMirror());
}
// new method since 1.6
--- a/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java Sat Sep 01 13:25:18 2012 -0400
@@ -447,7 +447,7 @@ public class VirtualMachineImpl extends
newRefType = new ClassTypeImpl(this, (InstanceKlass)kk);
}
} else {
- throw new RuntimeException("should not reach here");
+ throw new RuntimeException("should not reach here:" + kk);
}
typesByID.put(kk, newRefType);
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -168,7 +168,7 @@ public class CompactibleFreeListSpace ex
final long addressSize = vm.getAddressSize();
for (; cur.lessThan(limit);) {
- Address klassOop = cur.getAddressAt(addressSize);
+ Address k = cur.getAddressAt(addressSize);
if (FreeChunk.indicatesFreeChunk(cur)) {
if (! cur.equals(regionStart)) {
res.add(new MemRegion(regionStart, cur));
@@ -181,7 +181,7 @@ public class CompactibleFreeListSpace ex
// note that fc.size() gives chunk size in heap words
cur = cur.addOffsetTo(chunkSize * addressSize);
regionStart = cur;
- } else if (klassOop != null) {
+ } else if (k != null) {
Oop obj = heap.newOop(cur.addOffsetToAsOopHandle(0));
long objectSize = obj.getObjectSize();
cur = cur.addOffsetTo(adjustObjectSizeInBytes(objectSize));
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/Dictionary.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/Dictionary.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -63,10 +63,9 @@ public class Dictionary extends TwoOopHa
for (int index = 0; index < tblSize; index++) {
for (DictionaryEntry probe = (DictionaryEntry) bucket(index); probe != null;
probe = (DictionaryEntry) probe.next()) {
- Oop k = probe.klass();
- if (k.isKlass() &&
- heap.equal(probe.loader(), ((InstanceKlass) k).getClassLoader())) {
- v.visit((Klass) k);
+ Klass k = probe.klass();
+ if (heap.equal(probe.loader(), ((InstanceKlass) k).getClassLoader())) {
+ v.visit(k);
}
}
}
@@ -78,10 +77,8 @@ public class Dictionary extends TwoOopHa
for (int index = 0; index < tblSize; index++) {
for (DictionaryEntry probe = (DictionaryEntry) bucket(index); probe != null;
probe = (DictionaryEntry) probe.next()) {
- Oop k = probe.klass();
- if (k.isKlass()) {
- v.visit((Klass) k, probe.loader());
- }
+ Klass k = probe.klass();
+ v.visit(k, probe.loader());
}
}
}
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -25,6 +25,7 @@ package sun.jvm.hotspot.memory;
package sun.jvm.hotspot.memory;
import java.util.*;
+import sun.jvm.hotspot.classfile.ClassLoaderData;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.types.*;
@@ -43,12 +44,12 @@ public class DictionaryEntry extends sun
private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("DictionaryEntry");
pdSetField = type.getAddressField("_pd_set");
- loaderField = type.getOopField("_loader");
+ loaderDataField = type.getAddressField("_loader_data");
}
// Fields
private static AddressField pdSetField;
- private static sun.jvm.hotspot.types.OopField loaderField;
+ private static AddressField loaderDataField;
// Accessors
@@ -59,11 +60,15 @@ public class DictionaryEntry extends sun
}
public Oop loader() {
- return VM.getVM().getObjectHeap().newOop(loaderField.getValue(addr));
+ return loaderData().getClassLoader();
+ }
+
+ public ClassLoaderData loaderData() {
+ return ClassLoaderData.instantiateWrapperFor(loaderDataField.getValue(addr));
}
public Klass klass() {
- return (Klass)VM.getVM().getObjectHeap().newOop(literalValue().addOffsetToAsOopHandle(0));
+ return (Klass)Metadata.instantiateWrapperFor(literalValue());
}
public DictionaryEntry(Address addr) {
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/GenCollectedHeap.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/GenCollectedHeap.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -90,7 +90,7 @@ public class GenCollectedHeap extends Sh
}
}
- return permGen().isIn(a);
+ return false;
}
public long capacity() {
@@ -140,7 +140,5 @@ public class GenCollectedHeap extends Sh
tty.println("Invocations: " + getGen(i).invocations());
tty.println();
}
- permGen().printOn(tty);
- tty.println("Invocations: " + permGen().invocations());
}
}
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/Generation.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/Generation.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -39,7 +39,6 @@ import sun.jvm.hotspot.runtime.*;
<ul>
<li> OneContigSpaceCardGeneration
<ul>
- <li> CompactingPermGenGen
<li> TenuredGeneration
</ul>
</ul>
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/GenerationFactory.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/GenerationFactory.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -47,8 +47,6 @@ public class GenerationFactory {
private static synchronized void initialize(TypeDataBase db) {
ctor = new VirtualConstructor(db);
- ctor.addMapping("CompactingPermGenGen", CompactingPermGenGen.class);
- ctor.addMapping("CMSPermGenGen", CMSPermGenGen.class);
ctor.addMapping("DefNewGeneration", DefNewGeneration.class);
ctor.addMapping("ParNewGeneration", ParNewGeneration.class);
ctor.addMapping("TenuredGeneration", TenuredGeneration.class);
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/PlaceholderEntry.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/PlaceholderEntry.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -25,6 +25,7 @@ package sun.jvm.hotspot.memory;
package sun.jvm.hotspot.memory;
import java.util.*;
+import sun.jvm.hotspot.classfile.ClassLoaderData;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.types.*;
@@ -42,15 +43,19 @@ public class PlaceholderEntry extends su
private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("PlaceholderEntry");
- loaderField = type.getOopField("_loader");
+ loaderDataField = type.getAddressField("_loader_data");
}
// Field
- private static sun.jvm.hotspot.types.OopField loaderField;
+ private static AddressField loaderDataField;
// Accessor
public Oop loader() {
- return VM.getVM().getObjectHeap().newOop(loaderField.getValue(addr));
+ return loaderData().getClassLoader();
+ }
+
+ public ClassLoaderData loaderData() {
+ return ClassLoaderData.instantiateWrapperFor(loaderDataField.getValue(addr));
}
public PlaceholderEntry(Address addr) {
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/SharedHeap.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/SharedHeap.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -33,7 +33,6 @@ import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.types.*;
public abstract class SharedHeap extends CollectedHeap {
- private static AddressField permGenField;
private static VirtualConstructor ctor;
static {
@@ -46,31 +45,14 @@ public abstract class SharedHeap extends
private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("SharedHeap");
- permGenField = type.getAddressField("_perm_gen");
ctor = new VirtualConstructor(db);
- ctor.addMapping("CompactingPermGen", CompactingPermGen.class);
- ctor.addMapping("CMSPermGen", CMSPermGen.class);
-
}
public SharedHeap(Address addr) {
super(addr);
}
- /** These functions return the "permanent" generation, in which
- reflective objects are allocated and stored. Two versions, the
- second of which returns the view of the perm gen as a
- generation. (FIXME: this distinction is strange and seems
- unnecessary, and should be cleaned up.) */
- public PermGen perm() {
- return (PermGen) ctor.instantiateWrapperFor(permGenField.getValue(addr));
- }
-
public CollectedHeapName kind() {
return CollectedHeapName.SHARED_HEAP;
}
-
- public Generation permGen() {
- return perm().asGen();
}
-}
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java Sat Sep 01 13:25:18 2012 -0400
@@ -37,13 +37,13 @@ public class SystemDictionary {
private static AddressField loaderConstraintTableField;
private static sun.jvm.hotspot.types.OopField javaSystemLoaderField;
- private static sun.jvm.hotspot.types.OopField objectKlassField;
- private static sun.jvm.hotspot.types.OopField classLoaderKlassField;
- private static sun.jvm.hotspot.types.OopField stringKlassField;
- private static sun.jvm.hotspot.types.OopField systemKlassField;
- private static sun.jvm.hotspot.types.OopField threadKlassField;
- private static sun.jvm.hotspot.types.OopField threadGroupKlassField;
- private static sun.jvm.hotspot.types.OopField methodHandleKlassField;
+ private static AddressField objectKlassField;
+ private static AddressField classLoaderKlassField;
+ private static AddressField stringKlassField;
+ private static AddressField systemKlassField;
+ private static AddressField threadKlassField;
+ private static AddressField threadGroupKlassField;
+ private static AddressField methodHandleKlassField;
static {
VM.registerVMInitializedObserver(new Observer() {
@@ -62,13 +62,13 @@ public class SystemDictionary {
loaderConstraintTableField = type.getAddressField("_loader_constraints");
javaSystemLoaderField = type.getOopField("_java_system_loader");
- objectKlassField = type.getOopField(WK_KLASS("Object_klass"));
- classLoaderKlassField = type.getOopField(WK_KLASS("ClassLoader_klass"));
- stringKlassField = type.getOopField(WK_KLASS("String_klass"));
- systemKlassField = type.getOopField(WK_KLASS("System_klass"));
- threadKlassField = type.getOopField(WK_KLASS("Thread_klass"));
- threadGroupKlassField = type.getOopField(WK_KLASS("ThreadGroup_klass"));
- methodHandleKlassField = type.getOopField(WK_KLASS("MethodHandle_klass"));
+ objectKlassField = type.getAddressField(WK_KLASS("Object_klass"));
+ classLoaderKlassField = type.getAddressField(WK_KLASS("ClassLoader_klass"));
+ stringKlassField = type.getAddressField(WK_KLASS("String_klass"));
+ systemKlassField = type.getAddressField(WK_KLASS("System_klass"));
+ threadKlassField = type.getAddressField(WK_KLASS("Thread_klass"));
+ threadGroupKlassField = type.getAddressField(WK_KLASS("ThreadGroup_klass"));
+ methodHandleKlassField = type.getAddressField(WK_KLASS("MethodHandle_klass"));
}
// This WK functions must follow the definitions in systemDictionary.hpp:
@@ -104,31 +104,31 @@ public class SystemDictionary {
// few well known classes -- not all are added here.
// add more if needed.
public static InstanceKlass getThreadKlass() {
- return (InstanceKlass) newOop(threadKlassField.getValue());
+ return (InstanceKlass)Metadata.instantiateWrapperFor(threadKlassField.getValue());
}
public static InstanceKlass getThreadGroupKlass() {
- return (InstanceKlass) newOop(threadGroupKlassField.getValue());
+ return (InstanceKlass)Metadata.instantiateWrapperFor(threadGroupKlassField.getValue());
}
public static InstanceKlass getObjectKlass() {
- return (InstanceKlass) newOop(objectKlassField.getValue());
+ return (InstanceKlass)Metadata.instantiateWrapperFor(objectKlassField.getValue());
}
public static InstanceKlass getStringKlass() {
- return (InstanceKlass) newOop(stringKlassField.getValue());
+ return (InstanceKlass)Metadata.instantiateWrapperFor(stringKlassField.getValue());
}
public static InstanceKlass getClassLoaderKlass() {
- return (InstanceKlass) newOop(classLoaderKlassField.getValue());
+ return (InstanceKlass)Metadata.instantiateWrapperFor(classLoaderKlassField.getValue());
}
public static InstanceKlass getSystemKlass() {
- return (InstanceKlass) newOop(systemKlassField.getValue());
+ return (InstanceKlass)Metadata.instantiateWrapperFor(systemKlassField.getValue());
}
public static InstanceKlass getMethodHandleKlass() {
- return (InstanceKlass) newOop(methodHandleKlassField.getValue());
+ return (InstanceKlass)Metadata.instantiateWrapperFor(methodHandleKlassField.getValue());
}
public InstanceKlass getAbstractOwnableSynchronizerKlass() {
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -42,17 +42,14 @@ public class Universe {
private static sun.jvm.hotspot.types.OopField systemThreadGroupField;
// single dimensional primitive array klasses
- private static sun.jvm.hotspot.types.OopField boolArrayKlassObjField;
- private static sun.jvm.hotspot.types.OopField byteArrayKlassObjField;
- private static sun.jvm.hotspot.types.OopField charArrayKlassObjField;
- private static sun.jvm.hotspot.types.OopField intArrayKlassObjField;
- private static sun.jvm.hotspot.types.OopField shortArrayKlassObjField;
- private static sun.jvm.hotspot.types.OopField longArrayKlassObjField;
- private static sun.jvm.hotspot.types.OopField singleArrayKlassObjField;
- private static sun.jvm.hotspot.types.OopField doubleArrayKlassObjField;
-
- // system obj array klass object
- private static sun.jvm.hotspot.types.OopField systemObjArrayKlassObjField;
+ private static sun.jvm.hotspot.types.AddressField boolArrayKlassField;
+ private static sun.jvm.hotspot.types.AddressField byteArrayKlassField;
+ private static sun.jvm.hotspot.types.AddressField charArrayKlassField;
+ private static sun.jvm.hotspot.types.AddressField intArrayKlassField;
+ private static sun.jvm.hotspot.types.AddressField shortArrayKlassField;
+ private static sun.jvm.hotspot.types.AddressField longArrayKlassField;
+ private static sun.jvm.hotspot.types.AddressField singleArrayKlassField;
+ private static sun.jvm.hotspot.types.AddressField doubleArrayKlassField;
private static AddressField narrowOopBaseField;
private static CIntegerField narrowOopShiftField;
@@ -78,16 +75,14 @@ public class Universe {
mainThreadGroupField = type.getOopField("_main_thread_group");
systemThreadGroupField = type.getOopField("_system_thread_group");
- boolArrayKlassObjField = type.getOopField("_boolArrayKlassObj");
- byteArrayKlassObjField = type.getOopField("_byteArrayKlassObj");
- charArrayKlassObjField = type.getOopField("_charArrayKlassObj");
- intArrayKlassObjField = type.getOopField("_intArrayKlassObj");
- shortArrayKlassObjField = type.getOopField("_shortArrayKlassObj");
- longArrayKlassObjField = type.getOopField("_longArrayKlassObj");
- singleArrayKlassObjField = type.getOopField("_singleArrayKlassObj");
- doubleArrayKlassObjField = type.getOopField("_doubleArrayKlassObj");
-
- systemObjArrayKlassObjField = type.getOopField("_systemObjArrayKlassObj");
+ boolArrayKlassField = type.getAddressField("_boolArrayKlassObj");
+ byteArrayKlassField = type.getAddressField("_byteArrayKlassObj");
+ charArrayKlassField = type.getAddressField("_charArrayKlassObj");
+ intArrayKlassField = type.getAddressField("_intArrayKlassObj");
+ shortArrayKlassField = type.getAddressField("_shortArrayKlassObj");
+ longArrayKlassField = type.getAddressField("_longArrayKlassObj");
+ singleArrayKlassField = type.getAddressField("_singleArrayKlassObj");
+ doubleArrayKlassField = type.getAddressField("_doubleArrayKlassObj");
narrowOopBaseField = type.getAddressField("_narrow_oop._base");
narrowOopShiftField = type.getCIntegerField("_narrow_oop._shift");
@@ -138,21 +133,17 @@ public class Universe {
return newOop(systemThreadGroupField.getValue());
}
- public Oop systemObjArrayKlassObj() {
- return newOop(systemObjArrayKlassObjField.getValue());
- }
-
// iterate through the single dimensional primitive array klasses
- // refer to basic_type_classes_do(void f(klassOop)) in universe.cpp
+ // refer to basic_type_classes_do(void f(Klass*)) in universe.cpp
public void basicTypeClassesDo(SystemDictionary.ClassVisitor visitor) {
- visitor.visit((Klass)newOop(boolArrayKlassObjField.getValue()));
- visitor.visit((Klass)newOop(byteArrayKlassObjField.getValue()));
- visitor.visit((Klass)newOop(charArrayKlassObjField.getValue()));
- visitor.visit((Klass)newOop(intArrayKlassObjField.getValue()));
- visitor.visit((Klass)newOop(shortArrayKlassObjField.getValue()));
- visitor.visit((Klass)newOop(longArrayKlassObjField.getValue()));
- visitor.visit((Klass)newOop(singleArrayKlassObjField.getValue()));
- visitor.visit((Klass)newOop(doubleArrayKlassObjField.getValue()));
+ visitor.visit(new TypeArrayKlass(boolArrayKlassField.getValue()));
+ visitor.visit(new TypeArrayKlass(byteArrayKlassField.getValue()));
+ visitor.visit(new TypeArrayKlass(charArrayKlassField.getValue()));
+ visitor.visit(new TypeArrayKlass(intArrayKlassField.getValue()));
+ visitor.visit(new TypeArrayKlass(shortArrayKlassField.getValue()));
+ visitor.visit(new TypeArrayKlass(longArrayKlassField.getValue()));
+ visitor.visit(new TypeArrayKlass(singleArrayKlassField.getValue()));
+ visitor.visit(new TypeArrayKlass(doubleArrayKlassField.getValue()));
}
public void print() { printOn(System.out); }
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/AccessFlags.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/AccessFlags.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -57,7 +57,7 @@ public class AccessFlags implements /* i
public long getValue () { return flags; }
// Hotspot internal flags
- // methodOop flags
+ // Method* flags
public boolean isMonitorMatching () { return (flags & JVM_ACC_MONITOR_MATCH ) != 0; }
public boolean hasMonitorBytecodes () { return (flags & JVM_ACC_HAS_MONITOR_BYTECODES ) != 0; }
public boolean hasLoops () { return (flags & JVM_ACC_HAS_LOOPS ) != 0; }
@@ -69,13 +69,13 @@ public class AccessFlags implements /* i
public boolean hasJsrs () { return (flags & JVM_ACC_HAS_JSRS ) != 0; }
public boolean isObsolete () { return (flags & JVM_ACC_IS_OBSOLETE ) != 0; }
- // klassOop flags
+ // Klass* flags
public boolean hasMirandaMethods () { return (flags & JVM_ACC_HAS_MIRANDA_METHODS ) != 0; }
public boolean hasVanillaConstructor() { return (flags & JVM_ACC_HAS_VANILLA_CONSTRUCTOR) != 0; }
public boolean hasFinalizer () { return (flags & JVM_ACC_HAS_FINALIZER ) != 0; }
public boolean isCloneable () { return (flags & JVM_ACC_IS_CLONEABLE ) != 0; }
- // klassOop and methodOop flags
+ // Klass* and Method* flags
public boolean hasLocalVariableTable() { return (flags & JVM_ACC_HAS_LOCAL_VARIABLE_TABLE ) != 0; }
// field flags
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/Array.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/Array.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -59,7 +59,7 @@ public class Array extends Oop {
if (headerSize != 0) {
return headerSize;
}
- if (VM.getVM().isCompressedOopsEnabled()) {
+ if (VM.getVM().isCompressedHeadersEnabled()) {
headerSize = typeSize;
} else {
headerSize = VM.getVM().alignUp(typeSize + VM.getVM().getIntSize(),
@@ -80,7 +80,7 @@ public class Array extends Oop {
if (lengthOffsetInBytes != 0) {
return lengthOffsetInBytes;
}
- if (VM.getVM().isCompressedOopsEnabled()) {
+ if (VM.getVM().isCompressedHeadersEnabled()) {
lengthOffsetInBytes = typeSize - VM.getVM().getIntSize();
} else {
lengthOffsetInBytes = typeSize;
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayData.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayData.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -49,10 +49,6 @@ abstract class ArrayData extends Profile
int aindex = index + arrayStartOffSet;
return intAt(aindex);
}
- Oop arrayOopAt(int index) {
- int aindex = index + arrayStartOffSet;
- return oopAt(aindex);
- }
// Code generation support for subclasses.
static int arrayElementOffset(int index) {
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -45,24 +45,24 @@ public class ArrayKlass extends Klass {
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
Type type = db.lookupType("arrayKlass");
- dimension = new CIntField(type.getCIntegerField("_dimension"), Oop.getHeaderSize());
- higherDimension = new OopField(type.getOopField("_higher_dimension"), Oop.getHeaderSize());
- lowerDimension = new OopField(type.getOopField("_lower_dimension"), Oop.getHeaderSize());
- vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), Oop.getHeaderSize());
- allocSize = new CIntField(type.getCIntegerField("_alloc_size"), Oop.getHeaderSize());
- componentMirror = new OopField(type.getOopField("_component_mirror"), Oop.getHeaderSize());
+ dimension = new CIntField(type.getCIntegerField("_dimension"), 0);
+ higherDimension = new MetadataField(type.getAddressField("_higher_dimension"), 0);
+ lowerDimension = new MetadataField(type.getAddressField("_lower_dimension"), 0);
+ vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0);
+ allocSize = new CIntField(type.getCIntegerField("_alloc_size"), 0);
+ componentMirror = new OopField(type.getOopField("_component_mirror"), 0);
javaLangCloneableName = null;
javaLangObjectName = null;
javaIoSerializableName = null;
}
- ArrayKlass(OopHandle handle, ObjectHeap heap) {
- super(handle, heap);
+ public ArrayKlass(Address addr) {
+ super(addr);
}
private static CIntField dimension;
- private static OopField higherDimension;
- private static OopField lowerDimension;
+ private static MetadataField higherDimension;
+ private static MetadataField lowerDimension;
private static CIntField vtableLen;
private static CIntField allocSize;
private static OopField componentMirror;
@@ -141,19 +141,13 @@ public class ArrayKlass extends Klass {
tty.print("ArrayKlass");
}
- public long getObjectSize() {
- return alignObjectSize(InstanceKlass.getHeaderSize() + getVtableLen() * getHeap().getOopSize());
- }
-
- public void iterateFields(OopVisitor visitor, boolean doVMFields) {
- super.iterateFields(visitor, doVMFields);
- if (doVMFields) {
+ public void iterateFields(MetadataVisitor visitor) {
+ super.iterateFields(visitor);
visitor.doCInt(dimension, true);
- visitor.doOop(higherDimension, true);
- visitor.doOop(lowerDimension, true);
+ visitor.doMetadata(higherDimension, true);
+ visitor.doMetadata(lowerDimension, true);
visitor.doCInt(vtableLen, true);
visitor.doCInt(allocSize, true);
visitor.doOop(componentMirror, true);
}
}
-}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/BooleanField.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/BooleanField.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -25,6 +25,7 @@ package sun.jvm.hotspot.oops;
package sun.jvm.hotspot.oops;
import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.VMObject;
// The class for a boolean field simply provides access to the value.
public class BooleanField extends Field {
@@ -41,6 +42,7 @@ public class BooleanField extends Field
}
public boolean getValue(Oop obj) { return obj.getHandle().getJBooleanAt(getOffset()); }
+ public boolean getValue(VMObject obj) { return obj.getAddress().getJBooleanAt(getOffset()); }
public void setValue(Oop obj, boolean value) throws MutationException {
// Fix this: setJBooleanAt is missing in Address
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ByteField.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ByteField.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -25,6 +25,7 @@ package sun.jvm.hotspot.oops;
package sun.jvm.hotspot.oops;
import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.VMObject;
// The class for a byte field simply provides access to the value.
public class ByteField extends Field {
@@ -41,6 +42,7 @@ public class ByteField extends Field {
}
public byte getValue(Oop obj) { return obj.getHandle().getJByteAt(getOffset()); }
+ public byte getValue(VMObject obj) { return obj.getAddress().getJByteAt(getOffset()); }
public void setValue(Oop obj, char value) throws MutationException {
// Fix this: setJCharAt is missing in Address
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/CIntField.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/CIntField.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -24,6 +24,7 @@
package sun.jvm.hotspot.oops;
+import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.debugger.*;
// The class for an C int field simply provides access to the value.
@@ -39,7 +40,10 @@ public class CIntField extends Field {
private boolean isUnsigned;
public long getValue(Oop obj) {
- return obj.getHandle().getCIntegerAt(getOffset(), size, isUnsigned);
+ return getValue(obj.getHandle());
+ }
+ public long getValue(VMObject obj) {
+ return getValue(obj.getAddress());
}
public long getValue(Address addr) {
return addr.getCIntegerAt(getOffset(), size, isUnsigned);
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/CharField.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/CharField.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -25,6 +25,7 @@ package sun.jvm.hotspot.oops;
package sun.jvm.hotspot.oops;
import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.VMObject;
// The class for a char field simply provides access to the value.
public class CharField extends Field {
@@ -41,6 +42,7 @@ public class CharField extends Field {
}
public char getValue(Oop obj) { return obj.getHandle().getJCharAt(getOffset()); }
+ public char getValue(VMObject obj) { return obj.getAddress().getJCharAt(getOffset()); }
public void setValue(Oop obj, char value) throws MutationException {
// Fix this: setJCharAt is missing in Address
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/CheckedExceptionElement.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/CheckedExceptionElement.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
@@ -48,10 +48,10 @@ public class CheckedExceptionElement {
private static long offsetOfClassCPIndex;
- private OopHandle handle;
+ private Address handle;
private long offset;
- public CheckedExceptionElement(OopHandle handle, long offset) {
+ public CheckedExceptionElement(Address handle, long offset) {
this.handle = handle;
this.offset = offset;
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/CompiledICHolder.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/CompiledICHolder.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -30,7 +30,7 @@ import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
-public class CompiledICHolder extends Oop {
+public class CompiledICHolder extends VMObject {
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@@ -40,14 +40,14 @@ public class CompiledICHolder extends Oo
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type type = db.lookupType("compiledICHolderOopDesc");
- holderMethod = new OopField(type.getOopField("_holder_method"), 0);
- holderKlass = new OopField(type.getOopField("_holder_klass"), 0);
+ Type type = db.lookupType("CompiledICHolder");
+ holderMethod = new MetadataField(type.getAddressField("_holder_method"), 0);
+ holderKlass = new MetadataField(type.getAddressField("_holder_klass"), 0);
headerSize = type.getSize();
}
- CompiledICHolder(OopHandle handle, ObjectHeap heap) {
- super(handle, heap);
+ public CompiledICHolder(Address addr) {
+ super(addr);
}
public boolean isCompiledICHolder() { return true; }
@@ -55,8 +55,8 @@ public class CompiledICHolder extends Oo
private static long headerSize;
// Fields
- private static OopField holderMethod;
- private static OopField holderKlass;
+ private static MetadataField holderMethod;
+ private static MetadataField holderKlass;
// Accessors for declared fields
public Method getHolderMethod() { return (Method) holderMethod.getValue(this); }
@@ -65,16 +65,4 @@ public class CompiledICHolder extends Oo
public void printValueOn(PrintStream tty) {
tty.print("CompiledICHolder");
}
-
- public long getObjectSize() {
- return alignObjectSize(headerSize);
}
-
- void iterateFields(OopVisitor visitor, boolean doVMFields) {
- super.iterateFields(visitor, doVMFields);
- if (doVMFields) {
- visitor.doOop(holderMethod, true);
- visitor.doOop(holderKlass, true);
- }
- }
-}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java Sat Sep 01 13:25:18 2012 -0400
@@ -34,7 +34,7 @@ import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.utilities.*;
-public class ConstMethod extends Oop {
+public class ConstMethod extends VMObject {
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@@ -50,18 +50,18 @@ public class ConstMethod extends Oop {
private static int HAS_EXCEPTION_TABLE;
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type type = db.lookupType("constMethodOopDesc");
- constants = new OopField(type.getOopField("_constants"), 0);
+ Type type = db.lookupType("ConstMethod");
+ constants = new MetadataField(type.getAddressField("_constants"), 0);
constMethodSize = new CIntField(type.getCIntegerField("_constMethod_size"), 0);
flags = new ByteField(type.getJByteField("_flags"), 0);
// enum constants for flags
- HAS_LINENUMBER_TABLE = db.lookupIntConstant("constMethodOopDesc::_has_linenumber_table").intValue();
- HAS_CHECKED_EXCEPTIONS = db.lookupIntConstant("constMethodOopDesc::_has_checked_exceptions").intValue();
- HAS_LOCALVARIABLE_TABLE = db.lookupIntConstant("constMethodOopDesc::_has_localvariable_table").intValue();
- HAS_EXCEPTION_TABLE = db.lookupIntConstant("constMethodOopDesc::_has_exception_table").intValue();
-
- // Size of Java bytecodes allocated immediately after constMethodOop.
+ HAS_LINENUMBER_TABLE = db.lookupIntConstant("ConstMethod::_has_linenumber_table").intValue();
+ HAS_CHECKED_EXCEPTIONS = db.lookupIntConstant("ConstMethod::_has_checked_exceptions").intValue();
+ HAS_LOCALVARIABLE_TABLE = db.lookupIntConstant("ConstMethod::_has_localvariable_table").intValue();
+ HAS_EXCEPTION_TABLE = db.lookupIntConstant("ConstMethod::_has_exception_table").intValue();
+
+ // Size of Java bytecodes allocated immediately after ConstMethod*.
codeSize = new CIntField(type.getCIntegerField("_code_size"), 0);
nameIndex = new CIntField(type.getCIntegerField("_name_index"), 0);
signatureIndex = new CIntField(type.getCIntegerField("_signature_index"), 0);
@@ -81,12 +81,12 @@ public class ConstMethod extends Oop {
exceptionTableElementSize = type.getSize();
}
- ConstMethod(OopHandle handle, ObjectHeap heap) {
- super(handle, heap);
+ public ConstMethod(Address addr) {
+ super(addr);
}
// Fields
- private static OopField constants;
+ private static MetadataField constants;
private static CIntField constMethodSize;
private static ByteField flags;
private static CIntField codeSize;
@@ -104,8 +104,8 @@ public class ConstMethod extends Oop {
public Method getMethod() {
InstanceKlass ik = (InstanceKlass)getConstants().getPoolHolder();
- ObjArray methods = ik.getMethods();
- return (Method)methods.getObjAt(getIdNum());
+ MethodArray methods = ik.getMethods();
+ return methods.at((int)getIdNum());
}
// Accessors for declared fields
@@ -157,7 +157,7 @@ public class ConstMethod extends Oop {
/** Get a bytecode or breakpoint at the given bci */
public int getBytecodeOrBPAt(int bci) {
- return getHandle().getJByteAt(bytecodeOffset + bci) & 0xFF;
+ return getAddress().getJByteAt(bytecodeOffset + bci) & 0xFF;
}
public byte getBytecodeByteArg(int bci) {
@@ -215,23 +215,21 @@ public class ConstMethod extends Oop {
for( int i=0; i < bc.length; i++ )
{
long offs = bytecodeOffset + i;
- bc[i] = getHandle().getJByteAt( offs );
+ bc[i] = getAddress().getJByteAt( offs );
}
return bc;
}
- public long getObjectSize() {
- return getConstMethodSize() * getHeap().getOopSize();
+ public long getSize() {
+ return getConstMethodSize();
}
public void printValueOn(PrintStream tty) {
- tty.print("ConstMethod " + getName().asString() + getSignature().asString() + "@" + getHandle());
- }
-
- public void iterateFields(OopVisitor visitor, boolean doVMFields) {
- super.iterateFields(visitor, doVMFields);
- if (doVMFields) {
- visitor.doOop(constants, true);
+ tty.print("ConstMethod " + getName().asString() + getSignature().asString() + "@" + getAddress());
+ }
+
+ public void iterateFields(MetadataVisitor visitor) {
+ visitor.doMetadata(constants, true);
visitor.doCInt(constMethodSize, true);
visitor.doByte(flags, true);
visitor.doCInt(codeSize, true);
@@ -240,7 +238,6 @@ public class ConstMethod extends Oop {
visitor.doCInt(genericSignatureIndex, true);
visitor.doCInt(codeSize, true);
}
- }
// Accessors
@@ -266,7 +263,7 @@ public class ConstMethod extends Oop {
// The line numbers are a short array of 2-tuples [start_pc, line_number].
// Not necessarily sorted and not necessarily one-to-one.
CompressedLineNumberReadStream stream =
- new CompressedLineNumberReadStream(getHandle(), (int) offsetOfCompressedLineNumberTable());
+ new CompressedLineNumberReadStream(getAddress(), (int) offsetOfCompressedLineNumberTable());
while (stream.readPair()) {
if (stream.bci() == bci) {
// perfect match
@@ -290,7 +287,7 @@ public class ConstMethod extends Oop {
}
int len = getLineNumberTableLength();
CompressedLineNumberReadStream stream =
- new CompressedLineNumberReadStream(getHandle(), (int) offsetOfCompressedLineNumberTable());
+ new CompressedLineNumberReadStream(getAddress(), (int) offsetOfCompressedLineNumberTable());
LineNumberTableElement[] ret = new LineNumberTableElement[len];
for (int idx = 0; idx < len; idx++) {
@@ -316,7 +313,7 @@ public class ConstMethod extends Oop {
LocalVariableTableElement[] ret = new LocalVariableTableElement[getLocalVariableTableLength()];
long offset = offsetOfLocalVariableTable();
for (int i = 0; i < ret.length; i++) {
- ret[i] = new LocalVariableTableElement(getHandle(), offset);
+ ret[i] = new LocalVariableTableElement(getAddress(), offset);
offset += localVariableTableElementSize;
}
return ret;
@@ -333,7 +330,7 @@ public class ConstMethod extends Oop {
ExceptionTableElement[] ret = new ExceptionTableElement[getExceptionTableLength()];
long offset = offsetOfExceptionTable();
for (int i = 0; i < ret.length; i++) {
- ret[i] = new ExceptionTableElement(getHandle(), offset);
+ ret[i] = new ExceptionTableElement(getAddress(), offset);
offset += exceptionTableElementSize;
}
return ret;
@@ -350,7 +347,7 @@ public class ConstMethod extends Oop {
CheckedExceptionElement[] ret = new CheckedExceptionElement[getCheckedExceptionsLength()];
long offset = offsetOfCheckedExceptions();
for (int i = 0; i < ret.length; i++) {
- ret[i] = new CheckedExceptionElement(getHandle(), offset);
+ ret[i] = new CheckedExceptionElement(getAddress(), offset);
offset += checkedExceptionElementSize;
}
return ret;
@@ -370,14 +367,14 @@ public class ConstMethod extends Oop {
return bytecodeOffset + getCodeSize();
}
- // Offset of start of compressed line number table (see methodOop.hpp)
+ // Offset of start of compressed line number table (see method.hpp)
private long offsetOfCompressedLineNumberTable() {
return offsetOfCodeEnd() + (isNative() ? 2 * VM.getVM().getAddressSize() : 0);
}
- // Offset of last short in methodOop
+ // Offset of last short in Method*
private long offsetOfLastU2Element() {
- return getObjectSize() - 2;
+ return getSize() * VM.getVM().getObjectHeap().getOopSize() - 2;
}
private long offsetOfCheckedExceptionsLength() {
@@ -386,7 +383,7 @@ public class ConstMethod extends Oop {
private int getCheckedExceptionsLength() {
if (hasCheckedExceptions()) {
- return (int) getHandle().getCIntegerAt(offsetOfCheckedExceptionsLength(), 2, true);
+ return (int) getAddress().getCIntegerAt(offsetOfCheckedExceptionsLength(), 2, true);
} else {
return 0;
}
@@ -407,7 +404,7 @@ public class ConstMethod extends Oop {
int len = 0;
if (hasLineNumberTable()) {
CompressedLineNumberReadStream stream =
- new CompressedLineNumberReadStream(getHandle(), (int) offsetOfCompressedLineNumberTable());
+ new CompressedLineNumberReadStream(getAddress(), (int) offsetOfCompressedLineNumberTable());
while (stream.readPair()) {
len += 1;
}
@@ -417,7 +414,7 @@ public class ConstMethod extends Oop {
private int getLocalVariableTableLength() {
if (hasLocalVariableTable()) {
- return (int) getHandle().getCIntegerAt(offsetOfLocalVariableTableLength(), 2, true);
+ return (int) getAddress().getCIntegerAt(offsetOfLocalVariableTableLength(), 2, true);
} else {
return 0;
}
@@ -450,7 +447,7 @@ public class ConstMethod extends Oop {
private int getExceptionTableLength() {
if (hasExceptionTable()) {
- return (int) getHandle().getCIntegerAt(offsetOfExceptionTableLength(), 2, true);
+ return (int) getAddress().getCIntegerAt(offsetOfExceptionTableLength(), 2, true);
} else {
return 0;
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -34,8 +34,7 @@ import sun.jvm.hotspot.utilities.*;
// A ConstantPool is an oop containing class constants
// as described in the class file
-public class ConstantPool extends Oop implements ClassConstants {
-
+public class ConstantPool extends Metadata implements ClassConstants {
public class CPSlot {
private Address ptr;
@@ -46,24 +45,20 @@ public class ConstantPool extends Oop im
this.ptr = sym.getAddress().orWithMask(1);
}
- public boolean isOop() {
+ public boolean isResolved() {
return (ptr.minus(null) & 1) == 0;
}
- public boolean isMetaData() {
+ public boolean isUnresolved() {
return (ptr.minus(null) & 1) == 1;
}
public Symbol getSymbol() {
- if (isMetaData()) {
+ if (!isUnresolved()) throw new InternalError("not a symbol");
return Symbol.create(ptr.xorWithMask(1));
}
- throw new InternalError("not a symbol");
- }
- public Oop getOop() {
- if (isOop()) {
- return VM.getVM().getObjectHeap().newOop(ptr.addOffsetToAsOopHandle(0));
- }
- throw new InternalError("not an oop");
+ public Klass getKlass() {
+ if (!isResolved()) throw new InternalError("not klass");
+ return (Klass)Metadata.instantiateWrapperFor(ptr);
}
}
@@ -83,31 +78,35 @@ public class ConstantPool extends Oop im
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type type = db.lookupType("constantPoolOopDesc");
- tags = new OopField(type.getOopField("_tags"), 0);
- operands = new OopField(type.getOopField("_operands"), 0);
- cache = new OopField(type.getOopField("_cache"), 0);
- poolHolder = new OopField(type.getOopField("_pool_holder"), 0);
+ Type type = db.lookupType("ConstantPool");
+ tags = type.getAddressField("_tags");
+ operands = type.getAddressField("_operands");
+ cache = type.getAddressField("_cache");
+ poolHolder = new MetadataField(type.getAddressField("_pool_holder"), 0);
length = new CIntField(type.getCIntegerField("_length"), 0);
+ resolvedReferences = type.getAddressField("_resolved_references");
+ referenceMap = type.getAddressField("_reference_map");
headerSize = type.getSize();
elementSize = 0;
// fetch constants:
- INDY_BSM_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_bsm_offset").intValue();
- INDY_ARGC_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_argc_offset").intValue();
- INDY_ARGV_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_argv_offset").intValue();
- }
-
- ConstantPool(OopHandle handle, ObjectHeap heap) {
- super(handle, heap);
+ INDY_BSM_OFFSET = db.lookupIntConstant("ConstantPool::_indy_bsm_offset").intValue();
+ INDY_ARGC_OFFSET = db.lookupIntConstant("ConstantPool::_indy_argc_offset").intValue();
+ INDY_ARGV_OFFSET = db.lookupIntConstant("ConstantPool::_indy_argv_offset").intValue();
+ }
+
+ public ConstantPool(Address addr) {
+ super(addr);
}
public boolean isConstantPool() { return true; }
- private static OopField tags;
- private static OopField operands;
- private static OopField cache;
- private static OopField poolHolder;
+ private static AddressField tags;
+ private static AddressField operands;
+ private static AddressField cache;
+ private static MetadataField poolHolder;
private static CIntField length; // number of elements in oop
+ private static AddressField resolvedReferences;
+ private static AddressField referenceMap;
private static long headerSize;
private static long elementSize;
@@ -116,11 +115,31 @@ public class ConstantPool extends Oop im
private static int INDY_ARGC_OFFSET;
private static int INDY_ARGV_OFFSET;
- public TypeArray getTags() { return (TypeArray) tags.getValue(this); }
- public TypeArray getOperands() { return (TypeArray) operands.getValue(this); }
- public ConstantPoolCache getCache() { return (ConstantPoolCache) cache.getValue(this); }
+ public U1Array getTags() { return new U1Array(tags.getValue(getAddress())); }
+ public U2Array getOperands() { return new U2Array(operands.getValue(getAddress())); }
+ public ConstantPoolCache getCache() {
+ Address addr = cache.getValue(getAddress());
+ return (ConstantPoolCache) VMObjectFactory.newObject(ConstantPoolCache.class, addr);
+ }
public Klass getPoolHolder() { return (Klass) poolHolder.getValue(this); }
- public int getLength() { return (int)length.getValue(this); }
+ public int getLength() { return (int)length.getValue(getAddress()); }
+ public Oop getResolvedReferences() {
+ Address handle = resolvedReferences.getValue(getAddress());
+ if (handle != null) {
+ // Load through the handle
+ OopHandle refs = handle.getOopHandleAt(0);
+ return VM.getVM().getObjectHeap().newOop(refs);
+ }
+ return null;
+ }
+
+ public U2Array referenceMap() {
+ return new U2Array(referenceMap.getValue(getAddress()));
+ }
+
+ public int objectToCPIndex(int index) {
+ return referenceMap().at(index);
+ }
private long getElementSize() {
if (elementSize !=0 ) {
@@ -139,33 +158,32 @@ public class ConstantPool extends Oop im
}
public ConstantTag getTagAt(long index) {
- return new ConstantTag(getTags().getByteAt((int) index));
+ return new ConstantTag((byte)getTags().at((int) index));
}
public CPSlot getSlotAt(long index) {
- return new CPSlot(getHandle().getAddressAt(indexOffset(index)));
- }
-
- public Oop getObjAtRaw(long index){
- return getHeap().newOop(getHandle().getOopHandleAt(indexOffset(index)));
+ return new CPSlot(getAddressAtRaw(index));
+ }
+
+ public Address getAddressAtRaw(long index) {
+ return getAddress().getAddressAt(indexOffset(index));
}
public Symbol getSymbolAt(long index) {
- CPSlot slot = getSlotAt(index);
- return slot.getSymbol();
+ return Symbol.create(getAddressAtRaw(index));
}
public int getIntAt(long index){
- return getHandle().getJIntAt(indexOffset(index));
+ return getAddress().getJIntAt(indexOffset(index));
}
public float getFloatAt(long index){
- return getHandle().getJFloatAt(indexOffset(index));
+ return getAddress().getJFloatAt(indexOffset(index));
}
public long getLongAt(long index) {
- int oneHalf = getHandle().getJIntAt(indexOffset(index + 1));
- int otherHalf = getHandle().getJIntAt(indexOffset(index));
+ int oneHalf = getAddress().getJIntAt(indexOffset(index + 1));
+ int otherHalf = getAddress().getJIntAt(indexOffset(index));
// buildLongFromIntsPD accepts higher address value, lower address value
// in that order.
return VM.getVM().buildLongFromIntsPD(oneHalf, otherHalf);
@@ -185,7 +203,7 @@ public class ConstantPool extends Oop im
i = which;
} else {
// change byte-ordering and go via cache
- i = cache.getEntryAt(0xFFFF & VM.getVM().getBytes().swapShort((short) which)).getConstantPoolIndex();
+ i = cache.getEntryAt(0xFFFF & which).getConstantPoolIndex();
}
if (Assert.ASSERTS_ENABLED) {
Assert.that(getTagAt(i).isFieldOrMethod(), "Corrupted constant pool");
@@ -202,7 +220,7 @@ public class ConstantPool extends Oop im
public int[] getNameAndTypeAt(int which) {
if (Assert.ASSERTS_ENABLED) {
- Assert.that(getTagAt(which).isNameAndType(), "Corrupted constant pool");
+ Assert.that(getTagAt(which).isNameAndType(), "Corrupted constant pool: " + which + " " + getTagAt(which));
}
int i = getIntAt(which);
if (DEBUG) {
@@ -213,6 +231,10 @@ public class ConstantPool extends Oop im
public Symbol getNameRefAt(int which) {
return implGetNameRefAt(which, false);
+ }
+
+ public Symbol uncachedGetNameRefAt(int which) {
+ return implGetNameRefAt(which, true);
}
private Symbol implGetNameRefAt(int which, boolean uncached) {
@@ -224,35 +246,57 @@ public class ConstantPool extends Oop im
return implGetSignatureRefAt(which, false);
}
+ public Symbol uncachedGetSignatureRefAt(int which) {
+ return implGetSignatureRefAt(which, true);
+ }
+
private Symbol implGetSignatureRefAt(int which, boolean uncached) {
int signatureIndex = getSignatureRefIndexAt(implNameAndTypeRefIndexAt(which, uncached));
return getSymbolAt(signatureIndex);
}
+ public static boolean isInvokedynamicIndex(int i) { return (i < 0); }
+
+ public static int decodeInvokedynamicIndex(int i) { Assert.that(isInvokedynamicIndex(i), ""); return ~i; }
+
+ // The invokedynamic points at the object index. The object map points at
+ // the cpCache index and the cpCache entry points at the original constant
+ // pool index.
+ public int invokedynamicCPCacheIndex(int index) {
+ Assert.that(isInvokedynamicIndex(index), "should be a invokedynamic index");
+ int rawIndex = decodeInvokedynamicIndex(index);
+ return referenceMap().at(rawIndex);
+ }
+
+ ConstantPoolCacheEntry invokedynamicCPCacheEntryAt(int index) {
+ // decode index that invokedynamic points to.
+ int cpCacheIndex = invokedynamicCPCacheIndex(index);
+ return getCache().getEntryAt(cpCacheIndex);
+ }
private int implNameAndTypeRefIndexAt(int which, boolean uncached) {
int i = which;
if (!uncached && getCache() != null) {
- if (ConstantPoolCache.isSecondaryIndex(which)) {
- // Invokedynamic index.
- int pool_index = getCache().getMainEntryAt(which).getConstantPoolIndex();
- pool_index = invokeDynamicNameAndTypeRefIndexAt(pool_index);
- // assert(tagAt(pool_index).isNameAndType(), "");
- return pool_index;
+ if (isInvokedynamicIndex(which)) {
+ // Invokedynamic index is index into resolved_references
+ int poolIndex = invokedynamicCPCacheEntryAt(which).getConstantPoolIndex();
+ poolIndex = invokeDynamicNameAndTypeRefIndexAt(poolIndex);
+ Assert.that(getTagAt(poolIndex).isNameAndType(), "");
+ return poolIndex;
}
// change byte-ordering and go via cache
i = remapInstructionOperandFromCache(which);
} else {
if (getTagAt(which).isInvokeDynamic()) {
- int pool_index = invokeDynamicNameAndTypeRefIndexAt(which);
- // assert(tag_at(pool_index).is_name_and_type(), "");
- return pool_index;
+ int poolIndex = invokeDynamicNameAndTypeRefIndexAt(which);
+ Assert.that(getTagAt(poolIndex).isNameAndType(), "");
+ return poolIndex;
}
}
// assert(tag_at(i).is_field_or_method(), "Corrupted constant pool");
// assert(!tag_at(i).is_invoke_dynamic(), "Must be handled above");
- int ref_index = getIntAt(i);
- return extractHighShortFromInt(ref_index);
+ int refIndex = getIntAt(i);
+ return extractHighShortFromInt(refIndex);
}
private int remapInstructionOperandFromCache(int operand) {
@@ -269,16 +313,29 @@ public class ConstantPool extends Oop im
}
// returns null, if not resolved.
- public Klass getKlassRefAt(int which) {
+ public Klass getKlassAt(int which) {
if( ! getTagAt(which).isKlass()) return null;
- return (Klass) getObjAtRaw(which);
+ return (Klass)Metadata.instantiateWrapperFor(getAddressAtRaw(which));
+ }
+
+ public Symbol getKlassNameAt(int which) {
+ CPSlot entry = getSlotAt(which);
+ if (entry.isResolved()) {
+ return entry.getKlass().getName();
+ } else {
+ return entry.getSymbol();
+ }
+ }
+
+ public Symbol getUnresolvedStringAt(int which) {
+ return getSymbolAt(which);
}
// returns null, if not resolved.
public InstanceKlass getFieldOrMethodKlassRefAt(int which) {
int refIndex = getFieldOrMethodAt(which);
int klassIndex = extractLowShortFromInt(refIndex);
- return (InstanceKlass) getKlassRefAt(klassIndex);
+ return (InstanceKlass) getKlassAt(klassIndex);
}
// returns null, if not resolved.
@@ -371,16 +428,16 @@ public class ConstantPool extends Oop im
Assert.that(getTagAt(i).isInvokeDynamic(), "Corrupted constant pool");
}
int bsmSpec = extractLowShortFromInt(this.getIntAt(i));
- TypeArray operands = getOperands();
+ U2Array operands = getOperands();
if (operands == null) return null; // safety first
- int basePos = VM.getVM().buildIntFromShorts(operands.getShortAt(bsmSpec * 2 + 0),
- operands.getShortAt(bsmSpec * 2 + 1));
+ int basePos = VM.getVM().buildIntFromShorts(operands.at(bsmSpec * 2 + 0),
+ operands.at(bsmSpec * 2 + 1));
int argv = basePos + INDY_ARGV_OFFSET;
- int argc = operands.getShortAt(basePos + INDY_ARGC_OFFSET);
+ int argc = operands.at(basePos + INDY_ARGC_OFFSET);
int endPos = argv + argc;
short[] values = new short[endPos - basePos];
for (int j = 0; j < values.length; j++) {
- values[j] = operands.getShortAt(basePos+j);
+ values[j] = operands.at(basePos+j);
}
return values;
}
@@ -407,25 +464,24 @@ public class ConstantPool extends Oop im
case JVM_CONSTANT_InvokeDynamic: return "JVM_CONSTANT_InvokeDynamic";
case JVM_CONSTANT_Invalid: return "JVM_CONSTANT_Invalid";
case JVM_CONSTANT_UnresolvedClass: return "JVM_CONSTANT_UnresolvedClass";
+ case JVM_CONSTANT_ClassIndex: return "JVM_CONSTANT_ClassIndex";
+ case JVM_CONSTANT_StringIndex: return "JVM_CONSTANT_StringIndex";
case JVM_CONSTANT_UnresolvedClassInError: return "JVM_CONSTANT_UnresolvedClassInError";
- case JVM_CONSTANT_ClassIndex: return "JVM_CONSTANT_ClassIndex";
- case JVM_CONSTANT_UnresolvedString: return "JVM_CONSTANT_UnresolvedString";
- case JVM_CONSTANT_StringIndex: return "JVM_CONSTANT_StringIndex";
+ case JVM_CONSTANT_MethodHandleInError:return "JVM_CONSTANT_MethodHandleInError";
+ case JVM_CONSTANT_MethodTypeInError: return "JVM_CONSTANT_MethodTypeInError";
+ case JVM_CONSTANT_Object: return "JVM_CONSTANT_Object";
}
throw new InternalError("Unknown tag: " + tag);
}
- public void iterateFields(OopVisitor visitor, boolean doVMFields) {
- super.iterateFields(visitor, doVMFields);
- if (doVMFields) {
- visitor.doOop(tags, true);
- visitor.doOop(cache, true);
- visitor.doOop(poolHolder, true);
+ public void iterateFields(MetadataVisitor visitor) {
+ super.iterateFields(visitor);
+ visitor.doMetadata(poolHolder, true);
final int length = (int) getLength();
// zero'th pool entry is always invalid. ignore it.
for (int index = 1; index < length; index++) {
- int ctag = (int) getTags().getByteAt((int) index);
+ int ctag = (int) getTags().at((int) index);
switch (ctag) {
case JVM_CONSTANT_ClassIndex:
case JVM_CONSTANT_StringIndex:
@@ -452,7 +508,6 @@ public class ConstantPool extends Oop im
case JVM_CONSTANT_UnresolvedClassInError:
case JVM_CONSTANT_UnresolvedClass:
case JVM_CONSTANT_Class:
- case JVM_CONSTANT_UnresolvedString:
case JVM_CONSTANT_Utf8:
visitor.doOop(new OopField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true);
break;
@@ -469,27 +524,19 @@ public class ConstantPool extends Oop im
}
}
}
- /*
- int length = getLength();
- for (int index = 0; index < length; index++) {
- long offset = baseOffset + (index + typeDataBase.getOopSize());
- visitor.doOop(new IndexableField(index, offset, false), getObjAt(index));
- }
- */
- }
public void writeBytes(OutputStream os) throws IOException {
// Map between any modified UTF-8 and it's constant pool index.
Map utf8ToIndex = new HashMap();
DataOutputStream dos = new DataOutputStream(os);
- TypeArray tags = getTags();
+ U1Array tags = getTags();
int len = (int)getLength();
int ci = 0; // constant pool index
// collect all modified UTF-8 Strings from Constant Pool
for (ci = 1; ci < len; ci++) {
- byte cpConstType = tags.getByteAt(ci);
+ int cpConstType = tags.at(ci);
if(cpConstType == JVM_CONSTANT_Utf8) {
Symbol sym = getSymbolAt(ci);
utf8ToIndex.put(sym.asString(), new Short((short) ci));
@@ -502,7 +549,7 @@ public class ConstantPool extends Oop im
for(ci = 1; ci < len; ci++) {
- int cpConstType = (int)tags.getByteAt(ci);
+ int cpConstType = tags.at(ci);
// write cp_info
// write constant type
switch(cpConstType) {
@@ -548,8 +595,8 @@ public class ConstantPool extends Oop im
case JVM_CONSTANT_Class: {
dos.writeByte(cpConstType);
- // Klass already resolved. ConstantPool constains klassOop.
- Klass refKls = (Klass) getObjAtRaw(ci);
+ // Klass already resolved. ConstantPool constains Klass*.
+ Klass refKls = (Klass)Metadata.instantiateWrapperFor(getAddressAtRaw(ci));
String klassName = refKls.getName().asString();
Short s = (Short) utf8ToIndex.get(klassName);
dos.writeShort(s.shortValue());
@@ -570,19 +617,8 @@ public class ConstantPool extends Oop im
case JVM_CONSTANT_String: {
dos.writeByte(cpConstType);
- String str = OopUtilities.stringOopToString(getObjAtRaw(ci));
+ String str = getUnresolvedStringAt(ci).asString();
Short s = (Short) utf8ToIndex.get(str);
- dos.writeShort(s.shortValue());
- if (DEBUG) debugMessage("CP[" + ci + "] = string " + s);
- break;
- }
-
- // case JVM_CONSTANT_StringIndex:
- case JVM_CONSTANT_UnresolvedString: {
- dos.writeByte(JVM_CONSTANT_String);
- String val = getSymbolAt(ci).asString();
-
- Short s = (Short) utf8ToIndex.get(val);
dos.writeShort(s.shortValue());
if (DEBUG) debugMessage("CP[" + ci + "] = string " + s);
break;
@@ -618,12 +654,21 @@ public class ConstantPool extends Oop im
case JVM_CONSTANT_MethodHandle: {
dos.writeByte(cpConstType);
int value = getIntAt(ci);
- short nameIndex = (short) extractLowShortFromInt(value);
- short signatureIndex = (short) extractHighShortFromInt(value);
- dos.writeShort(nameIndex);
- dos.writeShort(signatureIndex);
- if (DEBUG) debugMessage("CP[" + ci + "] = N&T name = " + nameIndex
- + ", type = " + signatureIndex);
+ byte refKind = (byte) extractLowShortFromInt(value);
+ short memberIndex = (short) extractHighShortFromInt(value);
+ dos.writeByte(refKind);
+ dos.writeShort(memberIndex);
+ if (DEBUG) debugMessage("CP[" + ci + "] = MH kind = " +
+ refKind + ", mem = " + memberIndex);
+ break;
+ }
+
+ case JVM_CONSTANT_MethodType: {
+ dos.writeByte(cpConstType);
+ int value = getIntAt(ci);
+ short refIndex = (short) value;
+ dos.writeShort(refIndex);
+ if (DEBUG) debugMessage("CP[" + ci + "] = MT index = " + refIndex);
break;
}
@@ -634,13 +679,13 @@ public class ConstantPool extends Oop im
short nameAndTypeIndex = (short) extractHighShortFromInt(value);
dos.writeShort(bsmIndex);
dos.writeShort(nameAndTypeIndex);
- if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + bsmIndex
- + ", N&T = " + nameAndTypeIndex);
+ if (DEBUG) debugMessage("CP[" + ci + "] = INDY bsm = " +
+ bsmIndex + ", N&T = " + nameAndTypeIndex);
break;
}
default:
- throw new InternalError("unknown tag: " + cpConstType);
+ throw new InternalError("Unknown tag: " + cpConstType);
} // switch
}
dos.flush();
@@ -648,16 +693,11 @@ public class ConstantPool extends Oop im
}
public void printValueOn(PrintStream tty) {
- Oop holder = poolHolder.getValue(this);
- if (holder instanceof Klass) {
- tty.print("ConstantPool for " + ((Klass)holder).getName().asString());
- } else {
- tty.print("ConstantPool for partially loaded class");
- }
- }
-
- public long getObjectSize() {
- return alignObjectSize(headerSize + (getLength() * getElementSize()));
+ tty.print("ConstantPool for " + getPoolHolder().getName().asString());
+ }
+
+ public long getSize() {
+ return Oop.alignObjectSize(headerSize + getLength());
}
//----------------------------------------------------------------------
@@ -665,12 +705,12 @@ public class ConstantPool extends Oop im
//
private static int extractHighShortFromInt(int val) {
- // must stay in sync with constantPoolOopDesc::name_and_type_at_put, method_at_put, etc.
+ // must stay in sync with ConstantPool::name_and_type_at_put, method_at_put, etc.
return (val >> 16) & 0xFFFF;
}
private static int extractLowShortFromInt(int val) {
- // must stay in sync with constantPoolOopDesc::name_and_type_at_put, method_at_put, etc.
+ // must stay in sync with ConstantPool::name_and_type_at_put, method_at_put, etc.
return val & 0xFFFF;
}
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -31,10 +31,10 @@ import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.utilities.*;
-// ConstantPoolCache : A constant pool cache (constantPoolCacheOopDesc).
-// See cpCacheOop.hpp for details about this class.
+// ConstantPoolCache : A constant pool cache (ConstantPoolCache).
+// See cpCache.hpp for details about this class.
//
-public class ConstantPoolCache extends Oop {
+public class ConstantPoolCache extends Metadata {
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@@ -44,31 +44,33 @@ public class ConstantPoolCache extends O
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type type = db.lookupType("constantPoolCacheOopDesc");
- constants = new OopField(type.getOopField("_constant_pool"), 0);
+ Type type = db.lookupType("ConstantPoolCache");
+ constants = new MetadataField(type.getAddressField("_constant_pool"), 0);
baseOffset = type.getSize();
Type elType = db.lookupType("ConstantPoolCacheEntry");
elementSize = elType.getSize();
length = new CIntField(type.getCIntegerField("_length"), 0);
+ intSize = VM.getVM().getObjectHeap().getIntSize();
}
- ConstantPoolCache(OopHandle handle, ObjectHeap heap) {
- super(handle, heap);
+ public ConstantPoolCache(Address addr) {
+ super(addr);
}
public boolean isConstantPoolCache() { return true; }
- private static OopField constants;
+ private static MetadataField constants;
private static long baseOffset;
private static long elementSize;
private static CIntField length;
+ private static long intSize;
public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); }
- public long getObjectSize() {
- return alignObjectSize(baseOffset + getLength() * elementSize);
+ public long getSize() {
+ return Oop.alignObjectSize(baseOffset + getLength() * elementSize);
}
public ConstantPoolCacheEntry getEntryAt(int i) {
@@ -76,41 +78,10 @@ public class ConstantPoolCache extends O
return new ConstantPoolCacheEntry(this, i);
}
- public static boolean isSecondaryIndex(int i) { return (i < 0); }
- public static int decodeSecondaryIndex(int i) { return isSecondaryIndex(i) ? ~i : i; }
- public static int encodeSecondaryIndex(int i) { return !isSecondaryIndex(i) ? ~i : i; }
-
- // secondary entries hold invokedynamic call site bindings
- public ConstantPoolCacheEntry getSecondaryEntryAt(int i) {
- int rawIndex = i;
- if (isSecondaryIndex(i)) {
- rawIndex = decodeSecondaryIndex(i);
- }
- ConstantPoolCacheEntry e = getEntryAt(rawIndex);
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(e.isSecondaryEntry(), "must be a secondary entry:" + rawIndex);
- }
- return e;
- }
-
- public ConstantPoolCacheEntry getMainEntryAt(int i) {
- int primaryIndex = i;
- if (isSecondaryIndex(i)) {
- // run through an extra level of indirection:
- int rawIndex = decodeSecondaryIndex(i);
- primaryIndex = getEntryAt(rawIndex).getMainEntryIndex();
- }
- ConstantPoolCacheEntry e = getEntryAt(primaryIndex);
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(!e.isSecondaryEntry(), "must not be a secondary entry:" + primaryIndex);
- }
- return e;
- }
-
public int getIntAt(int entry, int fld) {
//alignObjectSize ?
- long offset = baseOffset + /*alignObjectSize*/entry * elementSize + fld* getHeap().getIntSize();
- return (int) getHandle().getCIntegerAt(offset, getHeap().getIntSize(), true );
+ long offset = baseOffset + /*alignObjectSize*/entry * elementSize + fld * intSize;
+ return (int) getAddress().getCIntegerAt(offset, intSize, true );
}
@@ -119,17 +90,15 @@ public class ConstantPoolCache extends O
}
public int getLength() {
- return (int) length.getValue(this);
+ return (int) length.getValue(getAddress());
}
- public void iterateFields(OopVisitor visitor, boolean doVMFields) {
- super.iterateFields(visitor, doVMFields);
- if (doVMFields) {
- visitor.doOop(constants, true);
+ public void iterateFields(MetadataVisitor visitor) {
+ super.iterateFields(visitor);
+ visitor.doMetadata(constants, true);
for (int i = 0; i < getLength(); i++) {
ConstantPoolCacheEntry entry = getEntryAt(i);
entry.iterateFields(visitor);
}
}
- }
};
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
@@ -34,7 +34,7 @@ public class ConstantPoolCacheEntry {
private static long size;
private static long baseOffset;
private static CIntegerField indices;
- private static sun.jvm.hotspot.types.OopField f1;
+ private static AddressField f1;
private static CIntegerField f2;
private static CIntegerField flags;
@@ -54,11 +54,11 @@ public class ConstantPoolCacheEntry {
size = type.getSize();
indices = type.getCIntegerField("_indices");
- f1 = type.getOopField ("_f1");
+ f1 = type.getAddressField ("_f1");
f2 = type.getCIntegerField("_f2");
flags = type.getCIntegerField("_flags");
- type = db.lookupType("constantPoolCacheOopDesc");
+ type = db.lookupType("ConstantPoolCache");
baseOffset = type.getSize();
}
@@ -69,43 +69,32 @@ public class ConstantPoolCacheEntry {
public int getConstantPoolIndex() {
if (Assert.ASSERTS_ENABLED) {
- Assert.that(!isSecondaryEntry(), "must not be a secondary CP entry");
+ Assert.that((getIndices() & 0xFFFF) != 0, "must be main entry");
}
return (int) (getIndices() & 0xFFFF);
}
- public boolean isSecondaryEntry() {
- return (getIndices() & 0xFFFF) == 0;
+ private long getIndices() {
+ return cp.getAddress().getCIntegerAt(indices.getOffset() + offset, indices.getSize(), indices.isUnsigned());
}
- public int getMainEntryIndex() {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(isSecondaryEntry(), "must be a secondary CP entry");
- }
- return (int) (getIndices() >>> 16);
- }
-
- private long getIndices() {
- return cp.getHandle().getCIntegerAt(indices.getOffset() + offset, indices.getSize(), indices.isUnsigned());
- }
-
- public Oop getF1() {
- return cp.getHeap().newOop(cp.getHandle().getOopHandleAt(f1.getOffset() + offset));
+ public Metadata getF1() {
+ return Metadata.instantiateWrapperFor(cp.getAddress().getAddressAt(f1.getOffset() + offset));
}
public int getF2() {
- return cp.getHandle().getJIntAt(f1.getOffset() + offset);
+ return cp.getAddress().getJIntAt(f1.getOffset() + offset);
}
public int getFlags() {
- return cp.getHandle().getJIntAt(flags.getOffset() + offset);
+ return cp.getAddress().getJIntAt(flags.getOffset() + offset);
}
static NamedFieldIdentifier f1FieldName = new NamedFieldIdentifier("_f1");
static NamedFieldIdentifier f2FieldName = new NamedFieldIdentifier("_f2");
static NamedFieldIdentifier flagsFieldName = new NamedFieldIdentifier("_flags");
- public void iterateFields(OopVisitor visitor) {
+ public void iterateFields(MetadataVisitor visitor) {
visitor.doOop(new OopField(f1FieldName, f1.getOffset() + offset, true), true);
visitor.doInt(new IntField(f2FieldName, f2.getOffset() + offset, true), true);
visitor.doInt(new IntField(flagsFieldName, flags.getOffset() + offset, true), true);
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/DataLayout.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/DataLayout.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -64,7 +64,7 @@ public class DataLayout {
private boolean handlized;
public DataLayout(MethodData d, int o) {
- data = d.getHandle();
+ data = d.getAddress();
offset = o;
}
@@ -87,15 +87,6 @@ public class DataLayout {
int cellAt(int index) {
// Cells are intptr_t sized but only contain ints as raw values
return (int)data.getCIntegerAt(offset + cellOffset(index), MethodData.cellSize, false);
- }
-
- Oop oopAt(int index) {
- OopHandle handle;
- if (handlized) {
- throw new InternalError("unsupported");
- }
- handle = data.getOopHandleAt(offset + cellOffset(index));
- return VM.getVM().getObjectHeap().newOop(handle);
}
public Address addressAt(int index) {
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultOopVisitor.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultOopVisitor.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -45,6 +45,7 @@ public class DefaultOopVisitor implement
}
// Callback methods for each field type in an object
+ public void doMetadata(MetadataField field, boolean isVMField) {}
public void doOop(OopField field, boolean isVMField) {}
public void doOop(NarrowOopField field, boolean isVMField) {}
public void doByte(ByteField field, boolean isVMField) {}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/DoubleField.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/DoubleField.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -25,6 +25,7 @@ package sun.jvm.hotspot.oops;
package sun.jvm.hotspot.oops;
import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.VMObject;
// The class for a double field simply provides access to the value.
public class DoubleField extends Field {
@@ -41,6 +42,7 @@ public class DoubleField extends Field {
}
public double getValue(Oop obj) { return obj.getHandle().getJDoubleAt(getOffset()); }
+ public double getValue(VMObject obj) { return obj.getAddress().getJDoubleAt(getOffset()); }
public void setValue(Oop obj, double value) throws MutationException {
// Fix this: setJDoubleAt is missing in Address
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ExceptionTableElement.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ExceptionTableElement.java Sat Sep 01 13:25:18 2012 -0400
@@ -54,10 +54,10 @@ public class ExceptionTableElement {
private static long offsetOfHandlerPC;
private static long offsetOfCatchTypeIndex;
- private OopHandle handle;
+ private Address handle;
private long offset;
- public ExceptionTableElement(OopHandle handle, long offset) {
+ public ExceptionTableElement(Address handle, long offset) {
this.handle = handle;
this.offset = offset;
}
@@ -78,4 +78,3 @@ public class ExceptionTableElement {
return (int) handle.getCIntegerAt(offset + offsetOfCatchTypeIndex, 2, true);
}
}
-
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/Field.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/Field.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -27,6 +27,7 @@ import java.io.*;
import java.io.*;
import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.utilities.*;
// Super class for all fields in an object
public class Field {
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/FloatField.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/FloatField.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -25,6 +25,7 @@ package sun.jvm.hotspot.oops;
package sun.jvm.hotspot.oops;
import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.VMObject;
// The class for a float field simply provides access to the value.
public class FloatField extends Field {
@@ -41,6 +42,7 @@ public class FloatField extends Field {
}
public float getValue(Oop obj) { return obj.getHandle().getJFloatAt(getOffset()); }
+ public float getValue(VMObject obj) { return obj.getAddress().getJFloatAt(getOffset()); }
public void setValue(Oop obj, float value) throws MutationException {
// Fix this: setJFloatAt is missing in Address
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java Sat Sep 01 13:25:18 2012 -0400
@@ -613,7 +613,7 @@ public class GenerateOopMap {
tty.print(" idx " + idx);
/*
int idx = currentBC.getIndexU2();
- constantPoolOop cp = method().constants();
+ ConstantPool* cp = method().constants();
int nameAndTypeIdx = cp.name_and_type_ref_index_at(idx);
int signatureIdx = cp.signature_ref_index_at(nameAndTypeIdx);
Symbol* signature = cp.symbol_at(signatureIdx);
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/Instance.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/Instance.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -53,7 +53,7 @@ public class Instance extends Oop {
// Returns header size in bytes.
public static long getHeaderSize() {
- if (VM.getVM().isCompressedOopsEnabled()) {
+ if (VM.getVM().isCompressedHeadersEnabled()) {
return typeSize - VM.getVM().getIntSize();
} else {
return typeSize;
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java Sat Sep 01 13:25:18 2012 -0400
@@ -26,6 +26,7 @@ package sun.jvm.hotspot.oops;
import java.io.*;
import java.util.*;
+import sun.jvm.hotspot.classfile.ClassLoaderData;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.runtime.*;
@@ -53,7 +54,6 @@ public class InstanceKlass extends Klass
private static int FIELD_SLOTS;
// ClassState constants
- private static int CLASS_STATE_UNPARSABLE_BY_GC;
private static int CLASS_STATE_ALLOCATED;
private static int CLASS_STATE_LOADED;
private static int CLASS_STATE_LINKED;
@@ -62,34 +62,34 @@ public class InstanceKlass extends Klass
private static int CLASS_STATE_INITIALIZATION_ERROR;
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type type = db.lookupType("instanceKlass");
- arrayKlasses = new OopField(type.getOopField("_array_klasses"), Oop.getHeaderSize());
- methods = new OopField(type.getOopField("_methods"), Oop.getHeaderSize());
- methodOrdering = new OopField(type.getOopField("_method_ordering"), Oop.getHeaderSize());
- localInterfaces = new OopField(type.getOopField("_local_interfaces"), Oop.getHeaderSize());
- transitiveInterfaces = new OopField(type.getOopField("_transitive_interfaces"), Oop.getHeaderSize());
- fields = new OopField(type.getOopField("_fields"), Oop.getHeaderSize());
- javaFieldsCount = new CIntField(type.getCIntegerField("_java_fields_count"), Oop.getHeaderSize());
- constants = new OopField(type.getOopField("_constants"), Oop.getHeaderSize());
- classLoader = new OopField(type.getOopField("_class_loader"), Oop.getHeaderSize());
- protectionDomain = new OopField(type.getOopField("_protection_domain"), Oop.getHeaderSize());
- signers = new OopField(type.getOopField("_signers"), Oop.getHeaderSize());
+ Type type = db.lookupType("InstanceKlass");
+ arrayKlasses = new MetadataField(type.getAddressField("_array_klasses"), 0);
+ methods = type.getAddressField("_methods");
+ methodOrdering = type.getAddressField("_method_ordering");
+ localInterfaces = type.getAddressField("_local_interfaces");
+ transitiveInterfaces = type.getAddressField("_transitive_interfaces");
+ fields = type.getAddressField("_fields");
+ javaFieldsCount = new CIntField(type.getCIntegerField("_java_fields_count"), 0);
+ constants = new MetadataField(type.getAddressField("_constants"), 0);
+ classLoaderData = type.getAddressField("_class_loader_data");
+ protectionDomain = new OopField(type.getOopField("_protection_domain"), 0);
+ signers = new OopField(type.getOopField("_signers"), 0);
sourceFileName = type.getAddressField("_source_file_name");
sourceDebugExtension = type.getAddressField("_source_debug_extension");
- innerClasses = new OopField(type.getOopField("_inner_classes"), Oop.getHeaderSize());
- nonstaticFieldSize = new CIntField(type.getCIntegerField("_nonstatic_field_size"), Oop.getHeaderSize());
- staticFieldSize = new CIntField(type.getCIntegerField("_static_field_size"), Oop.getHeaderSize());
- staticOopFieldCount = new CIntField(type.getCIntegerField("_static_oop_field_count"), Oop.getHeaderSize());
- nonstaticOopMapSize = new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), Oop.getHeaderSize());
- isMarkedDependent = new CIntField(type.getCIntegerField("_is_marked_dependent"), Oop.getHeaderSize());
- initState = new CIntField(type.getCIntegerField("_init_state"), Oop.getHeaderSize());
- vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), Oop.getHeaderSize());
- itableLen = new CIntField(type.getCIntegerField("_itable_len"), Oop.getHeaderSize());
+ innerClasses = type.getAddressField("_inner_classes");
+ nonstaticFieldSize = new CIntField(type.getCIntegerField("_nonstatic_field_size"), 0);
+ staticFieldSize = new CIntField(type.getCIntegerField("_static_field_size"), 0);
+ staticOopFieldCount = new CIntField(type.getCIntegerField("_static_oop_field_count"), 0);
+ nonstaticOopMapSize = new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), 0);
+ isMarkedDependent = new CIntField(type.getCIntegerField("_is_marked_dependent"), 0);
+ initState = new CIntField(type.getCIntegerField("_init_state"), 0);
+ vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0);
+ itableLen = new CIntField(type.getCIntegerField("_itable_len"), 0);
breakpoints = type.getAddressField("_breakpoints");
genericSignature = type.getAddressField("_generic_signature");
- majorVersion = new CIntField(type.getCIntegerField("_major_version"), Oop.getHeaderSize());
- minorVersion = new CIntField(type.getCIntegerField("_minor_version"), Oop.getHeaderSize());
- headerSize = alignObjectOffset(Oop.getHeaderSize() + type.getSize());
+ majorVersion = new CIntField(type.getCIntegerField("_major_version"), 0);
+ minorVersion = new CIntField(type.getCIntegerField("_minor_version"), 0);
+ headerSize = Oop.alignObjectOffset(type.getSize());
// read field offset constants
ACCESS_FLAGS_OFFSET = db.lookupIntConstant("FieldInfo::access_flags_offset").intValue();
@@ -100,18 +100,17 @@ public class InstanceKlass extends Klass
HIGH_OFFSET = db.lookupIntConstant("FieldInfo::high_offset").intValue();
FIELD_SLOTS = db.lookupIntConstant("FieldInfo::field_slots").intValue();
// read ClassState constants
- CLASS_STATE_UNPARSABLE_BY_GC = db.lookupIntConstant("instanceKlass::unparsable_by_gc").intValue();
- CLASS_STATE_ALLOCATED = db.lookupIntConstant("instanceKlass::allocated").intValue();
- CLASS_STATE_LOADED = db.lookupIntConstant("instanceKlass::loaded").intValue();
- CLASS_STATE_LINKED = db.lookupIntConstant("instanceKlass::linked").intValue();
- CLASS_STATE_BEING_INITIALIZED = db.lookupIntConstant("instanceKlass::being_initialized").intValue();
- CLASS_STATE_FULLY_INITIALIZED = db.lookupIntConstant("instanceKlass::fully_initialized").intValue();
- CLASS_STATE_INITIALIZATION_ERROR = db.lookupIntConstant("instanceKlass::initialization_error").intValue();
-
- }
-
- InstanceKlass(OopHandle handle, ObjectHeap heap) {
- super(handle, heap);
+ CLASS_STATE_ALLOCATED = db.lookupIntConstant("InstanceKlass::allocated").intValue();
+ CLASS_STATE_LOADED = db.lookupIntConstant("InstanceKlass::loaded").intValue();
+ CLASS_STATE_LINKED = db.lookupIntConstant("InstanceKlass::linked").intValue();
+ CLASS_STATE_BEING_INITIALIZED = db.lookupIntConstant("InstanceKlass::being_initialized").intValue();
+ CLASS_STATE_FULLY_INITIALIZED = db.lookupIntConstant("InstanceKlass::fully_initialized").intValue();
+ CLASS_STATE_INITIALIZATION_ERROR = db.lookupIntConstant("InstanceKlass::initialization_error").intValue();
+
+ }
+
+ public InstanceKlass(Address addr) {
+ super(addr);
if (getJavaFieldsCount() != getAllFieldsCount()) {
// Exercise the injected field logic
for (int i = getJavaFieldsCount(); i < getAllFieldsCount(); i++) {
@@ -121,20 +120,20 @@ public class InstanceKlass extends Klass
}
}
- private static OopField arrayKlasses;
- private static OopField methods;
- private static OopField methodOrdering;
- private static OopField localInterfaces;
- private static OopField transitiveInterfaces;
- private static OopField fields;
+ private static MetadataField arrayKlasses;
+ private static AddressField methods;
+ private static AddressField methodOrdering;
+ private static AddressField localInterfaces;
+ private static AddressField transitiveInterfaces;
+ private static AddressField fields;
private static CIntField javaFieldsCount;
- private static OopField constants;
- private static OopField classLoader;
+ private static MetadataField constants;
+ private static AddressField classLoaderData;
private static OopField protectionDomain;
private static OopField signers;
private static AddressField sourceFileName;
private static AddressField sourceDebugExtension;
- private static OopField innerClasses;
+ private static AddressField innerClasses;
private static CIntField nonstaticFieldSize;
private static CIntField staticFieldSize;
private static CIntField staticOopFieldCount;
@@ -150,7 +149,6 @@ public class InstanceKlass extends Klass
// type safe enum for ClassState from instanceKlass.hpp
public static class ClassState {
- public static final ClassState UNPARSABLE_BY_GC = new ClassState("unparsable_by_gc");
public static final ClassState ALLOCATED = new ClassState("allocated");
public static final ClassState LOADED = new ClassState("loaded");
public static final ClassState LINKED = new ClassState("linked");
@@ -172,9 +170,7 @@ public class InstanceKlass extends Klass
public int getInitStateAsInt() { return (int) initState.getValue(this); }
public ClassState getInitState() {
int state = getInitStateAsInt();
- if (state == CLASS_STATE_UNPARSABLE_BY_GC) {
- return ClassState.UNPARSABLE_BY_GC;
- } else if (state == CLASS_STATE_ALLOCATED) {
+ if (state == CLASS_STATE_ALLOCATED) {
return ClassState.ALLOCATED;
} else if (state == CLASS_STATE_LOADED) {
return ClassState.LOADED;
@@ -242,19 +238,24 @@ public class InstanceKlass extends Klass
return getSizeHelper() * VM.getVM().getAddressSize();
}
+ public long getSize() {
+ return Oop.alignObjectSize(getHeaderSize() + Oop.alignObjectOffset(getVtableLen()) +
+ Oop.alignObjectOffset(getItableLen()) + Oop.alignObjectOffset(getNonstaticOopMapSize()));
+ }
+
public static long getHeaderSize() { return headerSize; }
public short getFieldAccessFlags(int index) {
- return getFields().getShortAt(index * FIELD_SLOTS + ACCESS_FLAGS_OFFSET);
+ return getFields().at(index * FIELD_SLOTS + ACCESS_FLAGS_OFFSET);
}
public short getFieldNameIndex(int index) {
if (index >= getJavaFieldsCount()) throw new IndexOutOfBoundsException("not a Java field;");
- return getFields().getShortAt(index * FIELD_SLOTS + NAME_INDEX_OFFSET);
+ return getFields().at(index * FIELD_SLOTS + NAME_INDEX_OFFSET);
}
public Symbol getFieldName(int index) {
- int nameIndex = getFields().getShortAt(index * FIELD_SLOTS + NAME_INDEX_OFFSET);
+ int nameIndex = getFields().at(index * FIELD_SLOTS + NAME_INDEX_OFFSET);
if (index < getJavaFieldsCount()) {
return getConstants().getSymbolAt(nameIndex);
} else {
@@ -264,11 +265,11 @@ public class InstanceKlass extends Klass
public short getFieldSignatureIndex(int index) {
if (index >= getJavaFieldsCount()) throw new IndexOutOfBoundsException("not a Java field;");
- return getFields().getShortAt(index * FIELD_SLOTS + SIGNATURE_INDEX_OFFSET);
+ return getFields().at(index * FIELD_SLOTS + SIGNATURE_INDEX_OFFSET);
}
public Symbol getFieldSignature(int index) {
- int signatureIndex = getFields().getShortAt(index * FIELD_SLOTS + SIGNATURE_INDEX_OFFSET);
+ int signatureIndex = getFields().at(index * FIELD_SLOTS + SIGNATURE_INDEX_OFFSET);
if (index < getJavaFieldsCount()) {
return getConstants().getSymbolAt(signatureIndex);
} else {
@@ -277,7 +278,7 @@ public class InstanceKlass extends Klass
}
public short getFieldGenericSignatureIndex(int index) {
- int len = (int)getFields().getLength();
+ int len = getFields().length();
int allFieldsCount = getAllFieldsCount();
int generic_signature_slot = allFieldsCount * FIELD_SLOTS;
for (int i = 0; i < allFieldsCount; i++) {
@@ -285,7 +286,7 @@ public class InstanceKlass extends Klass
AccessFlags access = new AccessFlags(flags);
if (i == index) {
if (access.fieldHasGenericSignature()) {
- return getFields().getShortAt(generic_signature_slot);
+ return getFields().at(generic_signature_slot);
} else {
return 0;
}
@@ -308,25 +309,23 @@ public class InstanceKlass extends Klass
public short getFieldInitialValueIndex(int index) {
if (index >= getJavaFieldsCount()) throw new IndexOutOfBoundsException("not a Java field;");
- return getFields().getShortAt(index * FIELD_SLOTS + INITVAL_INDEX_OFFSET);
+ return getFields().at(index * FIELD_SLOTS + INITVAL_INDEX_OFFSET);
}
public int getFieldOffset(int index) {
- TypeArray fields = getFields();
- return VM.getVM().buildIntFromShorts(fields.getShortAt(index * FIELD_SLOTS + LOW_OFFSET),
- fields.getShortAt(index * FIELD_SLOTS + HIGH_OFFSET));
+ U2Array fields = getFields();
+ return VM.getVM().buildIntFromShorts(fields.at(index * FIELD_SLOTS + LOW_OFFSET),
+ fields.at(index * FIELD_SLOTS + HIGH_OFFSET));
}
// Accessors for declared fields
public Klass getArrayKlasses() { return (Klass) arrayKlasses.getValue(this); }
- public ObjArray getMethods() { return (ObjArray) methods.getValue(this); }
- public TypeArray getMethodOrdering() { return (TypeArray) methodOrdering.getValue(this); }
- public ObjArray getLocalInterfaces() { return (ObjArray) localInterfaces.getValue(this); }
- public ObjArray getTransitiveInterfaces() { return (ObjArray) transitiveInterfaces.getValue(this); }
- public TypeArray getFields() { return (TypeArray) fields.getValue(this); }
+ public MethodArray getMethods() { return new MethodArray(methods.getValue(getAddress())); }
+ public KlassArray getLocalInterfaces() { return new KlassArray(localInterfaces.getValue(getAddress())); }
+ public KlassArray getTransitiveInterfaces() { return new KlassArray(transitiveInterfaces.getValue(getAddress())); }
public int getJavaFieldsCount() { return (int) javaFieldsCount.getValue(this); }
public int getAllFieldsCount() {
- int len = (int)getFields().getLength();
+ int len = getFields().length();
int allFieldsCount = 0;
for (; allFieldsCount*FIELD_SLOTS < len; allFieldsCount++) {
short flags = getFieldAccessFlags(allFieldsCount);
@@ -338,12 +337,12 @@ public class InstanceKlass extends Klass
return allFieldsCount;
}
public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); }
- public Oop getClassLoader() { return classLoader.getValue(this); }
+ public ClassLoaderData getClassLoaderData() { return ClassLoaderData.instantiateWrapperFor(classLoaderData.getValue(getAddress())); }
+ public Oop getClassLoader() { return getClassLoaderData().getClassLoader(); }
public Oop getProtectionDomain() { return protectionDomain.getValue(this); }
public ObjArray getSigners() { return (ObjArray) signers.getValue(this); }
public Symbol getSourceFileName() { return getSymbol(sourceFileName); }
- public String getSourceDebugExtension(){ return CStringUtilities.getString(sourceDebugExtension.getValue(getHandle())); }
- public TypeArray getInnerClasses() { return (TypeArray) innerClasses.getValue(this); }
+ public String getSourceDebugExtension(){ return CStringUtilities.getString(sourceDebugExtension.getValue(getAddress())); }
public long getNonstaticFieldSize() { return nonstaticFieldSize.getValue(this); }
public long getStaticOopFieldCount() { return staticOopFieldCount.getValue(this); }
public long getNonstaticOopMapSize() { return nonstaticOopMapSize.getValue(this); }
@@ -383,8 +382,8 @@ public class InstanceKlass extends Klass
public long computeModifierFlags() {
long access = getAccessFlags();
// But check if it happens to be member class.
- TypeArray innerClassList = getInnerClasses();
- int length = ( innerClassList == null)? 0 : (int) innerClassList.getLength();
+ U2Array innerClassList = getInnerClasses();
+ int length = (innerClassList == null)? 0 : (int) innerClassList.length();
if (length > 0) {
if (Assert.ASSERTS_ENABLED) {
Assert.that(length % InnerClassAttributeOffset.innerClassNextOffset == 0 ||
@@ -395,7 +394,7 @@ public class InstanceKlass extends Klass
if (i == length - EnclosingMethodAttributeOffset.enclosing_method_attribute_size) {
break;
}
- int ioff = innerClassList.getShortAt(i +
+ int ioff = innerClassList.at(i +
InnerClassAttributeOffset.innerClassInnerClassInfoOffset);
// 'ioff' can be zero.
// refer to JVM spec. section 4.7.5.
@@ -404,9 +403,9 @@ public class InstanceKlass extends Klass
// since we are looking for the flags for our self.
ConstantPool.CPSlot classInfo = getConstants().getSlotAt(ioff);
Symbol name = null;
- if (classInfo.isOop()) {
- name = ((Klass) classInfo.getOop()).getName();
- } else if (classInfo.isMetaData()) {
+ if (classInfo.isResolved()) {
+ name = classInfo.getKlass().getName();
+ } else if (classInfo.isUnresolved()) {
name = classInfo.getSymbol();
} else {
throw new RuntimeException("should not reach here");
@@ -414,7 +413,7 @@ public class InstanceKlass extends Klass
if (name.equals(getName())) {
// This is really a member class
- access = innerClassList.getShortAt(i +
+ access = innerClassList.at(i +
InnerClassAttributeOffset.innerClassAccessFlagsOffset);
break;
}
@@ -440,8 +439,8 @@ public class InstanceKlass extends Klass
}
private boolean isInInnerClasses(Symbol sym, boolean includeLocals) {
- TypeArray innerClassList = getInnerClasses();
- int length = ( innerClassList == null)? 0 : (int) innerClassList.getLength();
+ U2Array innerClassList = getInnerClasses();
+ int length = ( innerClassList == null)? 0 : (int) innerClassList.length();
if (length > 0) {
if (Assert.ASSERTS_ENABLED) {
Assert.that(length % InnerClassAttributeOffset.innerClassNextOffset == 0 ||
@@ -452,27 +451,19 @@ public class InstanceKlass extends Klass
if (i == length - EnclosingMethodAttributeOffset.enclosing_method_attribute_size) {
break;
}
- int ioff = innerClassList.getShortAt(i +
+ int ioff = innerClassList.at(i +
InnerClassAttributeOffset.innerClassInnerClassInfoOffset);
// 'ioff' can be zero.
// refer to JVM spec. section 4.7.5.
if (ioff != 0) {
ConstantPool.CPSlot iclassInfo = getConstants().getSlotAt(ioff);
- Symbol innerName = null;
- if (iclassInfo.isOop()) {
- innerName = ((Klass) iclassInfo.getOop()).getName();
- } else if (iclassInfo.isMetaData()) {
- innerName = iclassInfo.getSymbol();
- } else {
- throw new RuntimeException("should not reach here");
- }
-
+ Symbol innerName = getConstants().getKlassNameAt(ioff);
Symbol myname = getName();
- int ooff = innerClassList.getShortAt(i +
+ int ooff = innerClassList.at(i +
InnerClassAttributeOffset.innerClassOuterClassInfoOffset);
// for anonymous classes inner_name_index of InnerClasses
// attribute is zero.
- int innerNameIndex = innerClassList.getShortAt(i +
+ int innerNameIndex = innerClassList.at(i +
InnerClassAttributeOffset.innerClassInnerNameOffset);
// if this is not a member (anonymous, local etc.), 'ooff' will be zero
// refer to JVM spec. section 4.7.5.
@@ -488,9 +479,9 @@ public class InstanceKlass extends Klass
} else {
ConstantPool.CPSlot oclassInfo = getConstants().getSlotAt(ooff);
Symbol outerName = null;
- if (oclassInfo.isOop()) {
- outerName = ((Klass) oclassInfo.getOop()).getName();
- } else if (oclassInfo.isMetaData()) {
+ if (oclassInfo.isResolved()) {
+ outerName = oclassInfo.getKlass().getName();
+ } else if (oclassInfo.isUnresolved()) {
outerName = oclassInfo.getSymbol();
} else {
throw new RuntimeException("should not reach here");
@@ -513,10 +504,10 @@ public class InstanceKlass extends Klass
if (Assert.ASSERTS_ENABLED) {
Assert.that(k.isInterface(), "should not reach here");
}
- ObjArray interfaces = getTransitiveInterfaces();
- final int len = (int) interfaces.getLength();
+ KlassArray interfaces = getTransitiveInterfaces();
+ final int len = interfaces.length();
for (int i = 0; i < len; i++) {
- if (interfaces.getObjAt(i).equals(k)) return true;
+ if (interfaces.getAt(i).equals(k)) return true;
}
return false;
}
@@ -533,20 +524,14 @@ public class InstanceKlass extends Klass
tty.print("InstanceKlass for " + getName().asString());
}
- public void iterateFields(OopVisitor visitor, boolean doVMFields) {
- super.iterateFields(visitor, doVMFields);
- if (doVMFields) {
- visitor.doOop(arrayKlasses, true);
- visitor.doOop(methods, true);
- visitor.doOop(methodOrdering, true);
- visitor.doOop(localInterfaces, true);
- visitor.doOop(transitiveInterfaces, true);
- visitor.doOop(fields, true);
- visitor.doOop(constants, true);
- visitor.doOop(classLoader, true);
+ public void iterateFields(MetadataVisitor visitor) {
+ super.iterateFields(visitor);
+ visitor.doMetadata(arrayKlasses, true);
+ // visitor.doOop(methods, true);
+ // visitor.doOop(localInterfaces, true);
+ // visitor.doOop(transitiveInterfaces, true);
visitor.doOop(protectionDomain, true);
visitor.doOop(signers, true);
- visitor.doOop(innerClasses, true);
visitor.doCInt(nonstaticFieldSize, true);
visitor.doCInt(staticFieldSize, true);
visitor.doCInt(staticOopFieldCount, true);
@@ -556,7 +541,6 @@ public class InstanceKlass extends Klass
visitor.doCInt(vtableLen, true);
visitor.doCInt(itableLen, true);
}
- }
/*
* Visit the static fields of this InstanceKlass with the obj of
@@ -628,10 +612,10 @@ public class InstanceKlass extends Klass
/** Find field in direct superinterfaces. */
public Field findInterfaceField(Symbol name, Symbol sig) {
- ObjArray interfaces = getLocalInterfaces();
- int n = (int) interfaces.getLength();
+ KlassArray interfaces = getLocalInterfaces();
+ int n = interfaces.length();
for (int i = 0; i < n; i++) {
- InstanceKlass intf1 = (InstanceKlass) interfaces.getObjAt(i);
+ InstanceKlass intf1 = (InstanceKlass) interfaces.getAt(i);
if (Assert.ASSERTS_ENABLED) {
Assert.that(intf1.isInterface(), "just checking type");
}
@@ -727,10 +711,10 @@ public class InstanceKlass extends Klass
// transitiveInterfaces contains all interfaces implemented
// by this class and its superclass chain with no duplicates.
- ObjArray interfaces = getTransitiveInterfaces();
- int n = (int) interfaces.getLength();
+ KlassArray interfaces = getTransitiveInterfaces();
+ int n = interfaces.length();
for (int i = 0; i < n; i++) {
- InstanceKlass intf1 = (InstanceKlass) interfaces.getObjAt(i);
+ InstanceKlass intf1 = (InstanceKlass) interfaces.getAt(i);
if (Assert.ASSERTS_ENABLED) {
Assert.that(intf1.isInterface(), "just checking type");
}
@@ -759,20 +743,20 @@ public class InstanceKlass extends Klass
// Contains a Method for each method declared in this class/interface
// not including inherited methods.
- ObjArray methods = getMethods();
- int length = (int)methods.getLength();
+ MethodArray methods = getMethods();
+ int length = methods.length();
Object[] tmp = new Object[length];
- TypeArray methodOrdering = getMethodOrdering();
- if (methodOrdering.getLength() != length) {
+ IntArray methodOrdering = getMethodOrdering();
+ if (methodOrdering.length() != length) {
// no ordering info present
for (int index = 0; index < length; index++) {
- tmp[index] = methods.getObjAt(index);
+ tmp[index] = methods.at(index);
}
} else {
for (int index = 0; index < length; index++) {
- int originalIndex = getMethodOrdering().getIntAt(index);
- tmp[originalIndex] = methods.getObjAt(index);
+ int originalIndex = methodOrdering.at(index);
+ tmp[originalIndex] = methods.at(index);
}
}
@@ -786,24 +770,16 @@ public class InstanceKlass extends Klass
// Contains an InstanceKlass for each interface in this classes
// 'implements' clause.
- ObjArray interfaces = getLocalInterfaces();
- int length = (int) interfaces.getLength();
+ KlassArray interfaces = getLocalInterfaces();
+ int length = interfaces.length();
List directImplementedInterfaces = new ArrayList(length);
for (int index = 0; index < length; index ++) {
- directImplementedInterfaces.add(interfaces.getObjAt(index));
+ directImplementedInterfaces.add(interfaces.getAt(index));
}
return directImplementedInterfaces;
}
-
-
- public long getObjectSize() {
- long bodySize = alignObjectOffset(getVtableLen() * getHeap().getOopSize())
- + alignObjectOffset(getItableLen() * getHeap().getOopSize())
- + (getNonstaticOopMapSize()) * getHeap().getOopSize();
- return alignObjectSize(headerSize + bodySize);
- }
public Klass arrayKlassImpl(boolean orNull, int n) {
// FIXME: in reflective system this would need to change to
@@ -841,11 +817,27 @@ public class InstanceKlass extends Klass
return findMethod(getMethods(), name, sig);
}
- /** Breakpoint support (see methods on methodOop for details) */
+ /** Breakpoint support (see methods on Method* for details) */
public BreakpointInfo getBreakpoints() {
- Address addr = getHandle().getAddressAt(Oop.getHeaderSize() + breakpoints.getOffset());
+ Address addr = getAddress().getAddressAt(breakpoints.getOffset());
return (BreakpointInfo) VMObjectFactory.newObject(BreakpointInfo.class, addr);
}
+
+ public IntArray getMethodOrdering() {
+ Address addr = getAddress().getAddressAt(methodOrdering.getOffset());
+ return (IntArray) VMObjectFactory.newObject(IntArray.class, addr);
+ }
+
+ public U2Array getFields() {
+ Address addr = getAddress().getAddressAt(fields.getOffset());
+ return (U2Array) VMObjectFactory.newObject(U2Array.class, addr);
+ }
+
+ public U2Array getInnerClasses() {
+ Address addr = getAddress().getAddressAt(innerClasses.getOffset());
+ return (U2Array) VMObjectFactory.newObject(U2Array.class, addr);
+ }
+
//----------------------------------------------------------------------
// Internals only below this point
@@ -928,14 +920,14 @@ public class InstanceKlass extends Klass
throw new RuntimeException("Illegal field type at index " + index);
}
- private static Method findMethod(ObjArray methods, Symbol name, Symbol signature) {
- int len = (int) methods.getLength();
+ private static Method findMethod(MethodArray methods, Symbol name, Symbol signature) {
+ int len = methods.length();
// methods are sorted, so do binary search
int l = 0;
int h = len - 1;
while (l <= h) {
int mid = (l + h) >> 1;
- Method m = (Method) methods.getObjAt(mid);
+ Method m = methods.at(mid);
int res = m.getName().fastCompare(name);
if (res == 0) {
// found matching name; do linear search to find matching signature
@@ -944,13 +936,13 @@ public class InstanceKlass extends Klass
// search downwards through overloaded methods
int i;
for (i = mid - 1; i >= l; i--) {
- Method m1 = (Method) methods.getObjAt(i);
+ Method m1 = methods.at(i);
if (!m1.getName().equals(name)) break;
if (m1.getSignature().equals(signature)) return m1;
}
// search upwards
for (i = mid + 1; i <= h; i++) {
- Method m1 = (Method) methods.getObjAt(i);
+ Method m1 = methods.at(i);
if (!m1.getName().equals(name)) break;
if (m1.getSignature().equals(signature)) return m1;
}
@@ -977,10 +969,10 @@ public class InstanceKlass extends Klass
return null;
}
- private static int linearSearch(ObjArray methods, Symbol name, Symbol signature) {
- int len = (int) methods.getLength();
+ private static int linearSearch(MethodArray methods, Symbol name, Symbol signature) {
+ int len = (int) methods.length();
for (int index = 0; index < len; index++) {
- Method m = (Method) methods.getObjAt(index);
+ Method m = methods.at(index);
if (m.getSignature().equals(signature) && m.getName().equals(name)) {
return index;
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceMirrorKlass.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceMirrorKlass.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -48,8 +48,8 @@ public class InstanceMirrorKlass extends
Type type = db.lookupType("instanceMirrorKlass");
}
- InstanceMirrorKlass(OopHandle handle, ObjectHeap heap) {
- super(handle, heap);
+ public InstanceMirrorKlass(Address addr) {
+ super(addr);
}
public long getObjectSize(Oop o) {
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/IntField.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/IntField.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -25,6 +25,7 @@ package sun.jvm.hotspot.oops;
package sun.jvm.hotspot.oops;
import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.VMObject;
// The class for an int field simply provides access to the value.
public class IntField extends Field {
@@ -46,6 +47,9 @@ public class IntField extends Field {
}
return obj.getHandle().getJIntAt(getOffset());
}
+ public int getValue(VMObject obj) {
+ return obj.getAddress().getJIntAt(getOffset());
+ }
public void setValue(Oop obj, int value) throws MutationException {
// Fix this: setJIntAt is missing in Address
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -30,7 +30,7 @@ import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
-public class Klass extends Oop implements ClassConstants {
+public class Klass extends Metadata implements ClassConstants {
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@@ -50,14 +50,14 @@ public class Klass extends Oop implement
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
Type type = db.lookupType("Klass");
- javaMirror = new OopField(type.getOopField("_java_mirror"), Oop.getHeaderSize());
- superField = new OopField(type.getOopField("_super"), Oop.getHeaderSize());
- layoutHelper = new IntField(type.getJIntField("_layout_helper"), Oop.getHeaderSize());
+ javaMirror = new OopField(type.getOopField("_java_mirror"), 0);
+ superField = new MetadataField(type.getAddressField("_super"), 0);
+ layoutHelper = new IntField(type.getJIntField("_layout_helper"), 0);
name = type.getAddressField("_name");
- accessFlags = new CIntField(type.getCIntegerField("_access_flags"), Oop.getHeaderSize());
- subklass = new OopField(type.getOopField("_subklass"), Oop.getHeaderSize());
- nextSibling = new OopField(type.getOopField("_next_sibling"), Oop.getHeaderSize());
- allocCount = new CIntField(type.getCIntegerField("_alloc_count"), Oop.getHeaderSize());
+ accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0);
+ subklass = new MetadataField(type.getAddressField("_subklass"), 0);
+ nextSibling = new MetadataField(type.getAddressField("_next_sibling"), 0);
+ allocCount = new CIntField(type.getCIntegerField("_alloc_count"), 0);
LH_INSTANCE_SLOW_PATH_BIT = db.lookupIntConstant("Klass::_lh_instance_slow_path_bit").intValue();
LH_LOG2_ELEMENT_SIZE_SHIFT = db.lookupIntConstant("Klass::_lh_log2_element_size_shift").intValue();
@@ -68,8 +68,8 @@ public class Klass extends Oop implement
LH_ARRAY_TAG_OBJ_VALUE = db.lookupIntConstant("Klass::_lh_array_tag_obj_value").intValue();
}
- Klass(OopHandle handle, ObjectHeap heap) {
- super(handle, heap);
+ public Klass(Address addr) {
+ super(addr);
}
// jvmdi support - see also class_status in VM code
@@ -81,20 +81,20 @@ public class Klass extends Oop implement
// Fields
private static OopField javaMirror;
- private static OopField superField;
+ private static MetadataField superField;
private static IntField layoutHelper;
private static AddressField name;
private static CIntField accessFlags;
- private static OopField subklass;
- private static OopField nextSibling;
+ private static MetadataField subklass;
+ private static MetadataField nextSibling;
private static CIntField allocCount;
private Address getValue(AddressField field) {
- return getHandle().getAddressAt(field.getOffset() + Oop.getHeaderSize());
+ return addr.getAddressAt(field.getOffset());
}
protected Symbol getSymbol(AddressField field) {
- return Symbol.create(getHandle().getAddressAt(field.getOffset() + Oop.getHeaderSize()));
+ return Symbol.create(addr.getAddressAt(field.getOffset()));
}
// Accessors for declared fields
@@ -164,19 +164,16 @@ public class Klass extends Oop implement
tty.print("Klass");
}
- public void iterateFields(OopVisitor visitor, boolean doVMFields) {
- super.iterateFields(visitor, doVMFields);
- if (doVMFields) {
+ public void iterateFields(MetadataVisitor visitor) {
visitor.doOop(javaMirror, true);
- visitor.doOop(superField, true);
+ visitor.doMetadata(superField, true);
visitor.doInt(layoutHelper, true);
// visitor.doOop(name, true);
visitor.doCInt(accessFlags, true);
- visitor.doOop(subklass, true);
- visitor.doOop(nextSibling, true);
+ visitor.doMetadata(subklass, true);
+ visitor.doMetadata(nextSibling, true);
visitor.doCInt(allocCount, true);
}
- }
public long getObjectSize() {
throw new RuntimeException("should not reach here");
@@ -191,11 +188,11 @@ public class Klass extends Oop implement
public Klass arrayKlassOrNull() { return arrayKlassImpl(true); }
public Klass arrayKlassImpl(boolean orNull, int rank) {
- throw new RuntimeException("array_klass should be dispatched to instanceKlass, objArrayKlass or typeArrayKlass");
+ throw new RuntimeException("array_klass should be dispatched to InstanceKlass, objArrayKlass or typeArrayKlass");
}
public Klass arrayKlassImpl(boolean orNull) {
- throw new RuntimeException("array_klass should be dispatched to instanceKlass, objArrayKlass or typeArrayKlass");
+ throw new RuntimeException("array_klass should be dispatched to InstanceKlass, objArrayKlass or typeArrayKlass");
}
// This returns the name in the form java/lang/String which isn't really a signature
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/LocalVariableTableElement.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/LocalVariableTableElement.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
@@ -58,10 +58,10 @@ public class LocalVariableTableElement {
private static long offsetOfSignatureCPIndex;
private static long offsetOfSlot;
- private OopHandle handle;
+ private Address handle;
private long offset;
- public LocalVariableTableElement(OopHandle handle, long offset) {
+ public LocalVariableTableElement(Address handle, long offset) {
this.handle = handle;
this.offset = offset;
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/LongField.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/LongField.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -25,6 +25,7 @@ package sun.jvm.hotspot.oops;
package sun.jvm.hotspot.oops;
import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.VMObject;
// The class for a long field simply provides access to the value.
public class LongField extends Field {
@@ -41,6 +42,7 @@ public class LongField extends Field {
}
public long getValue(Oop obj) { return obj.getHandle().getJLongAt(getOffset()); }
+ public long getValue(VMObject obj) { return obj.getAddress().getJLongAt(getOffset()); }
public void setValue(Oop obj, long value) {
// Fix this: setJLongAt is missing in Address
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java Sat Sep 01 13:25:18 2012 -0400
@@ -36,7 +36,7 @@ import sun.jvm.hotspot.utilities.*;
// A Method represents a Java method
-public class Method extends Oop {
+public class Method extends Metadata {
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@@ -46,9 +46,9 @@ public class Method extends Oop {
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type type = db.lookupType("methodOopDesc");
- constMethod = new OopField(type.getOopField("_constMethod"), 0);
- methodData = new OopField(type.getOopField("_method_data"), 0);
+ Type type = db.lookupType("Method");
+ constMethod = type.getAddressField("_constMethod");
+ methodData = type.getAddressField("_method_data");
methodSize = new CIntField(type.getCIntegerField("_method_size"), 0);
maxStack = new CIntField(type.getCIntegerField("_max_stack"), 0);
maxLocals = new CIntField(type.getCIntegerField("_max_locals"), 0);
@@ -74,15 +74,15 @@ public class Method extends Oop {
classInitializerName = null;
}
- Method(OopHandle handle, ObjectHeap heap) {
- super(handle, heap);
+ public Method(Address addr) {
+ super(addr);
}
public boolean isMethod() { return true; }
// Fields
- private static OopField constMethod;
- private static OopField methodData;
+ private static AddressField constMethod;
+ private static AddressField methodData;
private static CIntField methodSize;
private static CIntField maxStack;
private static CIntField maxLocals;
@@ -122,11 +122,17 @@ public class Method extends Oop {
*/
// Accessors for declared fields
- public ConstMethod getConstMethod() { return (ConstMethod) constMethod.getValue(this); }
+ public ConstMethod getConstMethod() {
+ Address addr = constMethod.getValue(getAddress());
+ return (ConstMethod) VMObjectFactory.newObject(ConstMethod.class, addr);
+ }
public ConstantPool getConstants() {
return getConstMethod().getConstants();
}
- public MethodData getMethodData() { return (MethodData) methodData.getValue(this); }
+ public MethodData getMethodData() {
+ Address addr = methodData.getValue(getAddress());
+ return (MethodData) VMObjectFactory.newObject(MethodData.class, addr);
+ }
/** WARNING: this is in words, not useful in this system; use getObjectSize() instead */
public long getMethodSize() { return methodSize.getValue(this); }
public long getMaxStack() { return maxStack.getValue(this); }
@@ -153,7 +159,7 @@ public class Method extends Oop {
// get associated compiled native method, if available, else return null.
public NMethod getNativeMethod() {
- Address addr = code.getValue(getHandle());
+ Address addr = code.getValue(getAddress());
return (NMethod) VMObjectFactory.newObject(NMethod.class, addr);
}
@@ -268,25 +274,21 @@ public class Method extends Oop {
return entry;
}
- public long getObjectSize() {
- return getMethodSize() * getHeap().getOopSize();
+ public long getSize() {
+ return getMethodSize();
}
public void printValueOn(PrintStream tty) {
- tty.print("Method " + getName().asString() + getSignature().asString() + "@" + getHandle());
- }
-
- public void iterateFields(OopVisitor visitor, boolean doVMFields) {
- super.iterateFields(visitor, doVMFields);
- if (doVMFields) {
- visitor.doOop(constMethod, true);
+ tty.print("Method " + getName().asString() + getSignature().asString() + "@" + getAddress());
+ }
+
+ public void iterateFields(MetadataVisitor visitor) {
visitor.doCInt(methodSize, true);
visitor.doCInt(maxStack, true);
visitor.doCInt(maxLocals, true);
visitor.doCInt(sizeOfParameters, true);
visitor.doCInt(accessFlags, true);
}
- }
public boolean hasLineNumberTable() {
return getConstMethod().hasLineNumberTable();
@@ -357,10 +359,10 @@ public class Method extends Oop {
return buf.toString().replace('/', '.');
}
public int interpreterThrowoutCount() {
- return (int) interpreterThrowoutCountField.getValue(getHandle());
+ return (int) interpreterThrowoutCountField.getValue(this);
}
public int interpreterInvocationCount() {
- return (int) interpreterInvocationCountField.getValue(getHandle());
+ return (int) interpreterInvocationCountField.getValue(this);
}
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -33,7 +33,7 @@ import sun.jvm.hotspot.utilities.*;
// A MethodData provides interpreter profiling information
-public class MethodData extends Oop {
+public class MethodData extends Metadata {
static int TypeProfileWidth = 2;
static int BciProfileWidth = 2;
static int CompileThreshold;
@@ -129,11 +129,11 @@ public class MethodData extends Oop {
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type type = db.lookupType("methodDataOopDesc");
+ Type type = db.lookupType("MethodData");
baseOffset = type.getSize();
size = new CIntField(type.getCIntegerField("_size"), 0);
- method = new OopField(type.getOopField("_method"), 0);
+ method = new MetadataField(type.getAddressField("_method"), 0);
VM.Flag[] flags = VM.getVM().getCommandLineFlags();
for (int f = 0; f < flags.length; f++) {
@@ -188,24 +188,20 @@ public class MethodData extends Oop {
}
}
- MethodData(OopHandle handle, ObjectHeap heap) {
- super(handle, heap);
+ public MethodData(Address addr) {
+ super(addr);
}
public boolean isMethodData() { return true; }
private static long baseOffset;
private static CIntField size;
- private static OopField method;
+ private static MetadataField method;
private static CIntField dataSize;
private static AddressField data;
public static int sizeofMethodDataOopDesc;
public static int cellSize;
-
- public long getObjectSize() {
- return alignObjectSize(size.getValue(this));
- }
public Method getMethod() {
return (Method) method.getValue(this);
@@ -216,19 +212,17 @@ public class MethodData extends Oop {
tty.print("MethodData for " + m.getName().asString() + m.getSignature().asString());
}
- public void iterateFields(OopVisitor visitor, boolean doVMFields) {
- super.iterateFields(visitor, doVMFields);
- if (doVMFields) {
- visitor.doOop(method, true);
+ public void iterateFields(MetadataVisitor visitor) {
+ super.iterateFields(visitor);
+ visitor.doMetadata(method, true);
visitor.doCInt(size, true);
}
- }
int dataSize() {
if (dataSize == null) {
return 0;
} else {
- return (int)dataSize.getValue(this);
+ return (int)dataSize.getValue(getAddress());
}
}
@@ -298,13 +292,13 @@ public class MethodData extends Oop {
}
public byte[] orig() {
- // fetch the orig methodDataOopDesc data between header and dataSize
- return fetchDataAt(this.getHandle(), 0, sizeofMethodDataOopDesc);
+ // fetch the orig MethodData data between header and dataSize
+ return fetchDataAt(getAddress(), 0, sizeofMethodDataOopDesc);
}
public long[] data() {
// Read the data as an array of intptr_t elements
- OopHandle base = getHandle();
+ Address base = getAddress();
long offset = data.getOffset();
int elements = dataSize() / cellSize;
long[] result = new long[elements];
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -44,16 +44,16 @@ public class ObjArrayKlass extends Array
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
Type type = db.lookupType("objArrayKlass");
- elementKlass = new OopField(type.getOopField("_element_klass"), Oop.getHeaderSize());
- bottomKlass = new OopField(type.getOopField("_bottom_klass"), Oop.getHeaderSize());
+ elementKlass = new MetadataField(type.getAddressField("_element_klass"), 0);
+ bottomKlass = new MetadataField(type.getAddressField("_bottom_klass"), 0);
}
- ObjArrayKlass(OopHandle handle, ObjectHeap heap) {
- super(handle, heap);
+ public ObjArrayKlass(Address addr) {
+ super(addr);
}
- private static OopField elementKlass;
- private static OopField bottomKlass;
+ private static MetadataField elementKlass;
+ private static MetadataField bottomKlass;
public Klass getElementKlass() { return (Klass) elementKlass.getValue(this); }
public Klass getBottomKlass() { return (Klass) bottomKlass.getValue(this); }
@@ -71,12 +71,10 @@ public class ObjArrayKlass extends Array
return arrayFlags;
}
- public void iterateFields(OopVisitor visitor, boolean doVMFields) {
- super.iterateFields(visitor, doVMFields);
- if (doVMFields) {
- visitor.doOop(elementKlass, true);
- visitor.doOop(bottomKlass, true);
- }
+ public void iterateFields(MetadataVisitor visitor) {
+ super.iterateFields(visitor);
+ visitor.doMetadata(elementKlass, true);
+ visitor.doMetadata(bottomKlass, true);
}
public Klass arrayKlassImpl(boolean orNull, int n) {
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -48,35 +48,15 @@ public class ObjectHeap {
DEBUG = System.getProperty("sun.jvm.hotspot.oops.ObjectHeap.DEBUG") != null;
}
- private OopHandle methodKlassHandle;
- private OopHandle constMethodKlassHandle;
- private OopHandle methodDataKlassHandle;
- private OopHandle constantPoolKlassHandle;
- private OopHandle constantPoolCacheKlassHandle;
- private OopHandle klassKlassHandle;
- private OopHandle instanceKlassKlassHandle;
- private OopHandle typeArrayKlassKlassHandle;
- private OopHandle objArrayKlassKlassHandle;
- private OopHandle boolArrayKlassHandle;
- private OopHandle byteArrayKlassHandle;
- private OopHandle charArrayKlassHandle;
- private OopHandle intArrayKlassHandle;
- private OopHandle shortArrayKlassHandle;
- private OopHandle longArrayKlassHandle;
- private OopHandle singleArrayKlassHandle;
- private OopHandle doubleArrayKlassHandle;
- private OopHandle arrayKlassKlassHandle;
- private OopHandle compiledICHolderKlassHandle;
-
- private MethodKlass methodKlassObj;
- private ConstMethodKlass constMethodKlassObj;
- private MethodDataKlass methodDataKlassObj;
- private ConstantPoolKlass constantPoolKlassObj;
- private ConstantPoolCacheKlass constantPoolCacheKlassObj;
- private KlassKlass klassKlassObj;
- private InstanceKlassKlass instanceKlassKlassObj;
- private TypeArrayKlassKlass typeArrayKlassKlassObj;
- private ObjArrayKlassKlass objArrayKlassKlassObj;
+ private Address boolArrayKlassHandle;
+ private Address byteArrayKlassHandle;
+ private Address charArrayKlassHandle;
+ private Address intArrayKlassHandle;
+ private Address shortArrayKlassHandle;
+ private Address longArrayKlassHandle;
+ private Address singleArrayKlassHandle;
+ private Address doubleArrayKlassHandle;
+
private TypeArrayKlass boolArrayKlassObj;
private TypeArrayKlass byteArrayKlassObj;
private TypeArrayKlass charArrayKlassObj;
@@ -85,71 +65,34 @@ public class ObjectHeap {
private TypeArrayKlass longArrayKlassObj;
private TypeArrayKlass singleArrayKlassObj;
private TypeArrayKlass doubleArrayKlassObj;
- private ArrayKlassKlass arrayKlassKlassObj;
- private CompiledICHolderKlass compiledICHolderKlassObj;
public void initialize(TypeDataBase db) throws WrongTypeException {
// Lookup the roots in the object hierarchy.
Type universeType = db.lookupType("Universe");
- methodKlassHandle = universeType.getOopField("_methodKlassObj").getValue();
- methodKlassObj = new MethodKlass(methodKlassHandle, this);
-
- constMethodKlassHandle = universeType.getOopField("_constMethodKlassObj").getValue();
- constMethodKlassObj = new ConstMethodKlass(constMethodKlassHandle, this);
-
- constantPoolKlassHandle = universeType.getOopField("_constantPoolKlassObj").getValue();
- constantPoolKlassObj = new ConstantPoolKlass(constantPoolKlassHandle, this);
-
- constantPoolCacheKlassHandle = universeType.getOopField("_constantPoolCacheKlassObj").getValue();
- constantPoolCacheKlassObj = new ConstantPoolCacheKlass(constantPoolCacheKlassHandle, this);
-
- klassKlassHandle = universeType.getOopField("_klassKlassObj").getValue();
- klassKlassObj = new KlassKlass(klassKlassHandle, this);
-
- arrayKlassKlassHandle = universeType.getOopField("_arrayKlassKlassObj").getValue();
- arrayKlassKlassObj = new ArrayKlassKlass(arrayKlassKlassHandle, this);
-
- instanceKlassKlassHandle = universeType.getOopField("_instanceKlassKlassObj").getValue();
- instanceKlassKlassObj = new InstanceKlassKlass(instanceKlassKlassHandle, this);
-
- typeArrayKlassKlassHandle = universeType.getOopField("_typeArrayKlassKlassObj").getValue();
- typeArrayKlassKlassObj = new TypeArrayKlassKlass(typeArrayKlassKlassHandle, this);
-
- objArrayKlassKlassHandle = universeType.getOopField("_objArrayKlassKlassObj").getValue();
- objArrayKlassKlassObj = new ObjArrayKlassKlass(objArrayKlassKlassHandle, this);
-
- boolArrayKlassHandle = universeType.getOopField("_boolArrayKlassObj").getValue();
- boolArrayKlassObj = new TypeArrayKlass(boolArrayKlassHandle, this);
-
- byteArrayKlassHandle = universeType.getOopField("_byteArrayKlassObj").getValue();
- byteArrayKlassObj = new TypeArrayKlass(byteArrayKlassHandle, this);
-
- charArrayKlassHandle = universeType.getOopField("_charArrayKlassObj").getValue();
- charArrayKlassObj = new TypeArrayKlass(charArrayKlassHandle, this);
-
- intArrayKlassHandle = universeType.getOopField("_intArrayKlassObj").getValue();
- intArrayKlassObj = new TypeArrayKlass(intArrayKlassHandle, this);
-
- shortArrayKlassHandle = universeType.getOopField("_shortArrayKlassObj").getValue();
- shortArrayKlassObj = new TypeArrayKlass(shortArrayKlassHandle, this);
-
- longArrayKlassHandle = universeType.getOopField("_longArrayKlassObj").getValue();
- longArrayKlassObj = new TypeArrayKlass(longArrayKlassHandle, this);
-
- singleArrayKlassHandle = universeType.getOopField("_singleArrayKlassObj").getValue();
- singleArrayKlassObj = new TypeArrayKlass(singleArrayKlassHandle, this);
-
- doubleArrayKlassHandle = universeType.getOopField("_doubleArrayKlassObj").getValue();
- doubleArrayKlassObj = new TypeArrayKlass(doubleArrayKlassHandle, this);
-
- if (!VM.getVM().isCore()) {
- methodDataKlassHandle = universeType.getOopField("_methodDataKlassObj").getValue();
- methodDataKlassObj = new MethodDataKlass(methodDataKlassHandle, this);
-
- compiledICHolderKlassHandle = universeType.getOopField("_compiledICHolderKlassObj").getValue();
- compiledICHolderKlassObj= new CompiledICHolderKlass(compiledICHolderKlassHandle ,this);
- }
+ boolArrayKlassHandle = universeType.getAddressField("_boolArrayKlassObj").getValue();
+ boolArrayKlassObj = new TypeArrayKlass(boolArrayKlassHandle);
+
+ byteArrayKlassHandle = universeType.getAddressField("_byteArrayKlassObj").getValue();
+ byteArrayKlassObj = new TypeArrayKlass(byteArrayKlassHandle);
+
+ charArrayKlassHandle = universeType.getAddressField("_charArrayKlassObj").getValue();
+ charArrayKlassObj = new TypeArrayKlass(charArrayKlassHandle);
+
+ intArrayKlassHandle = universeType.getAddressField("_intArrayKlassObj").getValue();
+ intArrayKlassObj = new TypeArrayKlass(intArrayKlassHandle);
+
+ shortArrayKlassHandle = universeType.getAddressField("_shortArrayKlassObj").getValue();
+ shortArrayKlassObj = new TypeArrayKlass(shortArrayKlassHandle);
+
+ longArrayKlassHandle = universeType.getAddressField("_longArrayKlassObj").getValue();
+ longArrayKlassObj = new TypeArrayKlass(longArrayKlassHandle);
+
+ singleArrayKlassHandle = universeType.getAddressField("_singleArrayKlassObj").getValue();
+ singleArrayKlassObj = new TypeArrayKlass(singleArrayKlassHandle);
+
+ doubleArrayKlassHandle = universeType.getAddressField("_doubleArrayKlassObj").getValue();
+ doubleArrayKlassObj = new TypeArrayKlass(doubleArrayKlassHandle);
}
public ObjectHeap(TypeDataBase db) throws WrongTypeException {
@@ -195,16 +138,6 @@ public class ObjectHeap {
public long getDoubleSize() { return doubleSize; }
// Accessors for well-known system classes (from Universe)
- public MethodKlass getMethodKlassObj() { return methodKlassObj; }
- public ConstMethodKlass getConstMethodKlassObj() { return constMethodKlassObj; }
- public MethodDataKlass getMethodDataKlassObj() { return methodDataKlassObj; }
- public ConstantPoolKlass getConstantPoolKlassObj() { return constantPoolKlassObj; }
- public ConstantPoolCacheKlass getConstantPoolCacheKlassObj() { return constantPoolCacheKlassObj; }
- public KlassKlass getKlassKlassObj() { return klassKlassObj; }
- public ArrayKlassKlass getArrayKlassKlassObj() { return arrayKlassKlassObj; }
- public InstanceKlassKlass getInstanceKlassKlassObj() { return instanceKlassKlassObj; }
- public ObjArrayKlassKlass getObjArrayKlassKlassObj() { return objArrayKlassKlassObj; }
- public TypeArrayKlassKlass getTypeArrayKlassKlassObj() { return typeArrayKlassKlassObj; }
public TypeArrayKlass getBoolArrayKlassObj() { return boolArrayKlassObj; }
public TypeArrayKlass getByteArrayKlassObj() { return byteArrayKlassObj; }
public TypeArrayKlass getCharArrayKlassObj() { return charArrayKlassObj; }
@@ -213,12 +146,6 @@ public class ObjectHeap {
public TypeArrayKlass getLongArrayKlassObj() { return longArrayKlassObj; }
public TypeArrayKlass getSingleArrayKlassObj() { return singleArrayKlassObj; }
public TypeArrayKlass getDoubleArrayKlassObj() { return doubleArrayKlassObj; }
- public CompiledICHolderKlass getCompiledICHolderKlassObj() {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(!VM.getVM().isCore(), "must not be called for core build");
- }
- return compiledICHolderKlassObj;
- }
/** Takes a BasicType and returns the corresponding primitive array
klass */
@@ -301,22 +228,13 @@ public class ObjectHeap {
visitor.epilogue();
}
- // Iterates through only the perm generation for the purpose of
- // finding static fields for liveness analysis
- public void iteratePerm(HeapVisitor visitor) {
- CollectedHeap heap = VM.getVM().getUniverse().heap();
- List liveRegions = new ArrayList();
- addPermGenLiveRegions(liveRegions, heap);
- sortLiveRegions(liveRegions);
- iterateLiveRegions(liveRegions, visitor, null);
- }
-
- public boolean isValidMethod(OopHandle handle) {
- OopHandle klass = Oop.getKlassForOopHandle(handle);
- if (klass != null && klass.equals(methodKlassHandle)) {
+ public boolean isValidMethod(Address handle) {
+ try {
+ Method m = (Method)Metadata.instantiateWrapperFor(handle);
return true;
- }
- return false;
+ } catch (Exception e) {
+ return false;
+ }
}
// Creates an instance from the Oop hierarchy based based on the handle
@@ -329,60 +247,12 @@ public class ObjectHeap {
// Handle the null reference
if (handle == null) return null;
- // First check if handle is one of the root objects
- if (handle.equals(methodKlassHandle)) return getMethodKlassObj();
- if (handle.equals(constMethodKlassHandle)) return getConstMethodKlassObj();
- if (handle.equals(constantPoolKlassHandle)) return getConstantPoolKlassObj();
- if (handle.equals(constantPoolCacheKlassHandle)) return getConstantPoolCacheKlassObj();
- if (handle.equals(instanceKlassKlassHandle)) return getInstanceKlassKlassObj();
- if (handle.equals(objArrayKlassKlassHandle)) return getObjArrayKlassKlassObj();
- if (handle.equals(klassKlassHandle)) return getKlassKlassObj();
- if (handle.equals(arrayKlassKlassHandle)) return getArrayKlassKlassObj();
- if (handle.equals(typeArrayKlassKlassHandle)) return getTypeArrayKlassKlassObj();
- if (handle.equals(boolArrayKlassHandle)) return getBoolArrayKlassObj();
- if (handle.equals(byteArrayKlassHandle)) return getByteArrayKlassObj();
- if (handle.equals(charArrayKlassHandle)) return getCharArrayKlassObj();
- if (handle.equals(intArrayKlassHandle)) return getIntArrayKlassObj();
- if (handle.equals(shortArrayKlassHandle)) return getShortArrayKlassObj();
- if (handle.equals(longArrayKlassHandle)) return getLongArrayKlassObj();
- if (handle.equals(singleArrayKlassHandle)) return getSingleArrayKlassObj();
- if (handle.equals(doubleArrayKlassHandle)) return getDoubleArrayKlassObj();
- if (!VM.getVM().isCore()) {
- if (handle.equals(compiledICHolderKlassHandle)) return getCompiledICHolderKlassObj();
- if (handle.equals(methodDataKlassHandle)) return getMethodDataKlassObj();
- }
-
// Then check if obj.klass() is one of the root objects
- OopHandle klass = Oop.getKlassForOopHandle(handle);
+ Klass klass = Oop.getKlassForOopHandle(handle);
if (klass != null) {
- if (klass.equals(methodKlassHandle)) return new Method(handle, this);
- if (klass.equals(constMethodKlassHandle)) return new ConstMethod(handle, this);
- if (klass.equals(constantPoolKlassHandle)) return new ConstantPool(handle, this);
- if (klass.equals(constantPoolCacheKlassHandle)) return new ConstantPoolCache(handle, this);
- if (!VM.getVM().isCore()) {
- if (klass.equals(compiledICHolderKlassHandle)) return new CompiledICHolder(handle, this);
- if (klass.equals(methodDataKlassHandle)) return new MethodData(handle, this);
- }
- if (klass.equals(instanceKlassKlassHandle)) {
- InstanceKlass ik = new InstanceKlass(handle, this);
- if (ik.getName().asString().equals("java/lang/Class")) {
- // We would normally do this using the vtable style
- // lookup but since it's not used for these currently
- // it's simpler to just check for the name.
- return new InstanceMirrorKlass(handle, this);
- }
- return ik;
- }
- if (klass.equals(objArrayKlassKlassHandle)) return new ObjArrayKlass(handle, this);
- if (klass.equals(typeArrayKlassKlassHandle)) return new TypeArrayKlass(handle, this);
-
- // Lastly check if obj.klass().klass() is on of the root objects
- OopHandle klassKlass = Oop.getKlassForOopHandle(klass);
- if (klassKlass != null) {
- if (klassKlass.equals(instanceKlassKlassHandle)) return new Instance(handle, this);
- if (klassKlass.equals(objArrayKlassKlassHandle)) return new ObjArray(handle, this);
- if (klassKlass.equals(typeArrayKlassKlassHandle)) return new TypeArray(handle, this);
- }
+ if (klass instanceof TypeArrayKlass) return new TypeArray(handle, this);
+ if (klass instanceof ObjArrayKlass) return new ObjArray(handle, this);
+ if (klass instanceof InstanceKlass) return new Instance(handle, this);
}
if (DEBUG) {
@@ -434,20 +304,14 @@ public class ObjectHeap {
visitor.prologue(totalSize);
CompactibleFreeListSpace cmsSpaceOld = null;
- CompactibleFreeListSpace cmsSpacePerm = null;
CollectedHeap heap = VM.getVM().getUniverse().heap();
if (heap instanceof GenCollectedHeap) {
GenCollectedHeap genHeap = (GenCollectedHeap) heap;
Generation genOld = genHeap.getGen(1);
- Generation genPerm = genHeap.permGen();
if (genOld instanceof ConcurrentMarkSweepGeneration) {
ConcurrentMarkSweepGeneration concGen = (ConcurrentMarkSweepGeneration)genOld;
cmsSpaceOld = concGen.cmsSpace();
- }
- if (genPerm instanceof ConcurrentMarkSweepGeneration) {
- ConcurrentMarkSweepGeneration concGen = (ConcurrentMarkSweepGeneration)genPerm;
- cmsSpacePerm = concGen.cmsSpace();
}
}
@@ -476,8 +340,6 @@ public class ObjectHeap {
if ( (cmsSpaceOld != null) && cmsSpaceOld.contains(handle) ){
size = cmsSpaceOld.collector().blockSizeUsingPrintezisBits(handle);
- } else if ((cmsSpacePerm != null) && cmsSpacePerm.contains(handle) ){
- size = cmsSpacePerm.collector().blockSizeUsingPrintezisBits(handle);
}
if (size <= 0) {
@@ -494,8 +356,7 @@ public class ObjectHeap {
break;
}
}
- if ( (cmsSpaceOld != null) && cmsSpaceOld.contains(handle) ||
- (cmsSpacePerm != null) && cmsSpacePerm.contains(handle) ) {
+ if ( (cmsSpaceOld != null) && cmsSpaceOld.contains(handle)) {
handle = handle.addOffsetToAsOopHandle(CompactibleFreeListSpace.adjustObjectSizeInBytes(obj.getObjectSize()) );
} else {
handle = handle.addOffsetToAsOopHandle(obj.getObjectSize());
@@ -511,32 +372,6 @@ public class ObjectHeap {
}
visitor.epilogue();
- }
-
- private void addPermGenLiveRegions(List output, CollectedHeap heap) {
- LiveRegionsCollector lrc = new LiveRegionsCollector(output);
- if (heap instanceof SharedHeap) {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(heap instanceof GenCollectedHeap ||
- heap instanceof G1CollectedHeap,
- "Expecting GenCollectedHeap or G1CollectedHeap, " +
- "but got " + heap.getClass().getName());
- }
- // Handles both GenCollectedHeap and G1CollectedHeap
- SharedHeap sharedHeap = (SharedHeap) heap;
- Generation gen = sharedHeap.permGen();
- gen.spaceIterate(lrc, true);
- } else if (heap instanceof ParallelScavengeHeap) {
- ParallelScavengeHeap psh = (ParallelScavengeHeap) heap;
- PSPermGen permGen = psh.permGen();
- addLiveRegions(permGen.objectSpace().getLiveRegions(), output);
- } else {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(false,
- "Expecting SharedHeap or ParallelScavengeHeap, " +
- "but got " + heap.getClass().getName());
- }
- }
}
private void addLiveRegions(List input, List output) {
@@ -608,9 +443,6 @@ public class ObjectHeap {
}
}
- // handle perm generation
- addPermGenLiveRegions(liveRegions, heap);
-
// If UseTLAB is enabled, snip out regions associated with TLABs'
// dead regions. Note that TLABs can be present in any generation.
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -84,10 +84,6 @@ public class ObjectHistogramElement {
return tak.getElementTypeName() + "[]";
} else if (k instanceof ObjArrayKlass) {
ObjArrayKlass oak = (ObjArrayKlass) ak;
- // See whether it's a "system objArray"
- if (oak.equals(VM.getVM().getUniverse().systemObjArrayKlassObj())) {
- return "* System ObjArray";
- }
Klass bottom = oak.getBottomKlass();
int dim = (int) oak.getDimension();
StringBuffer buf = new StringBuffer();
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -30,7 +30,6 @@ import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
-import sun.jvm.hotspot.memory.CompactingPermGenGen;
// Oop represents the superclass for all types of
// objects in the HotSpot object heap.
@@ -47,8 +46,11 @@ public class Oop {
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
Type type = db.lookupType("oopDesc");
mark = new CIntField(type.getCIntegerField("_mark"), 0);
- klass = new OopField(type.getOopField("_metadata._klass"), 0);
- compressedKlass = new NarrowOopField(type.getOopField("_metadata._compressed_klass"), 0);
+ klass = new MetadataField(type.getAddressField("_metadata._klass"), 0);
+ if (VM.getVM().isCompressedHeadersEnabled()) {
+ // compressedKlass = new CIntField(type.getCIntegerField("_metadata._compressed_klass"), 0);
+ throw new InternalError("unimplemented");
+ }
headerSize = type.getSize();
}
@@ -71,28 +73,16 @@ public class Oop {
public static long getHeaderSize() { return headerSize; } // Header size in bytes.
private static CIntField mark;
- private static OopField klass;
- private static NarrowOopField compressedKlass;
-
- public boolean isShared() {
- return CompactingPermGenGen.isShared(handle);
- }
-
- public boolean isSharedReadOnly() {
- return CompactingPermGenGen.isSharedReadOnly(handle);
- }
-
- public boolean isSharedReadWrite() {
- return CompactingPermGenGen.isSharedReadWrite(handle);
- }
+ private static MetadataField klass;
+ private static CIntField compressedKlass;
// Accessors for declared fields
public Mark getMark() { return new Mark(getHandle()); }
public Klass getKlass() {
- if (VM.getVM().isCompressedOopsEnabled()) {
- return (Klass) compressedKlass.getValue(this);
- } else {
- return (Klass) klass.getValue(this);
+ if (VM.getVM().isCompressedHeadersEnabled()) {
+ throw new InternalError("unimplemented");
+ } else {
+ return (Klass)klass.getValue(getHandle());
}
}
@@ -113,14 +103,7 @@ public class Oop {
public boolean isArray() { return false; }
public boolean isObjArray() { return false; }
public boolean isTypeArray() { return false; }
- public boolean isSymbol() { return false; }
- public boolean isKlass() { return false; }
public boolean isThread() { return false; }
- public boolean isMethod() { return false; }
- public boolean isMethodData() { return false; }
- public boolean isConstantPool() { return false; }
- public boolean isConstantPoolCache() { return false; }
- public boolean isCompiledICHolder() { return false; }
// Align the object size.
public static long alignObjectSize(long size) {
@@ -167,10 +150,10 @@ public class Oop {
void iterateFields(OopVisitor visitor, boolean doVMFields) {
if (doVMFields) {
visitor.doCInt(mark, true);
- if (VM.getVM().isCompressedOopsEnabled()) {
- visitor.doOop(compressedKlass, true);
+ if (VM.getVM().isCompressedHeadersEnabled()) {
+ throw new InternalError("unimplemented");
} else {
- visitor.doOop(klass, true);
+ visitor.doMetadata(klass, true);
}
}
}
@@ -223,14 +206,14 @@ public class Oop {
public boolean verify() { return true;}
// Package-private routine to speed up ObjectHeap.newOop
- static OopHandle getKlassForOopHandle(OopHandle handle) {
+ static Klass getKlassForOopHandle(OopHandle handle) {
if (handle == null) {
return null;
}
- if (VM.getVM().isCompressedOopsEnabled()) {
- return handle.getCompOopHandleAt(compressedKlass.getOffset());
- } else {
- return handle.getOopHandleAt(klass.getOffset());
+ if (VM.getVM().isCompressedHeadersEnabled()) {
+ throw new InternalError("Unimplemented");
+ } else {
+ return (Klass)Metadata.instantiateWrapperFor(handle.getAddressAt(klass.getOffset()));
}
}
};
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/OopField.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/OopField.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -25,6 +25,8 @@ package sun.jvm.hotspot.oops;
package sun.jvm.hotspot.oops;
import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.VM;
+import sun.jvm.hotspot.runtime.VMObject;
// The class for an oop field simply provides access to the value.
public class OopField extends Field {
@@ -55,6 +57,15 @@ public class OopField extends Field {
return obj.getHandle().getOopHandleAt(getOffset());
}
+ public Oop getValue(VMObject obj) {
+ return VM.getVM().getObjectHeap().newOop(getValueAsOopHandle(obj));
+ }
+
+ /** Debugging support */
+ public OopHandle getValueAsOopHandle(VMObject obj) {
+ return obj.getAddress().getOopHandleAt(getOffset());
+ }
+
public void setValue(Oop obj) throws MutationException {
// Fix this: setOopAt is missing in Address
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/OopPrinter.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/OopPrinter.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -50,6 +50,12 @@ public class OopPrinter implements OopVi
private void printField(Field field) {
field.printOn(tty);
+ }
+
+ public void doMetadata(MetadataField field, boolean isVMField) {
+ printField(field);
+ field.getValue(getObj()).printValueOn(tty);
+ tty.println();
}
public void doOop(OopField field, boolean isVMField) {
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/OopVisitor.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/OopVisitor.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -27,7 +27,7 @@ package sun.jvm.hotspot.oops;
// An OopVisitor can be used to inspect all fields within an object.
// Fields include vm fields, java fields, indexable fields.
-public interface OopVisitor {
+public interface OopVisitor extends FieldVisitor {
// Called before visiting an object
public void prologue();
@@ -38,17 +38,4 @@ public interface OopVisitor {
// Returns the object being visited
public Oop getObj();
-
- // Callback methods for each field type in an object
- public void doOop(OopField field, boolean isVMField);
- public void doOop(NarrowOopField field, boolean isVMField);
- public void doByte(ByteField field, boolean isVMField);
- public void doChar(CharField field, boolean isVMField);
- public void doBoolean(BooleanField field, boolean isVMField);
- public void doShort(ShortField field, boolean isVMField);
- public void doInt(IntField field, boolean isVMField);
- public void doLong(LongField field, boolean isVMField);
- public void doFloat(FloatField field, boolean isVMField);
- public void doDouble(DoubleField field, boolean isVMField);
- public void doCInt(CIntField field, boolean isVMField);
};
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ProfileData.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ProfileData.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -61,10 +61,6 @@ public abstract class ProfileData {
int uintAt(int index) {
return (int)intptrAt(index);
}
- Oop oopAt(int index) {
- return data().oopAt(index);
- }
-
public Address addressAt(int index) {
return data().addressAt(index);
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -75,8 +75,8 @@ public class ReceiverTypeData extends Co
// would fail. The 'normal' version should be used whenever possible.
Klass receiverUnchecked(int row) {
//assert(row < rowLimit(), "oob");
- Oop recv = oopAt(receiverCellIndex(row));
- return (Klass)recv;
+ Address recv = addressAt(receiverCellIndex(row));
+ return (Klass)Metadata.instantiateWrapperFor(recv);
}
public Klass receiver(int row) {
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ShortField.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ShortField.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -25,6 +25,7 @@ package sun.jvm.hotspot.oops;
package sun.jvm.hotspot.oops;
import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.VMObject;
// The class for a short field simply provides access to the value.
public class ShortField extends Field {
@@ -41,6 +42,7 @@ public class ShortField extends Field {
}
public short getValue(Oop obj) { return obj.getHandle().getJShortAt(getOffset()); }
+ public short getValue(VMObject obj) { return obj.getAddress().getJShortAt(getOffset()); }
public void setValue(Oop obj, short value) throws MutationException {
// Fix this: setJFloatAt is missing in Address
}
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArray.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArray.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -43,7 +43,7 @@ public class TypeArray extends Array {
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type type = db.lookupType("typeArrayOopDesc");
+ Type type = db.lookupType("typeArrayOop");
}
TypeArray(OopHandle handle, ObjectHeap heap) {
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -44,11 +44,11 @@ public class TypeArrayKlass extends Arra
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
Type t = db.lookupType("typeArrayKlass");
- maxLength = new CIntField(t.getCIntegerField("_max_length"), Oop.getHeaderSize());
+ maxLength = new CIntField(t.getCIntegerField("_max_length"), 0);
}
- TypeArrayKlass(OopHandle handle, ObjectHeap heap) {
- super(handle, heap);
+ public TypeArrayKlass(Address addr) {
+ super(addr);
}
private static CIntField maxLength;
@@ -96,12 +96,10 @@ public class TypeArrayKlass extends Arra
tty.print("TypeArrayKlass for " + getTypeName());
}
- public void iterateFields(OopVisitor visitor, boolean doVMFields) {
- super.iterateFields(visitor, doVMFields);
- if (doVMFields) {
+ public void iterateFields(MetadataVisitor visitor) {
+ super.iterateFields(visitor);
visitor.doCInt(maxLength, true);
}
- }
public Klass arrayKlassImpl(boolean orNull, int n) {
int dimension = (int) getDimension();
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -29,6 +29,7 @@ import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.utilities.*;
@@ -40,7 +41,7 @@ public class java_lang_Class {
public class java_lang_Class {
// java.lang.Class fields
- static OopField klassField;
+ static int klassOffset;
static IntField oopSizeField;
static {
@@ -55,19 +56,18 @@ public class java_lang_Class {
// klass and oop_size are HotSpot magic fields and hence we can't
// find them from InstanceKlass for java.lang.Class.
Type jlc = db.lookupType("java_lang_Class");
- int klassOffset = (int) jlc.getCIntegerField("_klass_offset").getValue();
- if (VM.getVM().isCompressedOopsEnabled()) {
- klassField = new NarrowOopField(new NamedFieldIdentifier("klass"), klassOffset, true);
- } else {
- klassField = new OopField(new NamedFieldIdentifier("klass"), klassOffset, true);
- }
+ klassOffset = (int) jlc.getCIntegerField("_klass_offset").getValue();
int oopSizeOffset = (int) jlc.getCIntegerField("_oop_size_offset").getValue();
oopSizeField = new IntField(new NamedFieldIdentifier("oop_size"), oopSizeOffset, true);
}
- /** get klassOop field at offset hc_klass_offset from a java.lang.Class object */
+ /** get Klass* field at offset hc_klass_offset from a java.lang.Class object */
public static Klass asKlass(Oop aClass) {
- return (Klass) java_lang_Class.klassField.getValue(aClass);
+ if (VM.getVM().isCompressedHeadersEnabled()) {
+ throw new InternalError("unimplemented");
+ } else {
+ return (Klass)Metadata.instantiateWrapperFor(aClass.getHandle().getAddressAt(klassOffset));
+ }
}
/** get oop_size field at offset oop_size_offset from a java.lang.Class object */
--- a/agent/src/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -54,7 +54,7 @@ public class CallJavaNode extends CallNo
}
public ciMethod method() {
- return (ciMethod) ciObjectFactory.get(methodField.getValue(getAddress()));
+ return (ciMethod) ciObjectFactory.getMetadata(methodField.getValue(getAddress()));
}
public void dumpSpec(PrintStream out) {
--- a/agent/src/share/classes/sun/jvm/hotspot/opto/Compile.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/opto/Compile.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -74,7 +74,7 @@ public class Compile extends VMObject {
}
public ciMethod method() {
- return (ciMethod) ciObjectFactory.get(methodField.getValue(getAddress()));
+ return (ciMethod) ciObjectFactory.getMetadata(methodField.getValue(getAddress()));
}
public PhaseCFG cfg() {
--- a/agent/src/share/classes/sun/jvm/hotspot/opto/InlineTree.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/opto/InlineTree.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -69,7 +69,7 @@ public class InlineTree extends VMObject
}
public ciMethod method() {
- return (ciMethod) ciObjectFactory.get(methodField.getValue(getAddress()));
+ return (ciMethod) ciObjectFactory.getMetadata(methodField.getValue(getAddress()));
}
public JVMState callerJvms() {
--- a/agent/src/share/classes/sun/jvm/hotspot/opto/JVMState.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/opto/JVMState.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -81,7 +81,7 @@ public class JVMState extends VMObject {
}
public ciMethod method() {
- return (ciMethod) ciObjectFactory.get(methodField.getValue(getAddress()));
+ return (ciMethod) ciObjectFactory.getMetadata(methodField.getValue(getAddress()));
}
public int bci() {
--- a/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -52,7 +52,7 @@ public class MachCallJavaNode extends Ma
private static CIntField bciField;
public ciMethod method() {
- return (ciMethod) ciObjectFactory.get(methodField.getValue(getAddress()));
+ return (ciMethod) ciObjectFactory.getMetadata(methodField.getValue(getAddress()));
}
public MachCallJavaNode(Address addr) {
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -61,20 +61,13 @@ public interface ClassConstants
// For bad value initialization
public static final int JVM_CONSTANT_Invalid = 0;
- // Temporary tag until actual use
- public static final int JVM_CONSTANT_UnresolvedClass = 100;
-
- // Temporary tag while constructing constant pool
- public static final int JVM_CONSTANT_ClassIndex = 101;
-
- // Temporary tag until actual use
- public static final int JVM_CONSTANT_UnresolvedString = 102;
-
- // Temporary tag while constructing constant pool
- public static final int JVM_CONSTANT_StringIndex = 103;
-
- // Temporary tag while constructing constant pool
- public static final int JVM_CONSTANT_UnresolvedClassInError = 104;
+ public static final int JVM_CONSTANT_UnresolvedClass = 100; // Temporary tag until actual use
+ public static final int JVM_CONSTANT_ClassIndex = 101; // Temporary tag while constructing constant pool
+ public static final int JVM_CONSTANT_StringIndex = 102; // Temporary tag while constructing constant pool
+ public static final int JVM_CONSTANT_UnresolvedClassInError = 103; // Error tag due to resolution error
+ public static final int JVM_CONSTANT_MethodHandleInError = 104; // Error tag due to resolution error
+ public static final int JVM_CONSTANT_MethodTypeInError = 105; // Error tag due to resolution error
+ public static final int JVM_CONSTANT_Object = 106; // Required for BoundMethodHandle arguments.
// 1.5 major/minor version numbers from JVM spec. 3rd edition
public static final short MAJOR_VERSION = 49;
@@ -109,7 +102,7 @@ public interface ClassConstants
// flags actually put in .class file
public static final long JVM_ACC_WRITTEN_FLAGS = 0x00007FFF;
- // methodOop flags
+ // Method* flags
// monitorenter/monitorexit bytecodes match
public static final long JVM_ACC_MONITOR_MATCH = 0x10000000;
// Method contains monitorenter/monitorexit bytecodes
@@ -130,7 +123,7 @@ public interface ClassConstants
// RedefineClasses() has made method obsolete
public static final long JVM_ACC_IS_OBSOLETE = 0x00010000;
- // klassOop flags
+ // Klass* flags
// True if this class has miranda methods in it's vtable
public static final long JVM_ACC_HAS_MIRANDA_METHODS = 0x10000000;
// True if klass has a vanilla default constructor
@@ -140,14 +133,14 @@ public interface ClassConstants
// True if klass supports the Clonable interface
public static final long JVM_ACC_IS_CLONEABLE = 0x80000000;
- // klassOop and methodOop flags
+ // Klass* and Method* flags
public static final long JVM_ACC_HAS_LOCAL_VARIABLE_TABLE = 0x00200000;
// flags promoted from methods to the holding klass
public static final long JVM_ACC_PROMOTED_FLAGS = 0x00200000;
// field flags
// Note: these flags must be defined in the low order 16 bits because
- // instanceKlass only stores a ushort worth of information from the
+ // InstanceKlass only stores a ushort worth of information from the
// AccessFlags value.
// field access is watched by JVMTI
public static final long JVM_ACC_FIELD_ACCESS_WATCHED = 0x00002000;
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -72,8 +72,8 @@ public abstract class Frame implements C
});
}
- /** Size of constMethodOopDesc for computing BCI from BCP (FIXME: hack) */
- private static long constMethodOopDescSize;
+ /** Size of ConstMethod for computing BCI from BCP (FIXME: hack) */
+ private static long ConstMethodSize;
private static int pcReturnOffset;
@@ -82,10 +82,10 @@ public abstract class Frame implements C
}
private static synchronized void initialize(TypeDataBase db) {
- Type constMethodOopType = db.lookupType("constMethodOopDesc");
+ Type ConstMethodType = db.lookupType("ConstMethod");
// FIXME: not sure whether alignment here is correct or how to
// force it (round up to address size?)
- constMethodOopDescSize = constMethodOopType.getSize();
+ ConstMethodSize = ConstMethodType.getSize();
pcReturnOffset = db.lookupIntConstant("frame::pc_return_offset").intValue();
}
@@ -97,7 +97,7 @@ public abstract class Frame implements C
if (bcp == null) return 0;
long bci = bcp.minus(null);
if (bci >= 0 && bci < cm.getCodeSize()) return (int) bci;
- return (int) (bcp.minus(cm.getHandle()) - constMethodOopDescSize);
+ return (int) (bcp.minus(cm.getAddress()) - ConstMethodSize);
}
protected int bcpToBci(Address bcp, Method m) {
@@ -285,7 +285,7 @@ public abstract class Frame implements C
// NOTE that the accessor "addressOfInterpreterFrameBCX" has
// necessarily been eliminated. The byte code pointer is inherently
// an interior pointer to a Method (the bytecodes follow the
- // methodOopDesc data structure) and therefore acquisition of it in
+ // Method data structure) and therefore acquisition of it in
// this system can not be allowed. All accesses to interpreter frame
// byte codes are via the byte code index (BCI).
@@ -374,7 +374,7 @@ public abstract class Frame implements C
/** Current method */
public Method getInterpreterFrameMethod() {
- return (Method) VM.getVM().getObjectHeap().newOop(addressOfInterpreterFrameMethod().getOopHandleAt(0));
+ return (Method)Metadata.instantiateWrapperFor(addressOfInterpreterFrameMethod().getAddressAt(0));
}
/** Current method */
@@ -385,7 +385,7 @@ public abstract class Frame implements C
public abstract Address addressOfInterpreterFrameCPCache();
/** Constant pool cache */
public ConstantPoolCache getInterpreterFrameCPCache() {
- return (ConstantPoolCache) VM.getVM().getObjectHeap().newOop(addressOfInterpreterFrameCPCache().getOopHandleAt(0));
+ return (ConstantPoolCache) Metadata.instantiateWrapperFor(addressOfInterpreterFrameCPCache().getAddressAt(0));
}
//--------------------------------------------------------------------------------
@@ -583,8 +583,9 @@ public abstract class Frame implements C
// }
// process fixed part
- oopVisitor.visitAddress(addressOfInterpreterFrameMethod());
- oopVisitor.visitAddress(addressOfInterpreterFrameCPCache());
+ // FIXME: these are no longer oops, so should anything be visitied?
+ // oopVisitor.visitAddress(addressOfInterpreterFrameMethod());
+ // oopVisitor.visitAddress(addressOfInterpreterFrameCPCache());
// FIXME: expose interpreterFrameMirrorOffset
// if (m.isNative() && m.isStatic()) {
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIid.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIid.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -31,11 +31,11 @@ import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.types.*;
public class JNIid extends VMObject {
- private static sun.jvm.hotspot.types.OopField holder;
+ private static MetadataField holder;
private static AddressField next;
private static CIntegerField offset;
- private static sun.jvm.hotspot.types.OopField resolvedMethod;
- private static sun.jvm.hotspot.types.OopField resolvedReceiver;
+ private static MetadataField resolvedMethod;
+ private static MetadataField resolvedReceiver;
private ObjectHeap heap;
@@ -77,11 +77,11 @@ public class JNIid extends VMObject {
return new JNIid(nextAddr, heap);
}
- public Klass holder() { return (Klass) heap.newOop(holder.getValue(addr)); }
+ public Klass holder() { return (Klass) holder.getValue(addr); }
public int offset() { return (int) offset.getValue(addr); }
public Method method() {
- return (Method) ((InstanceKlass) holder()).getMethods().getObjAt(offset());
+ return ((InstanceKlass) holder()).getMethods().at(offset());
}
- public Method resolvedMethod() { return (Method) heap.newOop(resolvedMethod.getValue(addr)); }
- public Klass resolvedReceiver() { return (Klass) heap.newOop(resolvedReceiver.getValue(addr)); }
+ public Method resolvedMethod() { return (Method)resolvedMethod.getValue(addr); }
+ public Klass resolvedReceiver() { return (Klass) resolvedReceiver.getValue(addr); }
}
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -97,6 +97,7 @@ public class VM {
/** alignment constants */
private boolean isLP64;
private int bytesPerLong;
+ private int bytesPerWord;
private int objectAlignmentInBytes;
private int minObjAlignmentInBytes;
private int logMinObjAlignmentInBytes;
@@ -128,6 +129,7 @@ public class VM {
private static CIntegerType boolType;
private Boolean sharingEnabled;
private Boolean compressedOopsEnabled;
+ private Boolean compressedHeadersEnabled;
// command line flags supplied to VM - see struct Flag in globals.hpp
public static final class Flag {
@@ -303,7 +305,7 @@ public class VM {
// We infer the presence of C1 or C2 from a couple of fields we
// already have present in the type database
{
- Type type = db.lookupType("methodOopDesc");
+ Type type = db.lookupType("Method");
if (type.getField("_from_compiled_entry", false, false) == null) {
// Neither C1 nor C2 is present
usingClientCompiler = false;
@@ -325,6 +327,7 @@ public class VM {
isLP64 = debugger.getMachineDescription().isLP64();
}
bytesPerLong = db.lookupIntConstant("BytesPerLong").intValue();
+ bytesPerWord = db.lookupIntConstant("BytesPerWord").intValue();
heapWordSize = db.lookupIntConstant("HeapWordSize").intValue();
oopSize = db.lookupIntConstant("oopSize").intValue();
@@ -509,6 +512,10 @@ public class VM {
return bytesPerLong;
}
+ public int getBytesPerWord() {
+ return bytesPerWord;
+ }
+
/** Get minimum object alignment in bytes. */
public int getMinObjAlignmentInBytes() {
return minObjAlignmentInBytes;
@@ -770,6 +777,15 @@ public class VM {
(flag.getBool()? Boolean.TRUE: Boolean.FALSE);
}
return compressedOopsEnabled.booleanValue();
+ }
+
+ public boolean isCompressedHeadersEnabled() {
+ if (compressedHeadersEnabled == null) {
+ Flag flag = getCommandLineFlag("UseCompressedHeaders");
+ compressedHeadersEnabled = (flag == null) ? Boolean.FALSE:
+ (flag.getBool()? Boolean.TRUE: Boolean.FALSE);
+ }
+ return compressedHeadersEnabled.booleanValue();
}
public int getObjectAlignmentInBytes() {
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -57,6 +57,12 @@ public class VMObjectFactory {
});
return c.newInstance(new Object[] { addr });
}
+ catch (java.lang.reflect.InvocationTargetException ite) {
+ if (ite.getTargetException() instanceof RuntimeException) {
+ throw (RuntimeException)ite.getTargetException();
+ }
+ throw new ConstructionException(ite);
+ }
catch (Exception e) {
throw new ConstructionException(e);
}
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualBaseConstructor.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualBaseConstructor.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -47,6 +47,7 @@ public class VirtualBaseConstructor<T> e
map = new HashMap();
this.baseType = baseType;
this.unknownTypeHandler = unknownTypeHandler;
+ if (packageName != null) {
// Try to find mirror types for each of the types. If there isn't
// a direct mirror then try to find an instantiable superclass and
// treat it as that.
@@ -73,22 +74,36 @@ public class VirtualBaseConstructor<T> e
}
}
}
+ }
+
+ /** Adds a mapping from the given C++ type name to the given Java
+ class. The latter must be a subclass of
+ sun.jvm.hotspot.runtime.VMObject. Returns false if there was
+ already a class for this type name in the map. */
+ public boolean addMapping(String cTypeName, Class clazz) {
+ if (map.get(cTypeName) != null) {
+ return false;
+ }
+
+ map.put(cTypeName, clazz);
+ return true;
+ }
/** Instantiate the most-precisely typed wrapper object available
for the type of the given Address. If no type in the mapping
matched the type of the Address, throws a WrongTypeException.
Returns null for a null address (similar behavior to
VMObjectFactory). */
- public VMObject instantiateWrapperFor(Address addr) throws WrongTypeException {
+ public T instantiateWrapperFor(Address addr) throws WrongTypeException {
if (addr == null) {
return null;
}
Type type = db.findDynamicTypeForAddress(addr, baseType);
if (type != null) {
- return (VMObject) VMObjectFactory.newObject((Class) map.get(type.getName()), addr);
+ return (T) VMObjectFactory.newObject((Class) map.get(type.getName()), addr);
} else if (unknownTypeHandler != null) {
- return (VMObject) VMObjectFactory.newObject(unknownTypeHandler, addr);
+ return (T) VMObjectFactory.newObject(unknownTypeHandler, addr);
}
throw newWrongTypeException(addr);
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64Frame.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64Frame.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -345,8 +345,8 @@ public class IA64Frame extends Frame {
// for use in a non-debugging, or reflective, system. Need to
// figure out how to express this.
Address bcp = addressOfInterpreterFrameBCX().getAddressAt(0);
- OopHandle methodHandle = addressOfInterpreterFrameMethod().getOopHandleAt(0);
- Method method = (Method) VM.getVM().getObjectHeap().newOop(methodHandle);
+ Address methodHandle = addressOfInterpreterFrameMethod().getAddressAt(0);
+ Method method = (Method)Metadata.instantiateWrapperFor(methodHandle);
return bcpToBci(bcp, method);
}
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -423,7 +423,7 @@ public class SPARCFrame extends Frame {
return false;
}
- OopHandle methodHandle = addressOfInterpreterFrameMethod().getOopHandleAt(0);
+ Address methodHandle = addressOfInterpreterFrameMethod().getAddressAt(0);
if (VM.getVM().getObjectHeap().isValidMethod(methodHandle) == false) {
return false;
@@ -444,7 +444,7 @@ public class SPARCFrame extends Frame {
Method method;
try {
- method = (Method) VM.getVM().getObjectHeap().newOop(methodHandle);
+ method = (Method)Metadata.instantiateWrapperFor(methodHandle);
} catch (UnknownOopException ex) {
return false;
}
@@ -744,8 +744,8 @@ public class SPARCFrame extends Frame {
// private:
//
// // where LcpoolCache is saved:
- // constantPoolCacheOop* interpreter_frame_cpoolcache_addr() const {
- // return (constantPoolCacheOop*)sp_addr_at( LcpoolCache.sp_offset_in_saved_window());
+ // ConstantPoolCache** interpreter_frame_cpoolcache_addr() const {
+ // return (ConstantPoolCache**)sp_addr_at( LcpoolCache.sp_offset_in_saved_window());
// }
//
// // where Lmonitors is saved:
@@ -787,8 +787,8 @@ public class SPARCFrame extends Frame {
// for use in a non-debugging, or reflective, system. Need to
// figure out how to express this.
Address bcp = addressOfInterpreterFrameBCX().getAddressAt(0);
- OopHandle methodHandle = addressOfInterpreterFrameMethod().getOopHandleAt(0);
- Method method = (Method) VM.getVM().getObjectHeap().newOop(methodHandle);
+ Address methodHandle = addressOfInterpreterFrameMethod().getAddressAt(0);
+ Method method = (Method)Metadata.instantiateWrapperFor(methodHandle);
return bcpToBci(bcp, method);
}
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
@@ -452,8 +452,8 @@ public class X86Frame extends Frame {
// for use in a non-debugging, or reflective, system. Need to
// figure out how to express this.
Address bcp = addressOfInterpreterFrameBCX().getAddressAt(0);
- OopHandle methodHandle = addressOfInterpreterFrameMethod().getOopHandleAt(0);
- Method method = (Method) VM.getVM().getObjectHeap().newOop(methodHandle);
+ Address methodHandle = addressOfInterpreterFrameMethod().getAddressAt(0);
+ Method method = (Method)Metadata.instantiateWrapperFor(methodHandle);
return bcpToBci(bcp, method);
}
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java Sat Sep 01 13:25:18 2012 -0400
@@ -65,8 +65,8 @@ public class HeapSummary extends Tool {
printValMB("OldSize = ", getFlagValue("OldSize", flagMap));
printValue("NewRatio = ", getFlagValue("NewRatio", flagMap));
printValue("SurvivorRatio = ", getFlagValue("SurvivorRatio", flagMap));
- printValMB("PermSize = ", getFlagValue("PermSize", flagMap));
- printValMB("MaxPermSize = ", getFlagValue("MaxPermSize", flagMap));
+ printValMB("MetaspaceSize = ", getFlagValue("MetaspaceSize", flagMap));
+ printValMB("MaxMetaspaceSize = ", getFlagValue("MaxMetaspaceSize", flagMap));
printValMB("G1HeapRegionSize = ", HeapRegion.grainBytes());
System.out.println();
@@ -118,10 +118,6 @@ public class HeapSummary extends Tool {
} else {
throw new RuntimeException("unknown SharedHeap type : " + heap.getClass());
}
- // Perm generation shared by the above
- Generation permGen = sharedHeap.permGen();
- System.out.println("Perm Generation:");
- printGen(permGen);
} else if (heap instanceof ParallelScavengeHeap) {
ParallelScavengeHeap psh = (ParallelScavengeHeap) heap;
PSYoungGen youngGen = psh.youngGen();
@@ -134,14 +130,6 @@ public class HeapSummary extends Tool {
printValMB("used = ", oldGen.used());
printValMB("free = ", oldFree);
System.out.println(alignment + (double)oldGen.used() * 100.0 / oldGen.capacity() + "% used");
-
- PSPermGen permGen = psh.permGen();
- long permFree = permGen.capacity() - permGen.used();
- System.out.println("PS Perm Generation");
- printValMB("capacity = ", permGen.capacity());
- printValMB("used = ", permGen.used());
- printValMB("free = ", permFree);
- System.out.println(alignment + (double)permGen.used() * 100.0 / permGen.capacity() + "% used");
} else {
throw new RuntimeException("unknown CollectedHeap type : " + heap.getClass());
}
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java Sat Sep 01 13:25:18 2012 -0400
@@ -34,7 +34,7 @@ import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.runtime.*;
public class PStack extends Tool {
- // in non-verbose mode, methodOops are not printed in java frames
+ // in non-verbose mode, Method*s are not printed in java frames
public PStack(boolean v, boolean concurrentLocks) {
this.verbose = v;
this.concurrentLocks = concurrentLocks;
@@ -247,7 +247,7 @@ public class PStack extends Tool {
}
if (verbose) {
- sb.append(" methodOop:" + method.getHandle());
+ sb.append(" Method*:" + method.getAddress());
}
if (vf.isCompiledFrame()) {
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/PermStat.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/PermStat.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -201,7 +201,7 @@ public class PermStat extends Tool {
if (loaderKlass != null) {
out.print(loaderKlass.getName().asString());
out.print('@');
- out.print(loader.getKlass().getHandle());
+ out.print(loader.getKlass().getAddress());
} else {
out.print(" null! ");
}
@@ -233,46 +233,44 @@ public class PermStat extends Tool {
}
// Don't count the shared empty arrays
- private static long arraySize(Array arr) {
- return arr.getLength() != 0L ? arr.getObjectSize() : 0L;
+ private static long arraySize(GenericArray arr) {
+ return arr.getLength() != 0L ? arr.getSize() : 0L;
}
private long computeSize(InstanceKlass k) {
long size = 0L;
// the InstanceKlass object itself
- size += k.getObjectSize();
+ size += k.getSize();
// Constant pool
ConstantPool cp = k.getConstants();
- size += cp.getObjectSize();
- size += objectSize(cp.getCache());
- size += objectSize(cp.getTags());
+ size += cp.getSize();
+ if (cp.getCache() != null) {
+ size += cp.getCache().getSize();
+ }
+ size += arraySize(cp.getTags());
// Interfaces
size += arraySize(k.getLocalInterfaces());
size += arraySize(k.getTransitiveInterfaces());
// Inner classes
- size += objectSize(k.getInnerClasses());
+ size += arraySize(k.getInnerClasses());
// Fields
- size += objectSize(k.getFields());
+ size += arraySize(k.getFields());
// Methods
- ObjArray methods = k.getMethods();
+ MethodArray methods = k.getMethods();
int nmethods = (int) methods.getLength();
if (nmethods != 0L) {
- size += methods.getObjectSize();
+ size += methods.getSize();
for (int i = 0; i < nmethods; ++i) {
- Method m = (Method) methods.getObjAt(i);
- size += m.getObjectSize();
- size += objectSize(m.getConstMethod());
- }
- }
-
- // MethodOrdering - an int array that records the original
- // ordering of methods in the class file
- size += arraySize(k.getMethodOrdering());
+ Method m = methods.at(i);
+ size += m.getSize();
+ size += m.getConstMethod().getSize();
+ }
+ }
return size;
}
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -31,7 +31,7 @@ import sun.jvm.hotspot.oops.*;
/** Traverses and prints the stack traces for all Java threads in the
* remote VM */
public class StackTrace extends Tool {
- // in non-verbose mode pc, sp and methodOop are not printed
+ // in non-verbose mode pc, sp and Method* are not printed
public StackTrace(boolean v, boolean concurrentLocks) {
this.verbose = v;
this.concurrentLocks = concurrentLocks;
@@ -89,7 +89,7 @@ public class StackTrace extends Tool {
tty.print(", pc=" + pc);
}
- tty.print(", methodOop=" + method.getHandle());
+ tty.print(", Method*=" + method.getAddress());
}
if (vf.isCompiledFrame()) {
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -73,7 +73,7 @@ public class ByteCodeRewriter
return (short) cpCacheIndex;
} else if (fmt.indexOf("JJJJ") >= 0) {
// change byte-ordering and go via secondary cache entry
- return (short) cpCache.getMainEntryAt(bytes.swapInt(cpCacheIndex)).getConstantPoolIndex();
+ throw new InternalError("unimplemented");
} else if (fmt.indexOf("JJ") >= 0) {
// change byte-ordering and go via cache
return (short) cpCache.getEntryAt((int) (0xFFFF & bytes.swapShort((short)cpCacheIndex))).getConstantPoolIndex();
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java Sat Sep 01 13:25:18 2012 -0400
@@ -28,6 +28,7 @@ import java.util.*;
import java.util.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.utilities.*;
public class ClassWriter implements /* imports */ ClassConstants
{
@@ -42,10 +43,10 @@ public class ClassWriter implements /* i
protected ConstantPool cpool;
// Map between class name to index of type CONSTANT_Class
- protected Map classToIndex = new HashMap();
+ protected Map<String, Short> classToIndex = new HashMap<String, Short>();
// Map between any modified UTF-8 and it's constant pool index.
- protected Map utf8ToIndex = new HashMap();
+ protected Map<String, Short> utf8ToIndex = new HashMap<String, Short>();
// constant pool index for attribute names.
@@ -61,12 +62,12 @@ public class ClassWriter implements /* i
protected short _signatureIndex;
protected static int extractHighShortFromInt(int val) {
- // must stay in sync with constantPoolOopDesc::name_and_type_at_put, method_at_put, etc.
+ // must stay in sync with ConstantPool::name_and_type_at_put, method_at_put, etc.
return (val >> 16) & 0xFFFF;
}
protected static int extractLowShortFromInt(int val) {
- // must stay in sync with constantPoolOopDesc::name_and_type_at_put, method_at_put, etc.
+ // must stay in sync with ConstantPool::name_and_type_at_put, method_at_put, etc.
return val & 0xFFFF;
}
@@ -107,8 +108,8 @@ public class ClassWriter implements /* i
}
protected void writeConstantPool() throws IOException {
- final TypeArray tags = cpool.getTags();
- final long len = tags.getLength();
+ final U1Array tags = cpool.getTags();
+ final long len = tags.length();
dos.writeShort((short) len);
if (DEBUG) debugMessage("constant pool length = " + len);
@@ -118,7 +119,7 @@ public class ClassWriter implements /* i
// collect all modified UTF-8 Strings from Constant Pool
for (ci = 1; ci < len; ci++) {
- byte cpConstType = tags.getByteAt(ci);
+ int cpConstType = tags.at(ci);
if(cpConstType == JVM_CONSTANT_Utf8) {
Symbol sym = cpool.getSymbolAt(ci);
utf8ToIndex.put(sym.asString(), new Short((short) ci));
@@ -182,9 +183,9 @@ public class ClassWriter implements /* i
if (DEBUG) debugMessage("Signature index = " + _signatureIndex);
for(ci = 1; ci < len; ci++) {
+ int cpConstType = tags.at(ci);
// write cp_info
// write constant type
- byte cpConstType = tags.getByteAt(ci);
switch(cpConstType) {
case JVM_CONSTANT_Utf8: {
dos.writeByte(cpConstType);
@@ -226,12 +227,11 @@ public class ClassWriter implements /* i
ci++;
break;
- case JVM_CONSTANT_Class: {
- dos.writeByte(cpConstType);
- // Klass already resolved. ConstantPool constains klassOop.
- Klass refKls = (Klass) cpool.getObjAtRaw(ci);
- String klassName = refKls.getName().asString();
-
+ case JVM_CONSTANT_Class:
+ case JVM_CONSTANT_UnresolvedClass:
+ case JVM_CONSTANT_UnresolvedClassInError: {
+ dos.writeByte(JVM_CONSTANT_Class);
+ String klassName = cpool.getKlassNameAt(ci).asString();
Short s = (Short) utf8ToIndex.get(klassName);
classToIndex.put(klassName, new Short((short)ci));
dos.writeShort(s.shortValue());
@@ -239,35 +239,10 @@ public class ClassWriter implements /* i
break;
}
- // case JVM_CONSTANT_ClassIndex:
- case JVM_CONSTANT_UnresolvedClassInError:
- case JVM_CONSTANT_UnresolvedClass: {
- dos.writeByte(JVM_CONSTANT_Class);
- String klassName = cpool.getSymbolAt(ci).asString();
-
- Short s = (Short) utf8ToIndex.get(klassName);
- classToIndex.put(klassName, new Short((short) ci));
-
- dos.writeShort(s.shortValue());
- if (DEBUG) debugMessage("CP[" + ci + "] = class " + s);
- break;
- }
-
case JVM_CONSTANT_String: {
dos.writeByte(cpConstType);
- String str = OopUtilities.stringOopToString(cpool.getObjAtRaw(ci));
+ String str = cpool.getUnresolvedStringAt(ci).asString();
Short s = (Short) utf8ToIndex.get(str);
- dos.writeShort(s.shortValue());
- if (DEBUG) debugMessage("CP[" + ci + "] = string " + s);
- break;
- }
-
- // case JVM_CONSTANT_StringIndex:
- case JVM_CONSTANT_UnresolvedString: {
- dos.writeByte(JVM_CONSTANT_String);
- String val = cpool.getSymbolAt(ci).asString();
-
- Short s = (Short) utf8ToIndex.get(val);
dos.writeShort(s.shortValue());
if (DEBUG) debugMessage("CP[" + ci + "] = string " + s);
break;
@@ -363,15 +338,15 @@ public class ClassWriter implements /* i
}
}
protected void writeInterfaces() throws IOException {
- ObjArray interfaces = klass.getLocalInterfaces();
- final int len = (int) interfaces.getLength();
+ KlassArray interfaces = klass.getLocalInterfaces();
+ final int len = interfaces.length();
if (DEBUG) debugMessage("number of interfaces = " + len);
// write interfaces count
dos.writeShort((short) len);
for (int i = 0; i < len; i++) {
- Klass k = (Klass) interfaces.getObjAt(i);
+ Klass k = interfaces.getAt(i);
Short index = (Short) classToIndex.get(k.getName().asString());
dos.writeShort(index.shortValue());
if (DEBUG) debugMessage("\t" + index);
@@ -379,7 +354,8 @@ public class ClassWriter implements /* i
}
protected void writeFields() throws IOException {
- final int length = klass.getJavaFieldsCount();
+ U2Array fields = klass.getFields();
+ final int length = (int) fields.length();
// write number of fields
dos.writeShort((short) length);
@@ -447,13 +423,13 @@ public class ClassWriter implements /* i
}
protected void writeMethods() throws IOException {
- ObjArray methods = klass.getMethods();
- final int len = (int) methods.getLength();
+ MethodArray methods = klass.getMethods();
+ final int len = methods.length();
// write number of methods
dos.writeShort((short) len);
if (DEBUG) debugMessage("number of methods = " + len);
for (int m = 0; m < len; m++) {
- writeMethod((Method) methods.getObjAt(m));
+ writeMethod(methods.at(m));
}
}
@@ -683,8 +659,8 @@ public class ClassWriter implements /* i
if (genericSignature != null)
classAttributeCount++;
- TypeArray innerClasses = klass.getInnerClasses();
- final int numInnerClasses = (int) (innerClasses.getLength() / 4);
+ U2Array innerClasses = klass.getInnerClasses();
+ final int numInnerClasses = (int) (innerClasses.length() / 4);
if (numInnerClasses != 0)
classAttributeCount++;
@@ -724,7 +700,7 @@ public class ClassWriter implements /* i
if (DEBUG) debugMessage("class has " + numInnerClasses + " inner class entries");
for (int index = 0; index < numInnerClasses * 4; index++) {
- dos.writeShort(innerClasses.getShortAt(index));
+ dos.writeShort(innerClasses.at(index));
}
}
}
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -126,7 +126,7 @@ public class SOQL extends Tool {
for (int i = 0; i < klasses.length; i++) {
out.print(klasses[i].getName().asString().replace('/', '.'));
out.print(" @");
- out.println(klasses[i].getHandle());
+ out.println(klasses[i].getAddress());
}
}
@@ -150,7 +150,8 @@ public class SOQL extends Tool {
}
// list immediate fields only
- int numFields = klass.getJavaFieldsCount();
+ U2Array fields = klass.getFields();
+ int numFields = (int) fields.length();
ConstantPool cp = klass.getConstants();
out.println("fields");
if (numFields != 0) {
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/CodeViewerPanel.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/CodeViewerPanel.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -66,7 +66,7 @@ public class CodeViewerPanel extends JPa
JPanel topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
- topPanel.add(new JLabel("Enter PC or methodOop/klassOop Address: "), BorderLayout.WEST);
+ topPanel.add(new JLabel("Enter PC or Method*/Klass* Address: "), BorderLayout.WEST);
address = new HistoryComboBox();
topPanel.add(address, BorderLayout.CENTER);
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java Sat Sep 01 13:25:18 2012 -0400
@@ -313,7 +313,7 @@ public class HTMLGenerator implements /*
buf.append(' ');
}
buf.append('@');
- buf.append(klass.getHandle().toString());
+ buf.append(klass.getAddress().toString());
return buf.toString();
}
@@ -322,7 +322,7 @@ public class HTMLGenerator implements /*
}
protected String genKlassHref(InstanceKlass klass) {
- return genBaseHref() + "klass=" + klass.getHandle();
+ return genBaseHref() + "klass=" + klass.getAddress();
}
protected String genKlassLink(InstanceKlass klass) {
@@ -403,12 +403,12 @@ public class HTMLGenerator implements /*
buf.append(genMethodNameAndSignature(method));
buf.append(' ');
buf.append('@');
- buf.append(method.getHandle().toString());
+ buf.append(method.getAddress().toString());
return buf.toString();
}
protected String genMethodHref(Method m) {
- return genBaseHref() + "method=" + m.getHandle();
+ return genBaseHref() + "method=" + m.getAddress();
}
protected String genMethodLink(Method m) {
@@ -498,7 +498,7 @@ public class HTMLGenerator implements /*
buf.beginTag("tr");
buf.cell(Integer.toString(index));
- int ctag = (int) cpool.getTags().getByteAt((int) index);
+ int ctag = (int) cpool.getTags().at((int) index);
switch (ctag) {
case JVM_CONSTANT_Integer:
buf.cell("JVM_CONSTANT_Integer");
@@ -526,7 +526,7 @@ public class HTMLGenerator implements /*
case JVM_CONSTANT_UnresolvedClass:
buf.cell("JVM_CONSTANT_UnresolvedClass");
- buf.cell(cpool.getSymbolAt(index).asString());
+ buf.cell(cpool.getKlassNameAt(index).asString());
break;
case JVM_CONSTANT_UnresolvedClassInError:
@@ -536,7 +536,7 @@ public class HTMLGenerator implements /*
case JVM_CONSTANT_Class:
buf.cell("JVM_CONSTANT_Class");
- Klass klass = (Klass) cpool.getObjAtRaw(index);
+ Klass klass = (Klass) cpool.getKlassAt(index);
if (klass instanceof InstanceKlass) {
buf.cell(genKlassLink((InstanceKlass) klass));
} else {
@@ -544,13 +544,6 @@ public class HTMLGenerator implements /*
}
break;
- case JVM_CONSTANT_UnresolvedString:
- buf.cell("JVM_CONSTANT_UnresolvedString");
- buf.cell("\"" +
- escapeHTMLSpecialChars(cpool.getSymbolAt(index).asString()) +
- "\"");
- break;
-
case JVM_CONSTANT_Utf8:
buf.cell("JVM_CONSTANT_Utf8");
buf.cell("\"" +
@@ -561,7 +554,7 @@ public class HTMLGenerator implements /*
case JVM_CONSTANT_String:
buf.cell("JVM_CONSTANT_String");
buf.cell("\"" +
- escapeHTMLSpecialChars(OopUtilities.stringOopToString(cpool.getObjAtRaw(index))) + "\"");
+ escapeHTMLSpecialChars(cpool.getUnresolvedStringAt(index).asString()) + "\"");
break;
case JVM_CONSTANT_Fieldref:
@@ -637,7 +630,7 @@ public class HTMLGenerator implements /*
}
protected String genConstantPoolHref(ConstantPool cpool) {
- return genBaseHref() + "cpool=" + cpool.getHandle();
+ return genBaseHref() + "cpool=" + cpool.getAddress();
}
protected String genConstantPoolTitle(ConstantPool cpool) {
@@ -645,7 +638,7 @@ public class HTMLGenerator implements /*
buf.append("Constant Pool of [");
buf.append(genKlassTitle((InstanceKlass) cpool.getPoolHolder()));
buf.append("] @");
- buf.append(cpool.getHandle().toString());
+ buf.append(cpool.getAddress().toString());
return buf.toString();
}
@@ -678,10 +671,10 @@ public class HTMLGenerator implements /*
for (int exp = 0; exp < exceptions.length; exp++) {
short cpIndex = (short) exceptions[exp].getClassCPIndex();
ConstantPool.CPSlot obj = cpool.getSlotAt(cpIndex);
- if (obj.isMetaData()) {
+ if (obj.isUnresolved()) {
buf.li((obj.getSymbol()).asString().replace('/', '.'));
} else {
- buf.li(genKlassLink((InstanceKlass)obj.getOop()));
+ buf.li(genKlassLink((InstanceKlass)obj.getKlass()));
}
}
buf.endTag("ul");
@@ -723,7 +716,7 @@ public class HTMLGenerator implements /*
try {
instrStr = escapeHTMLSpecialChars(instr.toString());
} catch (RuntimeException re) {
- buf.append("exception during bytecode processing");
+ buf.append("exception while printing " + instr.getBytecodeName());
buf.endTag("td");
buf.endTag("tr");
re.printStackTrace();
@@ -762,7 +755,7 @@ public class HTMLGenerator implements /*
BytecodeLoadConstant ldc = (BytecodeLoadConstant) instr;
if (ldc.isKlassConstant()) {
Object oop = ldc.getKlass();
- if (oop instanceof Klass) {
+ if (oop instanceof InstanceKlass) {
buf.append("<a href='");
buf.append(genKlassHref((InstanceKlass) oop));
buf.append("'>");
@@ -812,10 +805,10 @@ public class HTMLGenerator implements /*
ConstantPool.CPSlot obj = cpIndex == 0? null : cpool.getSlotAt(cpIndex);
if (obj == null) {
buf.cell("Any");
- } else if (obj.isMetaData()) {
+ } else if (obj.isUnresolved()) {
buf.cell(obj.getSymbol().asString().replace('/', '.'));
} else {
- buf.cell(genKlassLink((InstanceKlass)obj.getOop()));
+ buf.cell(genKlassLink((InstanceKlass)obj.getKlass()));
}
buf.endTag("tr");
}
@@ -843,7 +836,7 @@ public class HTMLGenerator implements /*
}
// genHTML for a given address. Address may be a PC or
- // methodOop or klassOop.
+ // Method* or Klass*.
public String genHTMLForAddress(String addrStr) {
return genHTML(parseAddress(addrStr));
@@ -878,9 +871,9 @@ public class HTMLGenerator implements /*
}
// did not find nmethod.
- // try methodOop, klassOop and constantPoolOop.
+ // try Method*, Klass* and ConstantPool*.
try {
- Oop obj = getOopAtAddress(pc);
+ Metadata obj = Metadata.instantiateWrapperFor(pc);
if (obj != null) {
if (obj instanceof Method) {
return genHTML((Method) obj);
@@ -891,6 +884,7 @@ public class HTMLGenerator implements /*
}
}
} catch (Exception exp) {
+ exp.printStackTrace();
// ignore
}
@@ -1120,11 +1114,15 @@ public class HTMLGenerator implements /*
Assert.that(klHandle != null, "scalar replaced object klass must be not NULL");
}
Oop obj = VM.getVM().getObjectHeap().newOop(klHandle);
- if (obj instanceof InstanceKlass) {
- InstanceKlass kls = (InstanceKlass) obj;
+ // Obj is a Java mirror
+ Klass klass = java_lang_Class.asKlass(obj);
+ if (klass instanceof InstanceKlass) {
+ InstanceKlass kls = (InstanceKlass) klass;
buf.append(" " + kls.getName().asString() + "={");
int flen = ov.fieldsSize();
- int klen = kls.getJavaFieldsCount();
+
+ U2Array klfields = kls.getFields();
+ int klen = (int) klfields.length();
int findex = 0;
for (int index = 0; index < klen; index++) {
int accsFlags = kls.getFieldAccessFlags(index);
@@ -1140,11 +1138,11 @@ public class HTMLGenerator implements /*
} else {
buf.append(" ");
int flen = ov.fieldsSize();
- if (obj instanceof TypeArrayKlass) {
- TypeArrayKlass kls = (TypeArrayKlass) obj;
+ if (klass instanceof TypeArrayKlass) {
+ TypeArrayKlass kls = (TypeArrayKlass) klass;
buf.append(kls.getElementTypeName() + "[" + flen + "]");
- } else if (obj instanceof ObjArrayKlass) {
- ObjArrayKlass kls = (ObjArrayKlass) obj;
+ } else if (klass instanceof ObjArrayKlass) {
+ ObjArrayKlass kls = (ObjArrayKlass) klass;
Klass elobj = kls.getBottomKlass();
if (elobj instanceof InstanceKlass) {
buf.append(elobj.getName().asString());
@@ -1687,7 +1685,7 @@ public class HTMLGenerator implements /*
StringBuffer buf = new StringBuffer(genBaseHref());
buf.append("jcore_multiple=");
for (int k = 0; k < klasses.length; k++) {
- buf.append(klasses[k].getHandle().toString());
+ buf.append(klasses[k].getAddress().toString());
buf.append(',');
}
return buf.toString();
@@ -1743,13 +1741,13 @@ public class HTMLGenerator implements /*
protected String genHTMLListForMethods(InstanceKlass klass) {
Formatter buf = new Formatter(genHTML);
- ObjArray methods = klass.getMethods();
- int numMethods = (int) methods.getLength();
+ MethodArray methods = klass.getMethods();
+ int numMethods = methods.length();
if (numMethods != 0) {
buf.h3("Methods");
buf.beginTag("ul");
for (int m = 0; m < numMethods; m++) {
- Method mtd = (Method) methods.getObjAt(m);
+ Method mtd = methods.at(m);
buf.li(genMethodLink(mtd) + ";");
}
buf.endTag("ul");
@@ -1760,13 +1758,13 @@ public class HTMLGenerator implements /*
protected String genHTMLListForInterfaces(InstanceKlass klass) {
try {
Formatter buf = new Formatter(genHTML);
- ObjArray interfaces = klass.getLocalInterfaces();
- int numInterfaces = (int) interfaces.getLength();
+ KlassArray interfaces = klass.getLocalInterfaces();
+ int numInterfaces = interfaces.length();
if (numInterfaces != 0) {
buf.h3("Interfaces");
buf.beginTag("ul");
for (int i = 0; i < numInterfaces; i++) {
- InstanceKlass inf = (InstanceKlass) interfaces.getObjAt(i);
+ InstanceKlass inf = (InstanceKlass) interfaces.getAt(i);
buf.li(genKlassLink(inf));
}
buf.endTag("ul");
@@ -1822,7 +1820,8 @@ public class HTMLGenerator implements /*
protected String genHTMLListForFields(InstanceKlass klass) {
Formatter buf = new Formatter(genHTML);
- int numFields = klass.getJavaFieldsCount();
+ U2Array fields = klass.getFields();
+ int numFields = klass.getAllFieldsCount();
if (numFields != 0) {
buf.h3("Fields");
buf.beginList();
@@ -1857,7 +1856,7 @@ public class HTMLGenerator implements /*
}
protected String genKlassHierarchyHref(InstanceKlass klass) {
- return genBaseHref() + "hierarchy=" + klass.getHandle();
+ return genBaseHref() + "hierarchy=" + klass.getAddress();
}
protected String genKlassHierarchyTitle(InstanceKlass klass) {
@@ -1919,7 +1918,7 @@ public class HTMLGenerator implements /*
}
protected String genDumpKlassHref(InstanceKlass klass) {
- return genBaseHref() + "jcore=" + klass.getHandle();
+ return genBaseHref() + "jcore=" + klass.getAddress();
}
protected String genDumpKlassLink(InstanceKlass klass) {
@@ -1990,6 +1989,21 @@ public class HTMLGenerator implements /*
protected Oop getOopAtAddress(String address) {
sun.jvm.hotspot.debugger.Address addr = parseAddress(address);
return getOopAtAddress(addr);
+ }
+
+ protected Klass getKlassAtAddress(String address) {
+ sun.jvm.hotspot.debugger.Address addr = parseAddress(address);
+ return (Klass)Metadata.instantiateWrapperFor(addr);
+ }
+
+ protected Method getMethodAtAddress(String address) {
+ sun.jvm.hotspot.debugger.Address addr = parseAddress(address);
+ return (Method)Metadata.instantiateWrapperFor(addr);
+ }
+
+ protected ConstantPool getConstantPoolAtAddress(String address) {
+ sun.jvm.hotspot.debugger.Address addr = parseAddress(address);
+ return (ConstantPool) Metadata.instantiateWrapperFor(addr);
}
private void dumpKlass(InstanceKlass kls) throws IOException {
@@ -2082,18 +2096,18 @@ public class HTMLGenerator implements /*
public String genHTMLForHyperlink(String href) {
if (href.startsWith("klass=")) {
href = href.substring(href.indexOf('=') + 1);
- Oop obj = getOopAtAddress(href);
+ Klass k = getKlassAtAddress(href);
if (Assert.ASSERTS_ENABLED) {
- Assert.that(obj instanceof InstanceKlass, "class= href with improper InstanceKlass!");
- }
- return genHTML((InstanceKlass) obj);
+ Assert.that(k instanceof InstanceKlass, "class= href with improper InstanceKlass!");
+ }
+ return genHTML((InstanceKlass) k);
} else if (href.startsWith("method=")) {
href = href.substring(href.indexOf('=') + 1);
- Oop obj = getOopAtAddress(href);
+ Method obj = getMethodAtAddress(href);
if (Assert.ASSERTS_ENABLED) {
Assert.that(obj instanceof Method, "method= href with improper Method!");
}
- return genHTML((Method) obj);
+ return genHTML(obj);
} else if (href.startsWith("nmethod=")) {
String addr = href.substring(href.indexOf('=') + 1);
Object obj = VMObjectFactory.newObject(NMethod.class, parseAddress(addr));
@@ -2117,21 +2131,21 @@ public class HTMLGenerator implements /*
return genInterpreterCodeletLinksPage();
} else if (href.startsWith("hierarchy=")) {
href = href.substring(href.indexOf('=') + 1);
- Oop obj = getOopAtAddress(href);
+ Klass obj = getKlassAtAddress(href);
if (Assert.ASSERTS_ENABLED) {
Assert.that(obj instanceof InstanceKlass, "class= href with improper InstanceKlass!");
}
return genHTMLForKlassHierarchy((InstanceKlass) obj);
} else if (href.startsWith("cpool=")) {
href = href.substring(href.indexOf('=') + 1);
- Oop obj = getOopAtAddress(href);
+ ConstantPool obj = getConstantPoolAtAddress(href);
if (Assert.ASSERTS_ENABLED) {
Assert.that(obj instanceof ConstantPool, "cpool= href with improper ConstantPool!");
}
- return genHTML((ConstantPool) obj);
+ return genHTML(obj);
} else if (href.startsWith("jcore=")) {
href = href.substring(href.indexOf('=') + 1);
- Oop obj = getOopAtAddress(href);
+ Klass obj = getKlassAtAddress(href);
if (Assert.ASSERTS_ENABLED) {
Assert.that(obj instanceof InstanceKlass, "jcore= href with improper InstanceKlass!");
}
@@ -2142,7 +2156,7 @@ public class HTMLGenerator implements /*
buf.genHTMLPrologue();
StringTokenizer st = new StringTokenizer(href, ",");
while (st.hasMoreTokens()) {
- Oop obj = getOopAtAddress(st.nextToken());
+ Klass obj = getKlassAtAddress(st.nextToken());
if (Assert.ASSERTS_ENABLED) {
Assert.that(obj instanceof InstanceKlass, "jcore_multiple= href with improper InstanceKlass!");
}
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/tree/BadAddressTreeNodeAdapter.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ui/tree/BadAddressTreeNodeAdapter.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2012, 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
@@ -27,36 +27,38 @@ import java.io.*;
import java.io.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.oops.*;
+import sun.jvm.hotspot.runtime.VM;
/** Simple wrapper for displaying bad addresses in the Inspector */
public class BadAddressTreeNodeAdapter extends FieldTreeNodeAdapter {
- private boolean usingAddress;
- private Address addr;
- private long addrValue;
+ private String message;
- public BadAddressTreeNodeAdapter(Address addr, FieldIdentifier id) {
- this(addr, id, false);
+ private static String generateMessage(long addr, String kind) {
+ return "** BAD " + kind + " " + Long.toHexString(addr) + " **";
+ }
+
+ public BadAddressTreeNodeAdapter(Address addr, MetadataField field, boolean treeTableMode) {
+ super(field.getID(), treeTableMode);
+ message = generateMessage(addr.minus(null), "METADATA");
+ }
+
+ public BadAddressTreeNodeAdapter(Address addr, OopField field, boolean treeTableMode) {
+ super(field.getID(), treeTableMode);
+ message = generateMessage(addr.minus(null), "OOP");
+ }
+
+ public BadAddressTreeNodeAdapter(OopHandle addr, FieldIdentifier id, boolean treeTableMode) {
+ super(id, treeTableMode);
+ message = generateMessage(addr.minus(null), "OOP");
}
/** The address may be null (for address fields of structures which
are null); the FieldIdentifier may also be null (for the root
node). */
- public BadAddressTreeNodeAdapter(Address addr, FieldIdentifier id, boolean treeTableMode) {
+ public BadAddressTreeNodeAdapter(long addr, FieldIdentifier id, boolean treeTableMode) {
super(id, treeTableMode);
- this.addr = addr;
- usingAddress = true;
- }
-
- public BadAddressTreeNodeAdapter(long addr, FieldIdentifier id) {
- this(addr, id, false);
- }
-
- /** He FieldIdentifier may be null (for the root node). */
- public BadAddressTreeNodeAdapter(long addrValue, FieldIdentifier id, boolean treeTableMode) {
- super(id, treeTableMode);
- this.addrValue = addrValue;
- usingAddress = false;
+ message = generateMessage(addr, "ADDRESS");
}
public int getChildCount() {
@@ -76,17 +78,6 @@ public class BadAddressTreeNodeAdapter e
}
public String getValue() {
- // FIXME: should have this better factored to not have to replicate this code
- String addrString = null;
- if (usingAddress) {
- if (addr == null) {
- addrString = "0x0";
- } else {
- addrString = addr.toString();
+ return message;
}
- } else {
- addrString = "0x" + Long.toHexString(addrValue);
}
- return "** BAD ADDRESS " + addrString + " **";
- }
-}
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CTypeTreeNodeAdapter.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CTypeTreeNodeAdapter.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2012, 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
@@ -133,11 +133,11 @@ public class CTypeTreeNodeAdapter extend
Oop oop = VM.getVM().getObjectHeap().newOop(handle);
return new OopTreeNodeAdapter(oop, cf, getTreeTableMode());
} catch (AddressException e) {
- return new BadOopTreeNodeAdapter(handle,
+ return new BadAddressTreeNodeAdapter(handle,
new CTypeFieldIdentifier(type, f),
getTreeTableMode());
} catch (UnknownOopException e) {
- return new BadOopTreeNodeAdapter(handle,
+ return new BadAddressTreeNodeAdapter(handle,
new CTypeFieldIdentifier(type, f),
getTreeTableMode());
}
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -124,6 +124,7 @@ public class OopTreeNodeAdapter extends
numFields = 0;
}
+ public void doMetadata(MetadataField field, boolean isVMField) { ++numFields; }
public void doOop(OopField field, boolean isVMField) { ++numFields; }
public void doByte(ByteField field, boolean isVMField) { ++numFields; }
public void doChar(CharField field, boolean isVMField) { ++numFields; }
@@ -155,14 +156,27 @@ public class OopTreeNodeAdapter extends
curField = 0;
}
+ public void doMetadata(MetadataField field, boolean isVMField) {
+ if (curField == index) {
+ try {
+ child = new MetadataTreeNodeAdapter(field.getValue(getObj()), field.getID(), getTreeTableMode());
+ } catch (AddressException e) {
+ child = new BadAddressTreeNodeAdapter(getObj().getHandle().getAddressAt(field.getOffset()), field, getTreeTableMode());
+ } catch (UnknownOopException e) {
+ child = new BadAddressTreeNodeAdapter(getObj().getHandle().getAddressAt(field.getOffset()), field, getTreeTableMode());
+ }
+ }
+ ++curField;
+ }
+
public void doOop(OopField field, boolean isVMField) {
if (curField == index) {
try {
child = new OopTreeNodeAdapter(field.getValue(getObj()), field.getID(), getTreeTableMode());
} catch (AddressException e) {
- child = new BadOopTreeNodeAdapter(field.getValueAsOopHandle(getObj()), field.getID(), getTreeTableMode());
+ child = new BadAddressTreeNodeAdapter(field.getValueAsOopHandle(getObj()), field, getTreeTableMode());
} catch (UnknownOopException e) {
- child = new BadOopTreeNodeAdapter(field.getValueAsOopHandle(getObj()), field.getID(), getTreeTableMode());
+ child = new BadAddressTreeNodeAdapter(field.getValueAsOopHandle(getObj()), field, getTreeTableMode());
}
}
++curField;
--- a/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2012, 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
@@ -217,14 +217,7 @@ public abstract class AbstractHeapGraphW
oop.iterate(new DefaultOopVisitor() {
public void doOop(OopField field, boolean isVMField) {
try {
- Oop ref = field.getValue(oop);
- if (ref instanceof TypeArray ||
- ref instanceof ObjArray ||
- ref instanceof Instance) {
writeReferenceField(oop, field);
- } else {
- writeInternalReferenceField(oop, field);
- }
} catch (IOException exp) {
throw new RuntimeException(exp);
}
@@ -299,11 +292,88 @@ public abstract class AbstractHeapGraphW
}
}
+ // write instance fields of given object
+ protected void writeObjectFields(final InstanceKlass oop) throws IOException {
+ try {
+ oop.iterateStaticFields(new DefaultOopVisitor() {
+ public void doOop(OopField field, boolean isVMField) {
+ try {
+ writeReferenceField(null, field);
+ } catch (IOException exp) {
+ throw new RuntimeException(exp);
+ }
+ }
+
+ public void doByte(ByteField field, boolean isVMField) {
+ try {
+ writeByteField(null, field);
+ } catch (IOException exp) {
+ throw new RuntimeException(exp);
+ }
+ }
+
+ public void doChar(CharField field, boolean isVMField) {
+ try {
+ writeCharField(null, field);
+ } catch (IOException exp) {
+ throw new RuntimeException(exp);
+ }
+ }
+
+ public void doBoolean(BooleanField field, boolean vField) {
+ try {
+ writeBooleanField(null, field);
+ } catch (IOException exp) {
+ throw new RuntimeException(exp);
+