Mercurial > hg > graal-compiler
comparison src/share/vm/c1/c1_Instruction.cpp @ 3243:208b6c560ff4
Merge
author | vladidan |
---|---|
date | Thu, 14 Apr 2011 11:02:05 -0400 |
parents | 6c9cec219ce4 13bc79b5c9c8 |
children | a32de5085326 |
comparison
equal
deleted
inserted
replaced
3242:c737922fd8bb | 3243:208b6c560ff4 |
---|---|
133 } | 133 } |
134 return true; | 134 return true; |
135 } | 135 } |
136 | 136 |
137 | 137 |
138 ciType* Local::exact_type() const { | |
139 ciType* type = declared_type(); | |
140 | |
141 // for primitive arrays, the declared type is the exact type | |
142 if (type->is_type_array_klass()) { | |
143 return type; | |
144 } else if (type->is_instance_klass()) { | |
145 ciInstanceKlass* ik = (ciInstanceKlass*)type; | |
146 if (ik->is_loaded() && ik->is_final() && !ik->is_interface()) { | |
147 return type; | |
148 } | |
149 } else if (type->is_obj_array_klass()) { | |
150 ciObjArrayKlass* oak = (ciObjArrayKlass*)type; | |
151 ciType* base = oak->base_element_type(); | |
152 if (base->is_instance_klass()) { | |
153 ciInstanceKlass* ik = base->as_instance_klass(); | |
154 if (ik->is_loaded() && ik->is_final()) { | |
155 return type; | |
156 } | |
157 } else if (base->is_primitive_type()) { | |
158 return type; | |
159 } | |
160 } | |
161 return NULL; | |
162 } | |
163 | |
164 | |
138 ciType* LoadIndexed::exact_type() const { | 165 ciType* LoadIndexed::exact_type() const { |
139 ciType* array_type = array()->exact_type(); | 166 ciType* array_type = array()->exact_type(); |
140 if (array_type == NULL) { | 167 if (array_type == NULL) { |
141 return NULL; | 168 return NULL; |
142 } | 169 } |
187 | 214 |
188 ciType* NewTypeArray::exact_type() const { | 215 ciType* NewTypeArray::exact_type() const { |
189 return ciTypeArrayKlass::make(elt_type()); | 216 return ciTypeArrayKlass::make(elt_type()); |
190 } | 217 } |
191 | 218 |
192 | |
193 ciType* NewObjectArray::exact_type() const { | 219 ciType* NewObjectArray::exact_type() const { |
194 return ciObjArrayKlass::make(klass()); | 220 return ciObjArrayKlass::make(klass()); |
195 } | 221 } |
196 | 222 |
223 ciType* NewArray::declared_type() const { | |
224 return exact_type(); | |
225 } | |
197 | 226 |
198 ciType* NewInstance::exact_type() const { | 227 ciType* NewInstance::exact_type() const { |
199 return klass(); | 228 return klass(); |
200 } | 229 } |
201 | 230 |
231 ciType* NewInstance::declared_type() const { | |
232 return exact_type(); | |
233 } | |
202 | 234 |
203 ciType* CheckCast::declared_type() const { | 235 ciType* CheckCast::declared_type() const { |
204 return klass(); | 236 return klass(); |
205 } | 237 } |
206 | 238 |
347 StateSplit::state_values_do(f); | 379 StateSplit::state_values_do(f); |
348 if (state_before() != NULL) state_before()->values_do(f); | 380 if (state_before() != NULL) state_before()->values_do(f); |
349 if (state() != NULL) state()->values_do(f); | 381 if (state() != NULL) state()->values_do(f); |
350 } | 382 } |
351 | 383 |
384 ciType* Invoke::declared_type() const { | |
385 ciType *t = _target->signature()->return_type(); | |
386 assert(t->basic_type() != T_VOID, "need return value of void method?"); | |
387 return t; | |
388 } | |
352 | 389 |
353 // Implementation of Contant | 390 // Implementation of Contant |
354 intx Constant::hash() const { | 391 intx Constant::hash() const { |
355 if (state_before() == NULL) { | 392 if (state_before() == NULL) { |
356 switch (type()->tag()) { | 393 switch (type()->tag()) { |