src/share/vm/c1/c1_Instruction.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/c1/c1_Instruction.cpp Tue Oct 8 14:00:21 2013
--- new/src/share/vm/c1/c1_Instruction.cpp Tue Oct 8 14:00:21 2013
*** 102,111 ****
--- 102,119 ----
if (exception_state() != NULL){
exception_state()->values_do(f);
}
}
+ ciType* Instruction::exact_type() const {
+ ciType* t = declared_type();
+ if (t != NULL && t->is_klass()) {
+ return t->as_klass()->exact_klass();
+ }
+ return NULL;
+ }
+
#ifndef PRODUCT
void Instruction::check_state(ValueStack* state) {
if (state != NULL) {
state->verify();
*** 133,145 ****
--- 141,151 ----
#endif // PRODUCT
// perform constant and interval tests on index value
bool AccessIndexed::compute_needs_range_check() {
if (length()) {
Constant* clength = length()->as_Constant();
Constant* cindex = index()->as_Constant();
if (clength && cindex) {
IntConstant* l = clength->type()->as_IntConstant();
IntConstant* i = cindex->type()->as_IntConstant();
*** 155,212 ****
--- 161,191 ----
return true;
}
ciType* Local::exact_type() const {
ciType* type = declared_type();
// for primitive arrays, the declared type is the exact type
if (type->is_type_array_klass()) {
return type;
} else if (type->is_instance_klass()) {
ciInstanceKlass* ik = (ciInstanceKlass*)type;
if (ik->is_loaded() && ik->is_final() && !ik->is_interface()) {
return type;
}
} else if (type->is_obj_array_klass()) {
ciObjArrayKlass* oak = (ciObjArrayKlass*)type;
ciType* base = oak->base_element_type();
if (base->is_instance_klass()) {
ciInstanceKlass* ik = base->as_instance_klass();
if (ik->is_loaded() && ik->is_final()) {
return type;
}
} else if (base->is_primitive_type()) {
return type;
}
}
return NULL;
}
ciType* Constant::exact_type() const {
! if (type()->is_object() && type()->as_ObjectType()->is_loaded()) {
return type()->as_ObjectType()->exact_type();
}
return NULL;
}
ciType* LoadIndexed::exact_type() const {
ciType* array_type = array()->exact_type();
! if (array_type == NULL) {
return NULL;
}
! if (array_type != NULL) {
assert(array_type->is_array_klass(), "what else?");
ciArrayKlass* ak = (ciArrayKlass*)array_type;
if (ak->element_type()->is_instance_klass()) {
ciInstanceKlass* ik = (ciInstanceKlass*)ak->element_type();
if (ik->is_loaded() && ik->is_final()) {
return ik;
}
}
return NULL;
+ }
+ return Instruction::exact_type();
}
ciType* LoadIndexed::declared_type() const {
ciType* array_type = array()->declared_type();
*** 222,247 ****
--- 201,210 ----
ciType* LoadField::declared_type() const {
return field()->type();
}
ciType* LoadField::exact_type() const {
ciType* type = declared_type();
// for primitive arrays, the declared type is the exact type
if (type->is_type_array_klass()) {
return type;
}
if (type->is_instance_klass()) {
ciInstanceKlass* ik = (ciInstanceKlass*)type;
if (ik->is_loaded() && ik->is_final()) {
return type;
}
}
return NULL;
}
ciType* NewTypeArray::exact_type() const {
return ciTypeArrayKlass::make(elt_type());
}
ciType* NewObjectArray::exact_type() const {
*** 262,281 ****
--- 225,234 ----
ciType* CheckCast::declared_type() const {
return klass();
}
ciType* CheckCast::exact_type() const {
if (klass()->is_instance_klass()) {
ciInstanceKlass* ik = (ciInstanceKlass*)klass();
if (ik->is_loaded() && ik->is_final()) {
return ik;
}
}
return NULL;
}
// Implementation of ArithmeticOp
bool ArithmeticOp::is_commutative() const {
switch (op()) {
case Bytecodes::_iadd: // fall through
src/share/vm/c1/c1_Instruction.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File