< prev index next >

src/hotspot/share/c1/c1_GraphBuilder.cpp

Print this page


 965       // ret.
 966       for (ScopeData* cur_scope_data = scope_data()->parent();
 967            cur_scope_data != NULL && cur_scope_data->parsing_jsr() && cur_scope_data->scope() == scope();
 968            cur_scope_data = cur_scope_data->parent()) {
 969         if (cur_scope_data->jsr_return_address_local() == index) {
 970           BAILOUT("subroutine overwrites return address from previous subroutine");
 971         }
 972       }
 973     } else if (index == scope_data()->jsr_return_address_local()) {
 974       scope_data()->set_jsr_return_address_local(-1);
 975     }
 976   }
 977 
 978   state->store_local(index, round_fp(x));
 979 }
 980 
 981 
 982 void GraphBuilder::load_indexed(BasicType type) {
 983   // In case of in block code motion in range check elimination
 984   ValueStack* state_before = copy_state_indexed_access();
 985   ValueStack* deopt_state = copy_state_before();
 986   compilation()->set_has_access_indexed(true);
 987   Value index = ipop();
 988   Value array = apop();
 989   Value length = NULL;
 990   if (CSEArrayLength ||
 991       (array->as_AccessField() && array->as_AccessField()->field()->is_constant()) ||
 992       (array->as_NewArray() && array->as_NewArray()->length() && array->as_NewArray()->length()->type()->is_constant())) {
 993     length = append(new ArrayLength(array, state_before));
 994   }
 995 
 996   if (array->is_flattened_array()) {
 997     if (array->declared_type()->is_loaded()) {
 998       ciType* array_type = array->declared_type();
 999       ciValueKlass* elem_klass = array_type->as_value_array_klass()->element_klass()->as_value_klass();
1000       NewValueTypeInstance* new_instance = new NewValueTypeInstance(elem_klass, state_before, false);
1001       _memory->new_instance(new_instance);
1002       apush(append_split(new_instance));
1003       LoadIndexed* load_indexed = new LoadIndexed(array, index, length, type, state_before);
1004       load_indexed->set_vt(new_instance);
1005       append(load_indexed);
1006       return;
1007     } else {
1008       // Value array access may be deoptimized. Need full "before" states.
1009       state_before = deopt_state;
1010     }
1011   }
1012 
1013   push(as_ValueType(type), append(new LoadIndexed(array, index, length, type, state_before)));

1014 }
1015 
1016 
1017 void GraphBuilder::store_indexed(BasicType type) {
1018   // In case of in block code motion in range check elimination
1019   ValueStack* state_before = copy_state_indexed_access();
1020   ValueStack* deopt_state = copy_state_before();
1021   compilation()->set_has_access_indexed(true);
1022   Value value = pop(as_ValueType(type));
1023   Value index = ipop();
1024   Value array = apop();
1025   Value length = NULL;
1026   if (CSEArrayLength ||
1027       (array->as_AccessField() && array->as_AccessField()->field()->is_constant()) ||
1028       (array->as_NewArray() && array->as_NewArray()->length() && array->as_NewArray()->length()->type()->is_constant())) {
1029     length = append(new ArrayLength(array, state_before));
1030   }
1031   ciType* array_type = array->declared_type();
1032   bool check_boolean = false;
1033   if (array_type != NULL) {




 965       // ret.
 966       for (ScopeData* cur_scope_data = scope_data()->parent();
 967            cur_scope_data != NULL && cur_scope_data->parsing_jsr() && cur_scope_data->scope() == scope();
 968            cur_scope_data = cur_scope_data->parent()) {
 969         if (cur_scope_data->jsr_return_address_local() == index) {
 970           BAILOUT("subroutine overwrites return address from previous subroutine");
 971         }
 972       }
 973     } else if (index == scope_data()->jsr_return_address_local()) {
 974       scope_data()->set_jsr_return_address_local(-1);
 975     }
 976   }
 977 
 978   state->store_local(index, round_fp(x));
 979 }
 980 
 981 
 982 void GraphBuilder::load_indexed(BasicType type) {
 983   // In case of in block code motion in range check elimination
 984   ValueStack* state_before = copy_state_indexed_access();

 985   compilation()->set_has_access_indexed(true);
 986   Value index = ipop();
 987   Value array = apop();
 988   Value length = NULL;
 989   if (CSEArrayLength ||
 990       (array->as_AccessField() && array->as_AccessField()->field()->is_constant()) ||
 991       (array->as_NewArray() && array->as_NewArray()->length() && array->as_NewArray()->length()->type()->is_constant())) {
 992     length = append(new ArrayLength(array, state_before));
 993   }
 994 
 995   if (array->is_loaded_flattened_array()) {

 996     ciType* array_type = array->declared_type();
 997     ciValueKlass* elem_klass = array_type->as_value_array_klass()->element_klass()->as_value_klass();
 998     NewValueTypeInstance* new_instance = new NewValueTypeInstance(elem_klass, state_before, false);
 999     _memory->new_instance(new_instance);
1000     apush(append_split(new_instance));
1001     LoadIndexed* load_indexed = new LoadIndexed(array, index, length, type, state_before);
1002     load_indexed->set_vt(new_instance);
1003     append(load_indexed);

1004   } else {





1005     push(as_ValueType(type), append(new LoadIndexed(array, index, length, type, state_before)));
1006   }
1007 }
1008 
1009 
1010 void GraphBuilder::store_indexed(BasicType type) {
1011   // In case of in block code motion in range check elimination
1012   ValueStack* state_before = copy_state_indexed_access();
1013   ValueStack* deopt_state = copy_state_before();
1014   compilation()->set_has_access_indexed(true);
1015   Value value = pop(as_ValueType(type));
1016   Value index = ipop();
1017   Value array = apop();
1018   Value length = NULL;
1019   if (CSEArrayLength ||
1020       (array->as_AccessField() && array->as_AccessField()->field()->is_constant()) ||
1021       (array->as_NewArray() && array->as_NewArray()->length() && array->as_NewArray()->length()->type()->is_constant())) {
1022     length = append(new ArrayLength(array, state_before));
1023   }
1024   ciType* array_type = array->declared_type();
1025   bool check_boolean = false;
1026   if (array_type != NULL) {


< prev index next >