1096 }
1097
1098
1099 //---------------------------------------------------------------------
1100 ciObject* LIRGenerator::get_jobject_constant(Value value) {
1101 ObjectType* oc = value->type()->as_ObjectType();
1102 if (oc) {
1103 return oc->constant_value();
1104 }
1105 return NULL;
1106 }
1107
1108
1109 void LIRGenerator::do_ExceptionObject(ExceptionObject* x) {
1110 assert(block()->is_set(BlockBegin::exception_entry_flag), "ExceptionObject only allowed in exception handler block");
1111 assert(block()->next() == x, "ExceptionObject must be first instruction of block");
1112
1113 // no moves are created for phi functions at the begin of exception
1114 // handlers, so assign operands manually here
1115 for_each_phi_fun(block(), phi,
1116 operand_for_instruction(phi));
1117
1118 LIR_Opr thread_reg = getThreadPointer();
1119 __ move_wide(new LIR_Address(thread_reg, in_bytes(JavaThread::exception_oop_offset()), T_OBJECT),
1120 exceptionOopOpr());
1121 __ move_wide(LIR_OprFact::oopConst(NULL),
1122 new LIR_Address(thread_reg, in_bytes(JavaThread::exception_oop_offset()), T_OBJECT));
1123 __ move_wide(LIR_OprFact::oopConst(NULL),
1124 new LIR_Address(thread_reg, in_bytes(JavaThread::exception_pc_offset()), T_OBJECT));
1125
1126 LIR_Opr result = new_register(T_OBJECT);
1127 __ move(exceptionOopOpr(), result);
1128 set_result(x, result);
1129 }
1130
1131
1132 //----------------------------------------------------------------------
1133 //----------------------------------------------------------------------
1134 //----------------------------------------------------------------------
1135 //----------------------------------------------------------------------
1136 // visitor functions
|
1096 }
1097
1098
1099 //---------------------------------------------------------------------
1100 ciObject* LIRGenerator::get_jobject_constant(Value value) {
1101 ObjectType* oc = value->type()->as_ObjectType();
1102 if (oc) {
1103 return oc->constant_value();
1104 }
1105 return NULL;
1106 }
1107
1108
1109 void LIRGenerator::do_ExceptionObject(ExceptionObject* x) {
1110 assert(block()->is_set(BlockBegin::exception_entry_flag), "ExceptionObject only allowed in exception handler block");
1111 assert(block()->next() == x, "ExceptionObject must be first instruction of block");
1112
1113 // no moves are created for phi functions at the begin of exception
1114 // handlers, so assign operands manually here
1115 for_each_phi_fun(block(), phi,
1116 if (!phi->is_illegal()) { operand_for_instruction(phi); });
1117
1118 LIR_Opr thread_reg = getThreadPointer();
1119 __ move_wide(new LIR_Address(thread_reg, in_bytes(JavaThread::exception_oop_offset()), T_OBJECT),
1120 exceptionOopOpr());
1121 __ move_wide(LIR_OprFact::oopConst(NULL),
1122 new LIR_Address(thread_reg, in_bytes(JavaThread::exception_oop_offset()), T_OBJECT));
1123 __ move_wide(LIR_OprFact::oopConst(NULL),
1124 new LIR_Address(thread_reg, in_bytes(JavaThread::exception_pc_offset()), T_OBJECT));
1125
1126 LIR_Opr result = new_register(T_OBJECT);
1127 __ move(exceptionOopOpr(), result);
1128 set_result(x, result);
1129 }
1130
1131
1132 //----------------------------------------------------------------------
1133 //----------------------------------------------------------------------
1134 //----------------------------------------------------------------------
1135 //----------------------------------------------------------------------
1136 // visitor functions
|