Mercurial > hg > graal-compiler
comparison agent/src/share/classes/sun/jvm/hotspot/utilities/IntArray.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 | |
children |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1 package sun.jvm.hotspot.utilities; | |
2 | |
3 import java.util.Observable; | |
4 import java.util.Observer; | |
5 | |
6 import sun.jvm.hotspot.debugger.Address; | |
7 import sun.jvm.hotspot.runtime.VM; | |
8 import sun.jvm.hotspot.types.Type; | |
9 import sun.jvm.hotspot.types.TypeDataBase; | |
10 import sun.jvm.hotspot.types.WrongTypeException; | |
11 | |
12 public class IntArray extends GenericArray { | |
13 static { | |
14 VM.registerVMInitializedObserver(new Observer() { | |
15 public void update(Observable o, Object data) { | |
16 initialize(VM.getVM().getTypeDataBase()); | |
17 } | |
18 }); | |
19 } | |
20 | |
21 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { | |
22 elemType = db.lookupType("int"); | |
23 | |
24 Type type = db.lookupType("Array<int>"); | |
25 dataFieldOffset = type.getAddressField("_data").getOffset(); | |
26 } | |
27 | |
28 private static long dataFieldOffset; | |
29 protected static Type elemType; | |
30 | |
31 public IntArray(Address addr) { | |
32 super(addr, dataFieldOffset); | |
33 } | |
34 | |
35 public int at(int i) { | |
36 return (int)getIntegerAt(i); | |
37 } | |
38 | |
39 public Type getElemType() { | |
40 return elemType; | |
41 } | |
42 } |