comparison agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java @ 2376:c7f3d0b4570f

7017732: move static fields into Class to prepare for perm gen removal Reviewed-by: kvn, coleenp, twisti, stefank
author never
date Fri, 18 Mar 2011 16:00:34 -0700
parents 3582bf76420e
children 63997f575155
comparison
equal deleted inserted replaced
2375:d673ef06fe96 2376:c7f3d0b4570f
1 /* 1 /*
2 * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2000, 2011, 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.
85 sourceFileName = type.getAddressField("_source_file_name"); 85 sourceFileName = type.getAddressField("_source_file_name");
86 sourceDebugExtension = type.getAddressField("_source_debug_extension"); 86 sourceDebugExtension = type.getAddressField("_source_debug_extension");
87 innerClasses = new OopField(type.getOopField("_inner_classes"), Oop.getHeaderSize()); 87 innerClasses = new OopField(type.getOopField("_inner_classes"), Oop.getHeaderSize());
88 nonstaticFieldSize = new CIntField(type.getCIntegerField("_nonstatic_field_size"), Oop.getHeaderSize()); 88 nonstaticFieldSize = new CIntField(type.getCIntegerField("_nonstatic_field_size"), Oop.getHeaderSize());
89 staticFieldSize = new CIntField(type.getCIntegerField("_static_field_size"), Oop.getHeaderSize()); 89 staticFieldSize = new CIntField(type.getCIntegerField("_static_field_size"), Oop.getHeaderSize());
90 staticOopFieldSize = new CIntField(type.getCIntegerField("_static_oop_field_size"), Oop.getHeaderSize()); 90 staticOopFieldCount = new CIntField(type.getCIntegerField("_static_oop_field_count"), Oop.getHeaderSize());
91 nonstaticOopMapSize = new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), Oop.getHeaderSize()); 91 nonstaticOopMapSize = new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), Oop.getHeaderSize());
92 isMarkedDependent = new CIntField(type.getCIntegerField("_is_marked_dependent"), Oop.getHeaderSize()); 92 isMarkedDependent = new CIntField(type.getCIntegerField("_is_marked_dependent"), Oop.getHeaderSize());
93 initState = new CIntField(type.getCIntegerField("_init_state"), Oop.getHeaderSize()); 93 initState = new CIntField(type.getCIntegerField("_init_state"), Oop.getHeaderSize());
94 vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), Oop.getHeaderSize()); 94 vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), Oop.getHeaderSize());
95 itableLen = new CIntField(type.getCIntegerField("_itable_len"), Oop.getHeaderSize()); 95 itableLen = new CIntField(type.getCIntegerField("_itable_len"), Oop.getHeaderSize());
138 private static AddressField sourceFileName; 138 private static AddressField sourceFileName;
139 private static AddressField sourceDebugExtension; 139 private static AddressField sourceDebugExtension;
140 private static OopField innerClasses; 140 private static OopField innerClasses;
141 private static CIntField nonstaticFieldSize; 141 private static CIntField nonstaticFieldSize;
142 private static CIntField staticFieldSize; 142 private static CIntField staticFieldSize;
143 private static CIntField staticOopFieldSize; 143 private static CIntField staticOopFieldCount;
144 private static CIntField nonstaticOopMapSize; 144 private static CIntField nonstaticOopMapSize;
145 private static CIntField isMarkedDependent; 145 private static CIntField isMarkedDependent;
146 private static CIntField initState; 146 private static CIntField initState;
147 private static CIntField vtableLen; 147 private static CIntField vtableLen;
148 private static CIntField itableLen; 148 private static CIntField itableLen;
259 public ObjArray getSigners() { return (ObjArray) signers.getValue(this); } 259 public ObjArray getSigners() { return (ObjArray) signers.getValue(this); }
260 public Symbol getSourceFileName() { return getSymbol(sourceFileName); } 260 public Symbol getSourceFileName() { return getSymbol(sourceFileName); }
261 public Symbol getSourceDebugExtension(){ return getSymbol(sourceDebugExtension); } 261 public Symbol getSourceDebugExtension(){ return getSymbol(sourceDebugExtension); }
262 public TypeArray getInnerClasses() { return (TypeArray) innerClasses.getValue(this); } 262 public TypeArray getInnerClasses() { return (TypeArray) innerClasses.getValue(this); }
263 public long getNonstaticFieldSize() { return nonstaticFieldSize.getValue(this); } 263 public long getNonstaticFieldSize() { return nonstaticFieldSize.getValue(this); }
264 public long getStaticFieldSize() { return staticFieldSize.getValue(this); } 264 public long getStaticOopFieldCount() { return staticOopFieldCount.getValue(this); }
265 public long getStaticOopFieldSize() { return staticOopFieldSize.getValue(this); }
266 public long getNonstaticOopMapSize() { return nonstaticOopMapSize.getValue(this); } 265 public long getNonstaticOopMapSize() { return nonstaticOopMapSize.getValue(this); }
267 public boolean getIsMarkedDependent() { return isMarkedDependent.getValue(this) != 0; } 266 public boolean getIsMarkedDependent() { return isMarkedDependent.getValue(this) != 0; }
268 public long getVtableLen() { return vtableLen.getValue(this); } 267 public long getVtableLen() { return vtableLen.getValue(this); }
269 public long getItableLen() { return itableLen.getValue(this); } 268 public long getItableLen() { return itableLen.getValue(this); }
270 public Symbol getGenericSignature() { return getSymbol(genericSignature); } 269 public Symbol getGenericSignature() { return getSymbol(genericSignature); }
451 visitor.doOop(protectionDomain, true); 450 visitor.doOop(protectionDomain, true);
452 visitor.doOop(signers, true); 451 visitor.doOop(signers, true);
453 visitor.doOop(innerClasses, true); 452 visitor.doOop(innerClasses, true);
454 visitor.doCInt(nonstaticFieldSize, true); 453 visitor.doCInt(nonstaticFieldSize, true);
455 visitor.doCInt(staticFieldSize, true); 454 visitor.doCInt(staticFieldSize, true);
456 visitor.doCInt(staticOopFieldSize, true); 455 visitor.doCInt(staticOopFieldCount, true);
457 visitor.doCInt(nonstaticOopMapSize, true); 456 visitor.doCInt(nonstaticOopMapSize, true);
458 visitor.doCInt(isMarkedDependent, true); 457 visitor.doCInt(isMarkedDependent, true);
459 visitor.doCInt(initState, true); 458 visitor.doCInt(initState, true);
460 visitor.doCInt(vtableLen, true); 459 visitor.doCInt(vtableLen, true);
461 visitor.doCInt(itableLen, true); 460 visitor.doCInt(itableLen, true);
690 689
691 690
692 public long getObjectSize() { 691 public long getObjectSize() {
693 long bodySize = alignObjectOffset(getVtableLen() * getHeap().getOopSize()) 692 long bodySize = alignObjectOffset(getVtableLen() * getHeap().getOopSize())
694 + alignObjectOffset(getItableLen() * getHeap().getOopSize()) 693 + alignObjectOffset(getItableLen() * getHeap().getOopSize())
695 + (getStaticFieldSize() + getNonstaticOopMapSize()) * getHeap().getOopSize(); 694 + (getNonstaticOopMapSize()) * getHeap().getOopSize();
696 return alignObjectSize(headerSize + bodySize); 695 return alignObjectSize(headerSize + bodySize);
697 } 696 }
698 697
699 public Klass arrayKlassImpl(boolean orNull, int n) { 698 public Klass arrayKlassImpl(boolean orNull, int n) {
700 // FIXME: in reflective system this would need to change to 699 // FIXME: in reflective system this would need to change to