Mercurial > hg > graal-jvmci-8
comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotType.java @ 1422:3483ec571caf
* using reflected objects instead of oops
* removed scratch from allocatable registers
* instanceof xir snippet
* arraylength xir snippet
* exceptionobject xir snippet
* VMEntries and VMExits as interfaces
* calls to VMEntries and VMExits are routet through logging proxies
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Mon, 02 Aug 2010 15:44:38 -0700 |
parents | 6223633ce7dd |
children | 760213a60e8b |
comparison
equal
deleted
inserted
replaced
1421:6223633ce7dd | 1422:3483ec571caf |
---|---|
4 import com.sun.cri.ci.CiKind; | 4 import com.sun.cri.ci.CiKind; |
5 import com.sun.cri.ri.*; | 5 import com.sun.cri.ri.*; |
6 | 6 |
7 public class HotSpotType implements RiType { | 7 public class HotSpotType implements RiType { |
8 | 8 |
9 final Object klassOop; | 9 // do not query this class object directly, use the VMEntries methods instead! |
10 // (otherwise this query won't be recorded correctly) | |
11 final Class<?> klass; | |
10 | 12 |
11 public HotSpotType(Object o) { | 13 public HotSpotType(Class<?> klass) { |
12 this.klassOop = o; | 14 this.klass = klass; |
13 assert klassOop != null; | 15 assert klass != null; |
14 } | 16 } |
15 | 17 |
16 @Override | 18 @Override |
17 public int accessFlags() { | 19 public int accessFlags() { |
18 // TODO Auto-generated method stub | 20 // TODO Auto-generated method stub |
67 } | 69 } |
68 | 70 |
69 @Override | 71 @Override |
70 public boolean isArrayClass() { | 72 public boolean isArrayClass() { |
71 System.out.println("Checking for array class " + name()); | 73 System.out.println("Checking for array class " + name()); |
72 return Compiler.getVMEntries().RiType_isArrayClass(klassOop); | 74 return Compiler.getVMEntries().RiType_isArrayClass(klass); |
73 } | 75 } |
74 | 76 |
75 @Override | 77 @Override |
76 public boolean isInitialized() { | 78 public boolean isInitialized() { |
77 // TODO Auto-generated method stub | 79 // TODO Auto-generated method stub |
84 return false; | 86 return false; |
85 } | 87 } |
86 | 88 |
87 @Override | 89 @Override |
88 public boolean isInstanceClass() { | 90 public boolean isInstanceClass() { |
89 return Compiler.getVMEntries().RiType_isInstanceClass(klassOop); | 91 return Compiler.getVMEntries().RiType_isInstanceClass(klass); |
90 } | 92 } |
91 | 93 |
92 @Override | 94 @Override |
93 public boolean isInterface() { | 95 public boolean isInterface() { |
94 return Compiler.getVMEntries().RiType_isInterface(klassOop); | 96 return Compiler.getVMEntries().RiType_isInterface(klass); |
95 } | 97 } |
96 | 98 |
97 @Override | 99 @Override |
98 public boolean isResolved() { | 100 public boolean isResolved() { |
99 return true; | 101 return true; |
104 // TODO Auto-generated method stub | 106 // TODO Auto-generated method stub |
105 return false; | 107 return false; |
106 } | 108 } |
107 | 109 |
108 @Override | 110 @Override |
109 public Class< ? > javaClass() { | 111 public Class<?> javaClass() { |
110 return Compiler.getVMEntries().RiType_javaClass(klassOop); | 112 return klass; |
111 } | 113 } |
112 | 114 |
113 @Override | 115 @Override |
114 public CiKind kind() { | 116 public CiKind kind() { |
115 return CiKind.Object; | 117 return CiKind.Object; |
116 } | 118 } |
117 | 119 |
118 @Override | 120 @Override |
119 public String name() { | 121 public String name() { |
120 return Compiler.getVMEntries().RiType_name(klassOop); | 122 return Compiler.getVMEntries().RiType_name(klass); |
121 } | 123 } |
122 | 124 |
123 @Override | 125 @Override |
124 public RiMethod resolveMethodImpl(RiMethod method) { | 126 public RiMethod resolveMethodImpl(RiMethod method) { |
125 // TODO Auto-generated method stub | 127 // TODO Auto-generated method stub |
126 return null; | 128 return null; |
127 } | 129 } |
128 | 130 |
129 public Object klassOop() { | 131 public Class<?> klass() { |
130 return klassOop; | 132 return klass; |
131 } | 133 } |
132 | 134 |
133 } | 135 } |