< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java

Print this page

 46   public Metadata(Address addr) {
 47     super(addr);
 48   }
 49 
 50   public static long alignSize(long size) {
 51     // natural word size.
 52     return VM.getVM().alignUp(size, VM.getVM().getBytesPerWord());
 53   }
 54 
 55   private static VirtualBaseConstructor<Metadata> metadataConstructor;
 56 
 57   private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
 58     metadataConstructor = new VirtualBaseConstructor<>(db, db.lookupType("Metadata"), null, null);
 59     // Define an explicit mapping since the C++ and Java type names don't match.
 60     metadataConstructor.addMapping("Metadata", Metadata.class);
 61     metadataConstructor.addMapping("Klass", Klass.class);
 62     metadataConstructor.addMapping("InstanceKlass", InstanceKlass.class);
 63     metadataConstructor.addMapping("InstanceMirrorKlass", InstanceMirrorKlass.class);
 64     metadataConstructor.addMapping("InstanceRefKlass", InstanceRefKlass.class);
 65     metadataConstructor.addMapping("InstanceClassLoaderKlass", InstanceClassLoaderKlass.class);

 66     metadataConstructor.addMapping("TypeArrayKlass", TypeArrayKlass.class);
 67     metadataConstructor.addMapping("ObjArrayKlass", ObjArrayKlass.class);
 68     metadataConstructor.addMapping("Method", Method.class);
 69     metadataConstructor.addMapping("MethodData", MethodData.class);
 70     metadataConstructor.addMapping("ConstMethod", ConstMethod.class);
 71     metadataConstructor.addMapping("ConstantPool", ConstantPool.class);
 72     metadataConstructor.addMapping("ConstantPoolCache", ConstantPoolCache.class);
 73   }
 74 
 75   public static Metadata instantiateWrapperFor(Address addr) {
 76     return metadataConstructor.instantiateWrapperFor(addr);
 77   }
 78 
 79   public void iterate(MetadataVisitor visitor) {
 80     visitor.setObj(this);
 81     visitor.prologue();
 82     iterateFields(visitor);
 83     visitor.epilogue();
 84   }
 85 

 46   public Metadata(Address addr) {
 47     super(addr);
 48   }
 49 
 50   public static long alignSize(long size) {
 51     // natural word size.
 52     return VM.getVM().alignUp(size, VM.getVM().getBytesPerWord());
 53   }
 54 
 55   private static VirtualBaseConstructor<Metadata> metadataConstructor;
 56 
 57   private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
 58     metadataConstructor = new VirtualBaseConstructor<>(db, db.lookupType("Metadata"), null, null);
 59     // Define an explicit mapping since the C++ and Java type names don't match.
 60     metadataConstructor.addMapping("Metadata", Metadata.class);
 61     metadataConstructor.addMapping("Klass", Klass.class);
 62     metadataConstructor.addMapping("InstanceKlass", InstanceKlass.class);
 63     metadataConstructor.addMapping("InstanceMirrorKlass", InstanceMirrorKlass.class);
 64     metadataConstructor.addMapping("InstanceRefKlass", InstanceRefKlass.class);
 65     metadataConstructor.addMapping("InstanceClassLoaderKlass", InstanceClassLoaderKlass.class);
 66     metadataConstructor.addMapping("InstanceStackChunkKlass", InstanceStackChunkKlass.class);
 67     metadataConstructor.addMapping("TypeArrayKlass", TypeArrayKlass.class);
 68     metadataConstructor.addMapping("ObjArrayKlass", ObjArrayKlass.class);
 69     metadataConstructor.addMapping("Method", Method.class);
 70     metadataConstructor.addMapping("MethodData", MethodData.class);
 71     metadataConstructor.addMapping("ConstMethod", ConstMethod.class);
 72     metadataConstructor.addMapping("ConstantPool", ConstantPool.class);
 73     metadataConstructor.addMapping("ConstantPoolCache", ConstantPoolCache.class);
 74   }
 75 
 76   public static Metadata instantiateWrapperFor(Address addr) {
 77     return metadataConstructor.instantiateWrapperFor(addr);
 78   }
 79 
 80   public void iterate(MetadataVisitor visitor) {
 81     visitor.setObj(this);
 82     visitor.prologue();
 83     iterateFields(visitor);
 84     visitor.epilogue();
 85   }
 86 
< prev index next >