comparison agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java @ 6725: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 c18cbe5936b8
children d8ce2825b193
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
43 }); 43 });
44 } 44 }
45 45
46 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { 46 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
47 Type type = db.lookupType("arrayKlass"); 47 Type type = db.lookupType("arrayKlass");
48 dimension = new CIntField(type.getCIntegerField("_dimension"), Oop.getHeaderSize()); 48 dimension = new CIntField(type.getCIntegerField("_dimension"), 0);
49 higherDimension = new OopField(type.getOopField("_higher_dimension"), Oop.getHeaderSize()); 49 higherDimension = new MetadataField(type.getAddressField("_higher_dimension"), 0);
50 lowerDimension = new OopField(type.getOopField("_lower_dimension"), Oop.getHeaderSize()); 50 lowerDimension = new MetadataField(type.getAddressField("_lower_dimension"), 0);
51 vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), Oop.getHeaderSize()); 51 vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0);
52 allocSize = new CIntField(type.getCIntegerField("_alloc_size"), Oop.getHeaderSize()); 52 allocSize = new CIntField(type.getCIntegerField("_alloc_size"), 0);
53 componentMirror = new OopField(type.getOopField("_component_mirror"), Oop.getHeaderSize()); 53 componentMirror = new OopField(type.getOopField("_component_mirror"), 0);
54 javaLangCloneableName = null; 54 javaLangCloneableName = null;
55 javaLangObjectName = null; 55 javaLangObjectName = null;
56 javaIoSerializableName = null; 56 javaIoSerializableName = null;
57 } 57 }
58 58
59 ArrayKlass(OopHandle handle, ObjectHeap heap) { 59 public ArrayKlass(Address addr) {
60 super(handle, heap); 60 super(addr);
61 } 61 }
62 62
63 private static CIntField dimension; 63 private static CIntField dimension;
64 private static OopField higherDimension; 64 private static MetadataField higherDimension;
65 private static OopField lowerDimension; 65 private static MetadataField lowerDimension;
66 private static CIntField vtableLen; 66 private static CIntField vtableLen;
67 private static CIntField allocSize; 67 private static CIntField allocSize;
68 private static OopField componentMirror; 68 private static OopField componentMirror;
69 69
70 public Klass getJavaSuper() { 70 public Klass getJavaSuper() {
139 139
140 public void printValueOn(PrintStream tty) { 140 public void printValueOn(PrintStream tty) {
141 tty.print("ArrayKlass"); 141 tty.print("ArrayKlass");
142 } 142 }
143 143
144 public long getObjectSize() { 144 public void iterateFields(MetadataVisitor visitor) {
145 return alignObjectSize(InstanceKlass.getHeaderSize() + getVtableLen() * getHeap().getOopSize()); 145 super.iterateFields(visitor);
146 }
147
148 public void iterateFields(OopVisitor visitor, boolean doVMFields) {
149 super.iterateFields(visitor, doVMFields);
150 if (doVMFields) {
151 visitor.doCInt(dimension, true); 146 visitor.doCInt(dimension, true);
152 visitor.doOop(higherDimension, true); 147 visitor.doMetadata(higherDimension, true);
153 visitor.doOop(lowerDimension, true); 148 visitor.doMetadata(lowerDimension, true);
154 visitor.doCInt(vtableLen, true); 149 visitor.doCInt(vtableLen, true);
155 visitor.doCInt(allocSize, true); 150 visitor.doCInt(allocSize, true);
156 visitor.doOop(componentMirror, true); 151 visitor.doOop(componentMirror, true);
157 } 152 }
158 } 153 }
159 }