< prev index next >

src/hotspot/share/c1/c1_GraphBuilder.cpp

Print this page

*** 980,1018 **** void GraphBuilder::load_indexed(BasicType type) { // In case of in block code motion in range check elimination ValueStack* state_before = copy_state_indexed_access(); - ValueStack* deopt_state = copy_state_before(); compilation()->set_has_access_indexed(true); Value index = ipop(); Value array = apop(); Value length = NULL; if (CSEArrayLength || (array->as_AccessField() && array->as_AccessField()->field()->is_constant()) || (array->as_NewArray() && array->as_NewArray()->length() && array->as_NewArray()->length()->type()->is_constant())) { length = append(new ArrayLength(array, state_before)); } ! if (array->is_flattened_array()) { ! if (array->declared_type()->is_loaded()) { ciType* array_type = array->declared_type(); ciValueKlass* elem_klass = array_type->as_value_array_klass()->element_klass()->as_value_klass(); NewValueTypeInstance* new_instance = new NewValueTypeInstance(elem_klass, state_before, false); _memory->new_instance(new_instance); apush(append_split(new_instance)); LoadIndexed* load_indexed = new LoadIndexed(array, index, length, type, state_before); load_indexed->set_vt(new_instance); append(load_indexed); - return; } else { - // Value array access may be deoptimized. Need full "before" states. - state_before = deopt_state; - } - } - push(as_ValueType(type), append(new LoadIndexed(array, index, length, type, state_before))); } void GraphBuilder::store_indexed(BasicType type) { // In case of in block code motion in range check elimination --- 980,1011 ---- void GraphBuilder::load_indexed(BasicType type) { // In case of in block code motion in range check elimination ValueStack* state_before = copy_state_indexed_access(); compilation()->set_has_access_indexed(true); Value index = ipop(); Value array = apop(); Value length = NULL; if (CSEArrayLength || (array->as_AccessField() && array->as_AccessField()->field()->is_constant()) || (array->as_NewArray() && array->as_NewArray()->length() && array->as_NewArray()->length()->type()->is_constant())) { length = append(new ArrayLength(array, state_before)); } ! if (array->is_loaded_flattened_array()) { ciType* array_type = array->declared_type(); ciValueKlass* elem_klass = array_type->as_value_array_klass()->element_klass()->as_value_klass(); NewValueTypeInstance* new_instance = new NewValueTypeInstance(elem_klass, state_before, false); _memory->new_instance(new_instance); apush(append_split(new_instance)); LoadIndexed* load_indexed = new LoadIndexed(array, index, length, type, state_before); load_indexed->set_vt(new_instance); append(load_indexed); } else { push(as_ValueType(type), append(new LoadIndexed(array, index, length, type, state_before))); + } } void GraphBuilder::store_indexed(BasicType type) { // In case of in block code motion in range check elimination
< prev index next >