100 void Instruction::state_values_do(ValueVisitor* f) { 101 if (state_before() != NULL) { 102 state_before()->values_do(f); 103 } 104 if (exception_state() != NULL){ 105 exception_state()->values_do(f); 106 } 107 } 108 109 ciType* Instruction::exact_type() const { 110 ciType* t = declared_type(); 111 if (t != NULL && t->is_klass()) { 112 return t->as_klass()->exact_klass(); 113 } 114 return NULL; 115 } 116 117 bool Instruction::is_flattened_array() const { 118 if (ValueArrayFlatten) { 119 ciType* type = declared_type(); 120 if (type != NULL && 121 type->is_value_array_klass() && 122 type->as_value_array_klass()->element_klass()->as_value_klass()->flatten_array()) { 123 return true; 124 } 125 } 126 127 return false; 128 } 129 130 #ifndef PRODUCT 131 void Instruction::check_state(ValueStack* state) { 132 if (state != NULL) { 133 state->verify(); 134 } 135 } 136 137 138 void Instruction::print() { 139 InstructionPrinter ip; 140 print(ip); 141 } 142 143 | 100 void Instruction::state_values_do(ValueVisitor* f) { 101 if (state_before() != NULL) { 102 state_before()->values_do(f); 103 } 104 if (exception_state() != NULL){ 105 exception_state()->values_do(f); 106 } 107 } 108 109 ciType* Instruction::exact_type() const { 110 ciType* t = declared_type(); 111 if (t != NULL && t->is_klass()) { 112 return t->as_klass()->exact_klass(); 113 } 114 return NULL; 115 } 116 117 bool Instruction::is_flattened_array() const { 118 if (ValueArrayFlatten) { 119 ciType* type = declared_type(); 120 if (type != NULL && type->is_value_array_klass()) { 121 ciValueKlass* element_klass = type->as_value_array_klass()->element_klass()->as_value_klass(); 122 if (!element_klass->is_loaded() || element_klass->flatten_array()) { 123 // Assume that all unloaded value arrays are not flattenable. If they 124 // turn out to be flattenable, we deoptimize on aaload/aastore. 125 return true; 126 } 127 } 128 } 129 130 return false; 131 } 132 133 #ifndef PRODUCT 134 void Instruction::check_state(ValueStack* state) { 135 if (state != NULL) { 136 state->verify(); 137 } 138 } 139 140 141 void Instruction::print() { 142 InstructionPrinter ip; 143 print(ip); 144 } 145 146 |