Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java @ 642:660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
Summary: Use zero based compressed oops if java heap is below 32gb and unscaled compressed oops if java heap is below 4gb.
Reviewed-by: never, twisti, jcoomes, coleenp
author | kvn |
---|---|
date | Thu, 12 Mar 2009 10:37:46 -0700 |
parents | d1605aabd0a1 |
children | bd02caa94611 |
comparison
equal
deleted
inserted
replaced
641:6af0a709d52b | 642:660978a2a31a |
---|---|
51 private static sun.jvm.hotspot.types.OopField doubleArrayKlassObjField; | 51 private static sun.jvm.hotspot.types.OopField doubleArrayKlassObjField; |
52 | 52 |
53 // system obj array klass object | 53 // system obj array klass object |
54 private static sun.jvm.hotspot.types.OopField systemObjArrayKlassObjField; | 54 private static sun.jvm.hotspot.types.OopField systemObjArrayKlassObjField; |
55 | 55 |
56 private static AddressField heapBaseField; | 56 private static AddressField narrowOopBaseField; |
57 private static CIntegerField narrowOopShiftField; | |
57 | 58 |
58 static { | 59 static { |
59 VM.registerVMInitializedObserver(new Observer() { | 60 VM.registerVMInitializedObserver(new Observer() { |
60 public void update(Observable o, Object data) { | 61 public void update(Observable o, Object data) { |
61 initialize(VM.getVM().getTypeDataBase()); | 62 initialize(VM.getVM().getTypeDataBase()); |
84 singleArrayKlassObjField = type.getOopField("_singleArrayKlassObj"); | 85 singleArrayKlassObjField = type.getOopField("_singleArrayKlassObj"); |
85 doubleArrayKlassObjField = type.getOopField("_doubleArrayKlassObj"); | 86 doubleArrayKlassObjField = type.getOopField("_doubleArrayKlassObj"); |
86 | 87 |
87 systemObjArrayKlassObjField = type.getOopField("_systemObjArrayKlassObj"); | 88 systemObjArrayKlassObjField = type.getOopField("_systemObjArrayKlassObj"); |
88 | 89 |
89 heapBaseField = type.getAddressField("_heap_base"); | 90 narrowOopBaseField = type.getAddressField("_narrow_oop._base"); |
91 narrowOopShiftField = type.getCIntegerField("_narrow_oop._shift"); | |
90 } | 92 } |
91 | 93 |
92 public Universe() { | 94 public Universe() { |
93 } | 95 } |
94 | 96 |
98 } catch (WrongTypeException e) { | 100 } catch (WrongTypeException e) { |
99 return new CollectedHeap(collectedHeapField.getValue()); | 101 return new CollectedHeap(collectedHeapField.getValue()); |
100 } | 102 } |
101 } | 103 } |
102 | 104 |
103 public static long getHeapBase() { | 105 public static long getNarrowOopBase() { |
104 if (heapBaseField.getValue() == null) { | 106 if (narrowOopBaseField.getValue() == null) { |
105 return 0; | 107 return 0; |
106 } else { | 108 } else { |
107 return heapBaseField.getValue().minus(null); | 109 return narrowOopBaseField.getValue().minus(null); |
108 } | 110 } |
111 } | |
112 | |
113 public static int getNarrowOopShift() { | |
114 return (int)narrowOopShiftField.getValue(); | |
109 } | 115 } |
110 | 116 |
111 /** Returns "TRUE" iff "p" points into the allocated area of the heap. */ | 117 /** Returns "TRUE" iff "p" points into the allocated area of the heap. */ |
112 public boolean isIn(Address p) { | 118 public boolean isIn(Address p) { |
113 return heap().isIn(p); | 119 return heap().isIn(p); |