1084 klass == ciSymbol::java_lang_Integer_IntegerCache()) { 1085 return true; 1086 } 1087 } 1088 return false; 1089 } 1090 1091 // Fetch the base value in the autobox array 1092 static bool fetch_autobox_base(Compile::AliasType* atp, int& cache_offset) { 1093 if (atp != NULL && atp->field() != NULL) { 1094 ciField* field = atp->field(); 1095 ciSymbol* klass = field->holder()->name(); 1096 if (field->name() == ciSymbol::cache_field_name() && 1097 field->holder()->uses_default_loader() && 1098 klass == ciSymbol::java_lang_Integer_IntegerCache()) { 1099 assert(field->is_constant(), "what?"); 1100 ciObjArray* array = field->constant_value().as_object()->as_obj_array(); 1101 // Fetch the box object at the base of the array and get its value 1102 ciInstance* box = array->obj_at(0)->as_instance(); 1103 ciInstanceKlass* ik = box->klass()->as_instance_klass(); 1104 if (ik->nof_nonstatic_fields() == 1) { 1105 // This should be true nonstatic_field_at requires calling 1106 // nof_nonstatic_fields so check it anyway 1107 ciConstant c = box->field_value(ik->nonstatic_field_at(0)); 1108 cache_offset = c.as_int(); 1109 } 1110 return true; 1111 } 1112 } 1113 return false; 1114 } 1115 1116 // Returns true if the AliasType refers to the value field of an 1117 // autobox object. Currently only handles Integer. 1118 static bool is_autobox_object(Compile::AliasType* atp) { 1119 if (atp != NULL && atp->field() != NULL) { 1120 ciField* field = atp->field(); 1121 ciSymbol* klass = field->holder()->name(); 1122 if (field->name() == ciSymbol::value_name() && 1123 field->holder()->uses_default_loader() && 1124 klass == ciSymbol::java_lang_Integer()) { 1125 return true; 1126 } 1127 } | 1084 klass == ciSymbol::java_lang_Integer_IntegerCache()) { 1085 return true; 1086 } 1087 } 1088 return false; 1089 } 1090 1091 // Fetch the base value in the autobox array 1092 static bool fetch_autobox_base(Compile::AliasType* atp, int& cache_offset) { 1093 if (atp != NULL && atp->field() != NULL) { 1094 ciField* field = atp->field(); 1095 ciSymbol* klass = field->holder()->name(); 1096 if (field->name() == ciSymbol::cache_field_name() && 1097 field->holder()->uses_default_loader() && 1098 klass == ciSymbol::java_lang_Integer_IntegerCache()) { 1099 assert(field->is_constant(), "what?"); 1100 ciObjArray* array = field->constant_value().as_object()->as_obj_array(); 1101 // Fetch the box object at the base of the array and get its value 1102 ciInstance* box = array->obj_at(0)->as_instance(); 1103 ciInstanceKlass* ik = box->klass()->as_instance_klass(); 1104 if (ik->nonstatic_fields()->length() == 1) { 1105 // This should be true nonstatic_field_at requires calling 1106 // nof_nonstatic_fields so check it anyway 1107 ciConstant c = box->field_value(ik->nonstatic_fields()->at(0)); 1108 cache_offset = c.as_int(); 1109 } 1110 return true; 1111 } 1112 } 1113 return false; 1114 } 1115 1116 // Returns true if the AliasType refers to the value field of an 1117 // autobox object. Currently only handles Integer. 1118 static bool is_autobox_object(Compile::AliasType* atp) { 1119 if (atp != NULL && atp->field() != NULL) { 1120 ciField* field = atp->field(); 1121 ciSymbol* klass = field->holder()->name(); 1122 if (field->name() == ciSymbol::value_name() && 1123 field->holder()->uses_default_loader() && 1124 klass == ciSymbol::java_lang_Integer()) { 1125 return true; 1126 } 1127 } |