changeset 3599:da91efe96a93

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>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents 36d1d483d5d6
children 03049e0e8544
files 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
diffstat 884 files changed, 34764 insertions(+), 91596 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
   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 @@
   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 @@
   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 @@
 // 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 @@
     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 @@
 // 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 @@
     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 @@
 // 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 @@
    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,29 +634,57 @@
                 } 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));
+                                    }
+                                }
+                            }
+                        }
+                        );
+                }
+            }
+        },
         new Command("dumpideal", "dumpideal { -a | id }", false) {
             // Do a full dump of the nodes reachabile from root in each compiler thread.
             public void doit(Tokens t) {
@@ -1229,7 +1257,7 @@
                             }
                         };
                     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 @@
                                 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 @@
                                                        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 @@
                             }
                           }
 
-                          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)) {
@@ -1069,9 +1062,6 @@
                           } else if (heap.oldGen().isIn(handle)) {
                             anno = "PSOldGen ";
                             bad = false;
-                          } else if (heap.permGen().isIn(handle)) {
-                            anno = "PSPermGen ";
-                            bad = false;
                           }
                         } else {
                           // Optimistically assume the oop isn't bad
--- 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 @@
   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 @@
         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 @@
       }
     }
     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,9 +739,11 @@
                                            "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/ciArrayKlassKlass.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-package sun.jvm.hotspot.ci;
-
-import java.io.PrintStream;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.oops.*;
-import sun.jvm.hotspot.types.*;
-
-public class ciArrayKlassKlass extends ciKlassKlass {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
-    Type type      = db.lookupType("ciArrayKlassKlass");
-  }
-
-
-  public ciArrayKlassKlass(Address addr) {
-    super(addr);
-  }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/src/share/classes/sun/jvm/hotspot/ci/ciBaseObject.java	Sat Sep 01 13:25:18 2012 -0400
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ */
+
+package sun.jvm.hotspot.ci;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.oops.*;
+import sun.jvm.hotspot.types.*;
+
+public class ciBaseObject extends VMObject {
+  static {
+    VM.registerVMInitializedObserver(new Observer() {
+        public void update(Observable o, Object data) {
+          initialize(VM.getVM().getTypeDataBase());
+        }
+      });
+  }
+
+  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
+    Type type      = db.lookupType("ciBaseObject");
+    identField = new CIntField(type.getCIntegerField("_ident"), 0);
+  }
+
+  private static CIntField identField;
+
+  public ciBaseObject(Address addr) {
+    super(addr);
+  }
+}
--- 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 @@
     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 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/ciInstanceKlassKlass.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-package sun.jvm.hotspot.ci;
-
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.oops.*;
-import sun.jvm.hotspot.types.*;
-
-public class ciInstanceKlassKlass extends ciKlassKlass {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
-    Type type      = db.lookupType("ciInstanceKlassKlass");
-  }
-
-
-  public ciInstanceKlassKlass(Address addr) {
-    super(addr);
-  }
-}
--- a/agent/src/share/classes/sun/jvm/hotspot/ci/ciKlassKlass.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-package sun.jvm.hotspot.ci;
-
-import java.io.PrintStream;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.oops.*;
-import sun.jvm.hotspot.types.*;
-
-public class ciKlassKlass extends ciKlass {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
-    Type type      = db.lookupType("ciKlassKlass");
-  }
-
-
-  public ciKlassKlass(Address addr) {
-    super(addr);
-  }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/src/share/classes/sun/jvm/hotspot/ci/ciMetadata.java	Sat Sep 01 13:25:18 2012 -0400
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ */
+
+package sun.jvm.hotspot.ci;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.oops.*;
+import sun.jvm.hotspot.types.*;
+
+public class ciMetadata extends ciBaseObject {
+  static {
+    VM.registerVMInitializedObserver(new Observer() {
+        public void update(Observable o, Object data) {
+          initialize(VM.getVM().getTypeDataBase());
+        }
+      });
+  }
+
+  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
+    Type type      = db.lookupType("ciMetadata");
+    metadataField = new MetadataField(type.getAddressField("_metadata"), 0);
+  }
+
+  private static MetadataField metadataField;
+
+  public Metadata getMetadata() {
+    return metadataField.getValue(getAddress());
+  }
+
+  public ciMetadata(Address addr) {
+    super(addr);
+  }
+
+  public void printOn(PrintStream out) {
+    getMetadata().printValueOn(out);
+  }
+
+  public String toString() {
+    return getMetadata().toString();
+  }
+}
--- 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.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 Method method() {
-    return (Method)getOop();
+    return (Method)getMetadata();
   }
 
   public int interpreterThrowoutCount() {
@@ -75,7 +75,7 @@
   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 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.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 @@
     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 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/ciMethodKlass.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-package sun.jvm.hotspot.ci;
-
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.oops.*;
-import sun.jvm.hotspot.types.*;
-
-public class ciMethodKlass extends ciKlass {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
-    Type type      = db.lookupType("ciMethodKlass");
-  }
-
-
-  public ciMethodKlass(Address addr) {
-    super(addr);
-  }
-}
--- a/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlassKlass.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-package sun.jvm.hotspot.ci;
-
-import java.io.PrintStream;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.oops.*;
-import sun.jvm.hotspot.types.*;
-
-public class ciObjArrayKlassKlass extends ciArrayKlassKlass {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
-    Type type      = db.lookupType("ciObjArrayKlassKlass");
-  }
-
-
-  public ciObjArrayKlassKlass(Address addr) {
-    super(addr);
-  }
-}
--- 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.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 @@
 
   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 @@
   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 @@
     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 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.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 @@
 
   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.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/ciTypeArrayKlassKlass.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-package sun.jvm.hotspot.ci;
-
-import java.io.PrintStream;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.oops.*;
-import sun.jvm.hotspot.types.*;
-
-public class ciTypeArrayKlassKlass extends ciArrayKlassKlass {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
-    Type type      = db.lookupType("ciTypeArrayKlassKlass");
-  }
-
-
-  public ciTypeArrayKlassKlass(Address addr) {
-    super(addr);
-  }
-}
--- 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 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);
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/src/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java	Sat Sep 01 13:25:18 2012 -0400
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ */
+
+package sun.jvm.hotspot.classfile;
+
+import java.io.PrintStream;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.oops.*;
+import sun.jvm.hotspot.types.*;
+
+public class ClassLoaderData extends VMObject {
+  static {
+    VM.registerVMInitializedObserver(new Observer() {
+        public void update(Observable o, Object data) {
+          initialize(VM.getVM().getTypeDataBase());
+        }
+      });
+  }
+
+  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
+    Type type      = db.lookupType("ClassLoaderData");
+    classLoaderField = type.getOopField("_class_loader");
+    nextField = type.getAddressField("_next");
+  }
+
+  private static sun.jvm.hotspot.types.OopField classLoaderField;
+  private static AddressField nextField;
+
+  public ClassLoaderData(Address addr) {
+    super(addr);
+  }
+
+  public static ClassLoaderData instantiateWrapperFor(Address addr) {
+    if (addr == null) {
+      return null;
+    }
+    return new ClassLoaderData(addr);
+  }
+
+  public Oop getClassLoader() {
+    return VM.getVM().getObjectHeap().newOop(classLoaderField.getValue(getAddress()));
+  }
+}
--- 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.runtime.VM;
 import sun.jvm.hotspot.utilities.*;
+import sun.jvm.hotspot.oops.Method;
 
 public class DebugInfoReadStream extends CompressedReadStream {
   private NMethod code;
@@ -53,6 +54,10 @@
     return code.getOopAt(readInt());
   }
 
+  public Method readMethod() {
+    return code.getMethodAt(readInt());
+  }
+
   ScopeValue readObjectValue() {
     int id = readInt();
     if (Assert.ASSERTS_ENABLED) {
--- 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 @@
 
 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 @@
   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 @@
   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 @@
     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 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 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 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 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);         }
@@ -205,6 +212,19 @@
     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()
   // FIXME: add lazy_interpreter_entry_point() for C2
 
@@ -412,6 +432,7 @@
   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 @@
     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 @@
     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 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/PSPermGen.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.gc_implementation.parallelScavenge;
-
-import java.io.*;
-import java.util.*;
-
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.gc_implementation.shared.*;
-import sun.jvm.hotspot.memory.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-
-public class PSPermGen extends PSOldGen {
-   static {
-      VM.registerVMInitializedObserver(new Observer() {
-         public void update(Observable o, Object data) {
-            initialize(VM.getVM().getTypeDataBase());
-         }
-      });
-   }
-
-   private static synchronized void initialize(TypeDataBase db) {
-      // just checking type existence
-      Type type = db.lookupType("PSPermGen");
-   }
-
-   public PSPermGen(Address addr) {
-      super(addr);
-   }
-
-   public void printOn(PrintStream tty) {
-      tty.print("PSPermGen [ ");
-      objectSpace().printOn(tty);
-      tty.print(" ] ");
-   }
-
-   // FIXME: no other stuff yet
-}
--- 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 @@
       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 @@
    // Fields
    private static AddressField youngGenField;
    private static AddressField oldGenField;
-   private static AddressField permGenField;
 
    // Accessors
    public PSYoungGen youngGen() {
@@ -66,10 +64,6 @@
       return (PSOldGen) VMObjectFactory.newObject(PSOldGen.class, oldGenField.getValue());
    }
 
-   public PSPermGen permGen() {
-      return (PSPermGen) VMObjectFactory.newObject(PSPermGen.class, permGenField.getValue());
-   }
-
    public long capacity() {
       return youngGen().capacity() + oldGen().capacity();
    }
@@ -87,10 +81,6 @@
          return true;
       }
 
-      if (permGen().isIn(a)) {
-         return true;
-      }
-
       return false;
    }
 
@@ -102,7 +92,6 @@
       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 @@
             }
          }
 
-         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 @@
          }
 
          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 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,20 +64,11 @@
   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() {
     return method().getConstants().getMethodRefAt(index());
   }
@@ -123,7 +113,7 @@
     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 int poolIndex() {
-    int i = rawIndex();
+    int index = rawIndex();
     if (hasCacheIndex()) {
-      ConstantPoolCache cpCache = method().getConstants().getCache();
-      return cpCache.getEntryAt(i).getConstantPoolIndex();
+      return method().getConstants().objectToCPIndex(index);
     } else {
-      return i;
+      return index;
     }
   }
 
@@ -72,8 +71,7 @@
   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 @@
        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 @@
     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 @@
        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 @@
   }
 
   // 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 @@
      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 @@
   }
 
   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 @@
 
   // 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 @@
     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 @@
 
     //  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 @@
         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 @@
     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 @@
     }
 
     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 @@
                 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/CMSPermGen.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.memory;
-
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-
-public class CMSPermGen extends PermGen {
-   // The "generation" view.
-   private static AddressField genField;
-
-   static {
-      VM.registerVMInitializedObserver(new Observer() {
-         public void update(Observable o, Object data) {
-            initialize(VM.getVM().getTypeDataBase());
-         }
-      });
-   }
-
-   private static synchronized void initialize(TypeDataBase db) {
-      Type type = db.lookupType("CMSPermGen");
-      genField = type.getAddressField("_gen");
-   }
-
-   public CMSPermGen(Address addr) {
-      super(addr);
-   }
-
-   public Generation asGen() {
-      return GenerationFactory.newObject(genField.getValue(addr));
-   }
-}
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/CMSPermGenGen.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.memory;
-
-import sun.jvm.hotspot.debugger.*;
-
-public class CMSPermGenGen extends ConcurrentMarkSweepGeneration {
-   public CMSPermGenGen(Address addr) {
-      super(addr);
-   }
-
-   public String name() {
-      return "concurrent-mark-sweep perm gen";
-   }
-}
--- 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 @@
       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 @@
             // 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/CompactingPermGen.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.memory;
-
-import java.util.*;
-
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-
-/** A PermGen implemented with a contiguous space. */
-
-public class CompactingPermGen extends PermGen {
-  // The "generation" view.
-  private static AddressField genField;
-
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) {
-    Type type = db.lookupType("CompactingPermGen");
-
-    genField = type.getAddressField("_gen");
-  }
-
-  public CompactingPermGen(Address addr) {
-    super(addr);
-  }
-
-  public Generation asGen() {
-    return GenerationFactory.newObject(genField.getValue(addr));
-  }
-}
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/CompactingPermGenGen.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.memory;
-
-import java.io.*;
-import java.util.*;
-
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-
-/** This is the "generation" view of a CompactingPermGen. */
-public class CompactingPermGenGen extends OneContigSpaceCardGeneration {
-  private static AddressField unsharedBottomField;
-  private static AddressField unsharedEndField;
-  private static AddressField sharedBottomField;
-  private static AddressField sharedEndField;
-  private static AddressField readOnlyBottomField;
-  private static AddressField readOnlyEndField;
-  private static AddressField readWriteBottomField;
-  private static AddressField readWriteEndField;
-  private static AddressField roSpaceField;
-  private static AddressField rwSpaceField;
-
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) {
-     Type type = db.lookupType("CompactingPermGenGen");
-     unsharedBottomField = type.getAddressField("unshared_bottom");
-     unsharedEndField = type.getAddressField("unshared_end");
-     sharedBottomField = type.getAddressField("shared_bottom");
-     sharedEndField = type.getAddressField("shared_end");
-     readOnlyBottomField = type.getAddressField("readonly_bottom");
-     readOnlyEndField = type.getAddressField("readonly_end");
-     readWriteBottomField = type.getAddressField("readwrite_bottom");
-     readWriteEndField = type.getAddressField("readwrite_end");
-     roSpaceField = type.getAddressField("_ro_space");
-     rwSpaceField = type.getAddressField("_rw_space");
-  }
-
-  public boolean isSharingEnabled() {
-    return VM.getVM().isSharingEnabled();
-  }
-
-  // NEEDS_CLEANUP
-  public CompactingPermGenGen(Address addr) {
-    super(addr);
-  }
-
-  public OffsetTableContigSpace roSpace() {
-    return newOffsetTableContigSpace(roSpaceField.getValue(addr));
-  }
-
-  public OffsetTableContigSpace rwSpace() {
-    return newOffsetTableContigSpace(rwSpaceField.getValue(addr));
-  }
-
-  public String name() {
-    return "compacting permanent generation";
-  }
-
-  public static Address unsharedBottom() {
-    return unsharedBottomField.getValue();
-  }
-
-  public static Address unsharedEnd() {
-    return unsharedEndField.getValue();
-  }
-
-  public static Address sharedBottom() {
-    return sharedBottomField.getValue();
-  }
-
-  public static Address sharedEnd() {
-    return sharedEndField.getValue();
-  }
-
-  public static Address readOnlyBottom() {
-    return readOnlyBottomField.getValue();
-  }
-
-  public static Address readOnlyEnd() {
-    return readOnlyEndField.getValue();
-  }
-
-  public static Address readWriteBottom() {
-    return readWriteBottomField.getValue();
-  }
-
-  public static Address readWriteEnd() {
-    return readWriteEndField.getValue();
-  }
-
-  public static boolean isShared(Address p) {
-    return sharedBottom().lessThanOrEqual(p) && sharedEnd().greaterThan(p);
-  }
-
-  public static boolean isSharedReadOnly(Address p) {
-    return readOnlyBottom().lessThanOrEqual(p) && readOnlyEnd().greaterThan(p);
-  }
-
-  public static boolean isSharedReadWrite(Address p) {
-    return readWriteBottom().lessThanOrEqual(p) && readWriteEnd().greaterThan(p);
-  }
-
-  public boolean isIn(Address p) {
-    return unsharedBottom().lessThanOrEqual(p) && sharedEnd().greaterThan(p);
-  }
-
-  public void spaceIterate(SpaceClosure blk, boolean usedOnly) {
-    super.spaceIterate(blk, usedOnly);
-    if (isSharingEnabled()) {
-      blk.doSpace(roSpace());
-      blk.doSpace(rwSpace());
-    }
-  }
-
-  public void printOn(PrintStream tty) {
-    tty.print("  perm");
-    theSpace().printOn(tty);
-    if (isSharingEnabled()) {
-      tty.print("  ro space: ");
-      roSpace().printOn(tty);
-      tty.print(", rw space: ");
-      rwSpace().printOn(tty);
-    }
-  }
-
-  private OffsetTableContigSpace newOffsetTableContigSpace(Address addr) {
-    return (OffsetTableContigSpace) VMObjectFactory.newObject(
-               OffsetTableContigSpace.class, addr);
-  }
-}
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/ContigPermSpace.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.memory;
-
-import sun.jvm.hotspot.debugger.*;
-
-/** No additional functionality for now */
-
-public class ContigPermSpace extends OffsetTableContigSpace {
-  public ContigPermSpace(Address addr) {
-    super(addr);
-  }
-}
--- 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 @@
     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 @@
     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;
 
 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 @@
   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 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 @@
       }
     }
 
-    return permGen().isIn(a);
+    return false;
   }
 
   public long capacity() {
@@ -140,7 +140,5 @@
       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 @@
         <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 @@
   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/PermGen.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.memory;
-
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-
-/** All heaps contains a "permanent generation," containing permanent
-    (reflective) objects.  This is like a regular generation in some
-    ways, but unlike one in others, and so is split apart. (FIXME:
-    this distinction is confusing and seems unnecessary.) */
-
-public abstract class PermGen extends VMObject {
-  // NEEDS_CLEANUP
-  public PermGen(Address addr) {
-    super(addr);
-  }
-
-  public abstract Generation asGen();
-}
--- 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;
 
 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 @@
 
   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.*;
 
 public abstract class SharedHeap extends CollectedHeap {
-  private static AddressField permGenField;
   private static VirtualConstructor ctor;
 
   static {
@@ -46,31 +45,14 @@
 
   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 @@
   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 @@
     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 @@
   // 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 @@
   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 @@
     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 @@
     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 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 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 @@
     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 @@
     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 @@
     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 @@
 
   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 @@
     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/ArrayKlassKlass.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.oops;
-
-import java.io.*;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-
-public class ArrayKlassKlass extends KlassKlass {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
-    Type type = db.lookupType("arrayKlassKlass");
-    headerSize = type.getSize() + Oop.getHeaderSize();
-  }
-
-  ArrayKlassKlass(OopHandle handle, ObjectHeap heap) {
-    super(handle, heap);
-  }
-
-  private static long headerSize;
-
-  public long getObjectSize() { return alignObjectSize(headerSize); }
-
-  public void printValueOn(PrintStream tty) {
-    tty.print("ArrayKlassKlass");
-  }
-}
--- 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;
 
 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 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;
 
 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 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 @@
   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;
 
 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 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 @@
 
   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.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 @@
   }
 
   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 @@
   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 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/CompiledICHolderKlass.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.oops;
-
-import java.io.*;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-
-public class CompiledICHolderKlass extends Klass {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
-    Type type  = db.lookupType("compiledICHolderKlass");
-    headerSize = type.getSize() + Oop.getHeaderSize();
-  }
-
-  CompiledICHolderKlass(OopHandle handle, ObjectHeap heap) {
-    super(handle, heap);
-  }
-
-  private static long headerSize;
-
-  public long getObjectSize() { return alignObjectSize(headerSize); }
-
-  public void printValueOn(PrintStream tty) {
-    tty.print("CompilerICHolderKlass");
-  }
-}
--- 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.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 @@
   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();
+    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 constMethodOop.
+    // 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 @@
     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 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 @@
 
   /** 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 @@
      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());
+    tty.print("ConstMethod " + getName().asString() + getSignature().asString() + "@" + getAddress());
   }
 
-  public void iterateFields(OopVisitor visitor, boolean doVMFields) {
-    super.iterateFields(visitor, doVMFields);
-    if (doVMFields) {
-      visitor.doOop(constants, true);
+  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 @@
       visitor.doCInt(genericSignatureIndex, true);
       visitor.doCInt(codeSize, true);
     }
-  }
 
   // Accessors
 
@@ -266,7 +263,7 @@
       // 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 @@
     }
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
 
   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 @@
     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 @@
 
   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 @@
 
   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/ConstMethodKlass.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.oops;
-
-import java.io.*;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-
-// The ConstMethodKlass is the klass of a ConstMethod
-
-public class ConstMethodKlass extends Klass {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
-    Type type  = db.lookupType("constMethodKlass");
-    headerSize = type.getSize() + Oop.getHeaderSize();
-  }
-
-  ConstMethodKlass(OopHandle handle, ObjectHeap heap) {
-    super(handle, heap);
-  }
-
-  private static long headerSize;
-
-  public long getObjectSize() { return alignObjectSize(headerSize); }
-
-  public void printValueOn(PrintStream tty) {
-    tty.print("ConstMethodKlass");
-  }
-}
--- 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 @@
 // 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 @@
       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 @@
   }
 
   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();
+    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();
   }
 
-  ConstantPool(OopHandle handle, ObjectHeap heap) {
-    super(handle, heap);
+  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 @@
   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 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)));
+    return new CPSlot(getAddressAtRaw(index));
   }
 
-  public Oop getObjAtRaw(long index){
-    return getHeap().newOop(getHandle().getOopHandleAt(indexOffset(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 @@
       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 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) {
@@ -215,6 +233,10 @@
     return implGetNameRefAt(which, false);
   }
 
+  public Symbol uncachedGetNameRefAt(int which) {
+    return implGetNameRefAt(which, true);
+  }
+
   private Symbol implGetNameRefAt(int which, boolean uncached) {
     int signatureIndex = getNameRefIndexAt(implNameAndTypeRefIndexAt(which, uncached));
     return getSymbolAt(signatureIndex);
@@ -224,35 +246,57 @@
     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 @@
   }
 
   // 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 @@
       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 @@
     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 @@
         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 @@
         }
       }
     }
-    /*
-    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 @@
 
 
       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 @@
 
               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,24 +617,13 @@
 
               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;
-              }
-
               // all external, internal method/field references
               case JVM_CONSTANT_Fieldref:
               case JVM_CONSTANT_Methodref:
@@ -618,12 +654,21 @@
               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 @@
                   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 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");
-    }
+    tty.print("ConstantPool for " + getPoolHolder().getName().asString());
   }
 
-  public long getObjectSize() {
-    return alignObjectSize(headerSize + (getLength() * getElementSize()));
+  public long getSize() {
+    return Oop.alignObjectSize(headerSize + getLength());
   }
 
   //----------------------------------------------------------------------
@@ -665,12 +705,12 @@
   //
 
   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.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 @@
   }
 
   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 @@
     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 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 @@
   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 @@
     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 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/ConstantPoolCacheKlass.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.oops;
-
-import java.io.*;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-
-// A ConstantPoolCacheKlass is the klass of a ConstantPoolCache
-
-public class ConstantPoolCacheKlass extends Klass {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
-    Type type  = db.lookupType("constantPoolCacheKlass");
-    headerSize = type.getSize() + Oop.getHeaderSize();
-  }
-
-  ConstantPoolCacheKlass(OopHandle handle, ObjectHeap heap) {
-    super(handle, heap);
-  }
-
-  public long getObjectSize() { return alignObjectSize(headerSize); }
-
-  public void printValueOn(PrintStream tty) {
-    tty.print("ConstantPoolCacheKlass");
-  }
-
-  private static long headerSize;
-}
-
-
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolKlass.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.oops;
-
-import java.io.*;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-
-// A ConstantPoolKlass is the klass of a ConstantPool
-
-public class ConstantPoolKlass extends Klass {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
-    Type type  = db.lookupType("constantPoolKlass");
-    headerSize = type.getSize() + Oop.getHeaderSize();
-  }
-
-  ConstantPoolKlass(OopHandle handle, ObjectHeap heap) {
-    super(handle, heap);
-  }
-
-  public long getObjectSize() { return alignObjectSize(headerSize); }
-
-  public void printValueOn(PrintStream tty) {
-    tty.print("ConstantPoolKlass");
-  }
-
-  private static long headerSize;
-}
-
--- 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 @@
   private boolean handlized;
 
   public DataLayout(MethodData d, int o) {
-    data = d.getHandle();
+    data = d.getAddress();
     offset = o;
   }
 
@@ -89,15 +89,6 @@
     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) {
     OopHandle handle;
     if (handlized) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultMetadataVisitor.java	Sat Sep 01 13:25:18 2012 -0400
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import sun.jvm.hotspot.debugger.Address;
+
+/** A DefaultMetadataVisitor implements basic no-op MetadataVisitor
+    functionality except that the setObj() and getObj() methods are
+    implemented properly. */
+abstract public class DefaultMetadataVisitor implements MetadataVisitor {
+  private Metadata obj;
+
+  public void prologue()                        {}
+
+  // Called after visiting an object
+  public void epilogue()                        {}
+
+  public void setObj(Metadata obj) {
+    this.obj = obj;
+  }
+
+  public Metadata getObj() {
+    return obj;
+  }
+
+  // Callback methods for each field type in an object
+  abstract 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)       {}
+  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/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 @@
   }
 
   // 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;
 
 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 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 @@
   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 @@
     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 sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.utilities.*;
 
 // Super class for all fields in an object
 public class Field {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/FieldVisitor.java	Sat Sep 01 13:25:18 2012 -0400
@@ -0,0 +1,44 @@
+/*
+ * 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+// An OopVisitor can be used to inspect all fields within an object.
+// Fields include vm fields, java fields, indexable fields.
+
+public interface FieldVisitor {
+  // 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);
+  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/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;
 
 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 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 @@
         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 @@
 
   // 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;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceClassLoaderKlass.java	Sat Sep 01 13:25:18 2012 -0400
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.memory.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+// An InstanceKlass is the VM level representation of a Java class.
+
+public class InstanceClassLoaderKlass extends InstanceKlass {
+  static {
+    VM.registerVMInitializedObserver(new Observer() {
+        public void update(Observable o, Object data) {
+          initialize(VM.getVM().getTypeDataBase());
+        }
+      });
+  }
+
+  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
+    // Just make sure it's there for now
+    Type type = db.lookupType("instanceClassLoaderKlass");
+  }
+
+  public InstanceClassLoaderKlass(Address addr) {
+    super(addr);
+  }
+}
--- 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 @@
 
 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 @@
   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 @@
   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 @@
     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();
+    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);
+  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 @@
     }
   }
 
-  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 @@
 
   // 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 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 @@
     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 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 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 @@
       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 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 @@
     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 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 @@
           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 @@
              // 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 @@
 
              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 @@
   }
 
   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 @@
          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 @@
             } 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 @@
     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 @@
     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 @@
       visitor.doCInt(vtableLen, true);
       visitor.doCInt(itableLen, true);
     }
-  }
 
   /*
    *  Visit the static fields of this InstanceKlass with the obj of
@@ -628,10 +612,10 @@
 
   /** 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 @@
         // 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 @@
       // 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,25 +770,17 @@
         // 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
     // actually allocate
@@ -841,12 +817,28 @@
     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 @@
     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 @@
         // 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 @@
     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/InstanceKlassKlass.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.oops;
-
-import java.io.*;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-
-// An InstanceKlassKlass is the klass of an InstanceKlass.
-// There only exist one instance Universe::instanceKlassKlassObj()
-
-public class InstanceKlassKlass extends KlassKlass {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
-    Type type  = db.lookupType("instanceKlassKlass");
-    headerSize = type.getSize() + Oop.getHeaderSize();
-  }
-
-  InstanceKlassKlass(OopHandle handle, ObjectHeap heap) {
-    super(handle, heap);
-  }
-
-  private static long headerSize;
-
-  public long getObjectSize() { return alignObjectSize(headerSize); }
-
-  public void printValueOn(PrintStream tty) {
-    tty.print("InstanceKlassKlass");
-  }
-}
--- 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 @@
     Type type = db.lookupType("instanceMirrorKlass");
   }
 
-  InstanceMirrorKlass(OopHandle handle, ObjectHeap heap) {
-    super(handle, heap);
+  public InstanceMirrorKlass(Address addr) {
+    super(addr);
   }
 
   public long getObjectSize(Oop o) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceRefKlass.java	Sat Sep 01 13:25:18 2012 -0400
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.memory.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+// An InstanceKlass is the VM level representation of a Java class.
+
+public class InstanceRefKlass extends InstanceKlass {
+  static {
+    VM.registerVMInitializedObserver(new Observer() {
+        public void update(Observable o, Object data) {
+          initialize(VM.getVM().getTypeDataBase());
+        }
+      });
+  }
+
+  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
+    // Just make sure it's there for now
+    Type type = db.lookupType("instanceRefKlass");
+  }
+
+  public InstanceRefKlass(Address addr) {
+    super(addr);
+  }
+}
--- 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;
 
 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 @@
     }
     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.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 @@
 
   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 @@
     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 @@
 
   // 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 @@
     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 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/KlassKlass.java	Fri Aug 31 16:39:35 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.oops;
-
-import java.io.*;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-
-// A KlassKlass serves as the fix point of the klass chain.
-// The klass of KlassKlass is itself.
-
-public class KlassKlass extends Klass {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
-    Type type  = db.lookupType("klassKlass");
-    headerSize = type.getSize() + Oop.getHeaderSize();
-  }
-
-  KlassKlass(OopHandle handle, ObjectHeap heap) {
-    super(handle, heap);
-  }
-
-  private static long headerSize;
-
-  public long getObjectSize() { return alignObjectSize(headerSize); }
-
-  public void printValueOn(PrintStream tty) {
-    tty.print("KlassKlass");
-  }
-}
--- 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 @@
   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;
 
 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 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
   }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java	Sat Sep 01 13:25:18 2012 -0400
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.utilities.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+
+abstract public class Metadata extends VMObject {
+  static {
+    VM.registerVMInitializedObserver(new Observer() {
+        public void update(Observable o, Object data) {
+          initialize(VM.getVM().getTypeDataBase());
+        }
+      });
+  }
+
+  public Metadata(Address addr) {
+    super(addr);
+  }
+
+  private static VirtualBaseConstructor<Metadata> metadataConstructor;
+
+  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
+    metadataConstructor = new VirtualBaseConstructor<Metadata>(db, db.lookupType("Metadata"), null, null);
+    // Define an explicit mapping since the C++ and Java type names don't match.
+    metadataConstructor.addMapping("Metadata", Metadata.class);
+    metadataConstructor.addMapping("Klass", Klass.class);
+    metadataConstructor.addMapping("InstanceKlass", InstanceKlass.class);
+    metadataConstructor.addMapping("instanceMirrorKlass", InstanceMirrorKlass.class);
+    metadataConstructor.addMapping("instanceRefKlass", InstanceRefKlass.class);
+    metadataConstructor.addMapping("instanceClassLoaderKlass", InstanceClassLoaderKlass.class);
+    metadataConstructor.addMapping("typeArrayKlass", TypeArrayKlass.class);
+    metadataConstructor.addMapping("objArrayKlass", ObjArrayKlass.class);
+    metadataConstructor.addMapping("Method", Method.class);
+    metadataConstructor.addMapping("MethodData", MethodData.class);
+    metadataConstructor.addMapping("ConstMethod", ConstMethod.class);
+    metadataConstructor.addMapping("ConstantPool", ConstantPool.class);
+    metadataConstructor.addMapping("ConstantPoolCache", ConstantPoolCache.class);
+  }
+
+  public static Metadata instantiateWrapperFor(Address addr) {
+    return metadataConstructor.instantiateWrapperFor(addr);
+  }
+
+  public void iterate(MetadataVisitor visitor) {
+    visitor.setObj(this);
+    visitor.prologue();
+    iterateFields(visitor);
+    visitor.epilogue();
+  }
+
+  void iterateFields(MetadataVisitor visitor) {
+  }
+
+  abstract public void printValueOn(PrintStream tty);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataField.java	Sat Sep 01 13:25:18 2012 -0400
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.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.
+public class MetadataField extends Field {
+
+  public MetadataField(sun.jvm.hotspot.types.AddressField vmField, long startOffset) {
+    super(new NamedFieldIdentifier(vmField.getName()), vmField.getOffset() + startOffset, true);
+  }
+
+  public Metadata getValue(Oop obj) {
+    return getValue(obj.getHandle());
+  }
+  public Metadata getValue(VMObject obj) {
+    return getValue(obj.getAddress());
+  }
+  public Metadata getValue(Address addr) {
+    return Metadata.instantiateWrapperFor(addr.getAddressAt(getOffset()));
+  }
+  public void setValue(Oop obj, long value) throws MutationException {
+    // Fix this: set* missing in Address
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataVisitor.java	Sat Sep 01 13:25:18 2012 -0400
@@ -0,0 +1,41 @@
+/*
+ * 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+// A MetadataVisitor can be used to inspect all fields within an object.
+// Fields include vm fields, java fields, indexable fields.
+
+public interface MetadataVisitor extends FieldVisitor {
+  // Called before visiting an object
+  public void prologue();
+
+  // Called after visiting an object
+  public void epilogue();
+
+  public void setObj(Metadata obj);
+
+  // Returns the object being visited
+  public Metadata getObj();
+};
--- 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 @@
 
 // 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 @@
   }
 
   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 @@
     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 @@
   */
 
   // 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 @@
 
   // 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 @@
     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());
+    tty.print("Method " + getName().asString() + getSignature().asString() + "@" + getAddress());
   }
 
-  public void iterateFields(OopVisitor visitor, boolean doVMFields) {
-    super.iterateFields(visitor, doVMFields);
-    if (doVMFields) {
-      visitor.doOop(constMethod, true);
+  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 @@
     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 @@
 
 // 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 @@
   }