105 if (type == T_SHORT || type == T_CHAR) { |
105 if (type == T_SHORT || type == T_CHAR) { |
106 // there is no immediate move of word values in asembler_i486.?pp |
106 // there is no immediate move of word values in asembler_i486.?pp |
107 return false; |
107 return false; |
108 } |
108 } |
109 Constant* c = v->as_Constant(); |
109 Constant* c = v->as_Constant(); |
110 if (c && c->state() == NULL) { |
110 if (c && c->state_before() == NULL) { |
111 // constants of any type can be stored directly, except for |
111 // constants of any type can be stored directly, except for |
112 // unloaded object constants. |
112 // unloaded object constants. |
113 return true; |
113 return true; |
114 } |
114 } |
115 return false; |
115 return false; |
248 // visitor functions |
248 // visitor functions |
249 //---------------------------------------------------------------------- |
249 //---------------------------------------------------------------------- |
250 |
250 |
251 |
251 |
252 void LIRGenerator::do_StoreIndexed(StoreIndexed* x) { |
252 void LIRGenerator::do_StoreIndexed(StoreIndexed* x) { |
253 assert(x->is_root(),""); |
253 assert(x->is_pinned(),""); |
254 bool needs_range_check = true; |
254 bool needs_range_check = true; |
255 bool use_length = x->length() != NULL; |
255 bool use_length = x->length() != NULL; |
256 bool obj_store = x->elt_type() == T_ARRAY || x->elt_type() == T_OBJECT; |
256 bool obj_store = x->elt_type() == T_ARRAY || x->elt_type() == T_OBJECT; |
257 bool needs_store_check = obj_store && (x->value()->as_Constant() == NULL || |
257 bool needs_store_check = obj_store && (x->value()->as_Constant() == NULL || |
258 !get_jobject_constant(x->value())->is_null_object()); |
258 !get_jobject_constant(x->value())->is_null_object()); |
339 scratch = new_register(T_INT); |
339 scratch = new_register(T_INT); |
340 } |
340 } |
341 |
341 |
342 CodeEmitInfo* info_for_exception = NULL; |
342 CodeEmitInfo* info_for_exception = NULL; |
343 if (x->needs_null_check()) { |
343 if (x->needs_null_check()) { |
344 info_for_exception = state_for(x, x->lock_stack_before()); |
344 info_for_exception = state_for(x); |
345 } |
345 } |
346 // this CodeEmitInfo must not have the xhandlers because here the |
346 // this CodeEmitInfo must not have the xhandlers because here the |
347 // object is already locked (xhandlers expect object to be unlocked) |
347 // object is already locked (xhandlers expect object to be unlocked) |
348 CodeEmitInfo* info = state_for(x, x->state(), true); |
348 CodeEmitInfo* info = state_for(x, x->state(), true); |
349 monitor_enter(obj.result(), lock, syncTempOpr(), scratch, |
349 monitor_enter(obj.result(), lock, syncTempOpr(), scratch, |
350 x->monitor_no(), info_for_exception, info); |
350 x->monitor_no(), info_for_exception, info); |
351 } |
351 } |
352 |
352 |
353 |
353 |
354 void LIRGenerator::do_MonitorExit(MonitorExit* x) { |
354 void LIRGenerator::do_MonitorExit(MonitorExit* x) { |
355 assert(x->is_root(),""); |
355 assert(x->is_pinned(),""); |
356 |
356 |
357 LIRItem obj(x->obj(), this); |
357 LIRItem obj(x->obj(), this); |
358 obj.dont_load_item(); |
358 obj.dont_load_item(); |
359 |
359 |
360 LIR_Opr lock = new_register(T_INT); |
360 LIR_Opr lock = new_register(T_INT); |
982 set_result(x, result); |
982 set_result(x, result); |
983 } |
983 } |
984 |
984 |
985 |
985 |
986 void LIRGenerator::do_NewInstance(NewInstance* x) { |
986 void LIRGenerator::do_NewInstance(NewInstance* x) { |
|
987 #ifndef PRODUCT |
987 if (PrintNotLoaded && !x->klass()->is_loaded()) { |
988 if (PrintNotLoaded && !x->klass()->is_loaded()) { |
988 tty->print_cr(" ###class not loaded at new bci %d", x->bci()); |
989 tty->print_cr(" ###class not loaded at new bci %d", x->printable_bci()); |
989 } |
990 } |
|
991 #endif |
990 CodeEmitInfo* info = state_for(x, x->state()); |
992 CodeEmitInfo* info = state_for(x, x->state()); |
991 LIR_Opr reg = result_register_for(x->type()); |
993 LIR_Opr reg = result_register_for(x->type()); |
992 LIR_Opr klass_reg = new_register(objectType); |
994 LIR_Opr klass_reg = new_register(objectType); |
993 new_instance(reg, x->klass(), |
995 new_instance(reg, x->klass(), |
994 FrameMap::rcx_oop_opr, |
996 FrameMap::rcx_oop_opr, |
1125 patching_info = state_for(x, x->state_before()); |
1127 patching_info = state_for(x, x->state_before()); |
1126 } |
1128 } |
1127 obj.load_item(); |
1129 obj.load_item(); |
1128 |
1130 |
1129 // info for exceptions |
1131 // info for exceptions |
1130 CodeEmitInfo* info_for_exception = state_for(x, x->state()->copy_locks()); |
1132 CodeEmitInfo* info_for_exception = state_for(x); |
1131 |
1133 |
1132 CodeStub* stub; |
1134 CodeStub* stub; |
1133 if (x->is_incompatible_class_change_check()) { |
1135 if (x->is_incompatible_class_change_check()) { |
1134 assert(patching_info == NULL, "can't patch this"); |
1136 assert(patching_info == NULL, "can't patch this"); |
1135 stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); |
1137 stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); |