comparison src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp @ 1819:f02a8bbe6ed4

6986046: C1 valuestack cleanup Summary: fixes an historical oddity in C1 with inlining where all of the expression stacks are kept in the topmost ValueStack instead of being in their respective ValueStacks. Reviewed-by: never Contributed-by: Christian Wimmer <cwimmer@uci.edu>
author roland
date Tue, 29 Dec 2009 19:08:54 +0100
parents 3a294e483abc
children c393f046f4c5
comparison
equal deleted inserted replaced
1817:c40600e85311 1819:f02a8bbe6ed4
309 // visitor functions 309 // visitor functions
310 //---------------------------------------------------------------------- 310 //----------------------------------------------------------------------
311 311
312 312
313 void LIRGenerator::do_StoreIndexed(StoreIndexed* x) { 313 void LIRGenerator::do_StoreIndexed(StoreIndexed* x) {
314 assert(x->is_root(),""); 314 assert(x->is_pinned(),"");
315 bool needs_range_check = true; 315 bool needs_range_check = true;
316 bool use_length = x->length() != NULL; 316 bool use_length = x->length() != NULL;
317 bool obj_store = x->elt_type() == T_ARRAY || x->elt_type() == T_OBJECT; 317 bool obj_store = x->elt_type() == T_ARRAY || x->elt_type() == T_OBJECT;
318 bool needs_store_check = obj_store && (x->value()->as_Constant() == NULL || 318 bool needs_store_check = obj_store && (x->value()->as_Constant() == NULL ||
319 !get_jobject_constant(x->value())->is_null_object()); 319 !get_jobject_constant(x->value())->is_null_object());
384 } 384 }
385 } 385 }
386 386
387 387
388 void LIRGenerator::do_MonitorEnter(MonitorEnter* x) { 388 void LIRGenerator::do_MonitorEnter(MonitorEnter* x) {
389 assert(x->is_root(),""); 389 assert(x->is_pinned(),"");
390 LIRItem obj(x->obj(), this); 390 LIRItem obj(x->obj(), this);
391 obj.load_item(); 391 obj.load_item();
392 392
393 set_no_result(x); 393 set_no_result(x);
394 394
396 LIR_Opr scratch = FrameMap::G3_opr; 396 LIR_Opr scratch = FrameMap::G3_opr;
397 LIR_Opr hdr = FrameMap::G4_opr; 397 LIR_Opr hdr = FrameMap::G4_opr;
398 398
399 CodeEmitInfo* info_for_exception = NULL; 399 CodeEmitInfo* info_for_exception = NULL;
400 if (x->needs_null_check()) { 400 if (x->needs_null_check()) {
401 info_for_exception = state_for(x, x->lock_stack_before()); 401 info_for_exception = state_for(x);
402 } 402 }
403 403
404 // this CodeEmitInfo must not have the xhandlers because here the 404 // this CodeEmitInfo must not have the xhandlers because here the
405 // object is already locked (xhandlers expects object to be unlocked) 405 // object is already locked (xhandlers expects object to be unlocked)
406 CodeEmitInfo* info = state_for(x, x->state(), true); 406 CodeEmitInfo* info = state_for(x, x->state(), true);
407 monitor_enter(obj.result(), lock, hdr, scratch, x->monitor_no(), info_for_exception, info); 407 monitor_enter(obj.result(), lock, hdr, scratch, x->monitor_no(), info_for_exception, info);
408 } 408 }
409 409
410 410
411 void LIRGenerator::do_MonitorExit(MonitorExit* x) { 411 void LIRGenerator::do_MonitorExit(MonitorExit* x) {
412 assert(x->is_root(),""); 412 assert(x->is_pinned(),"");
413 LIRItem obj(x->obj(), this); 413 LIRItem obj(x->obj(), this);
414 obj.dont_load_item(); 414 obj.dont_load_item();
415 415
416 set_no_result(x); 416 set_no_result(x);
417 LIR_Opr lock = FrameMap::G1_opr; 417 LIR_Opr lock = FrameMap::G1_opr;
869 869
870 void LIRGenerator::do_NewInstance(NewInstance* x) { 870 void LIRGenerator::do_NewInstance(NewInstance* x) {
871 // This instruction can be deoptimized in the slow path : use 871 // This instruction can be deoptimized in the slow path : use
872 // O0 as result register. 872 // O0 as result register.
873 const LIR_Opr reg = result_register_for(x->type()); 873 const LIR_Opr reg = result_register_for(x->type());
874 874 #ifndef PRODUCT
875 if (PrintNotLoaded && !x->klass()->is_loaded()) { 875 if (PrintNotLoaded && !x->klass()->is_loaded()) {
876 tty->print_cr(" ###class not loaded at new bci %d", x->bci()); 876 tty->print_cr(" ###class not loaded at new bci %d", x->printable_bci());
877 } 877 }
878 #endif
878 CodeEmitInfo* info = state_for(x, x->state()); 879 CodeEmitInfo* info = state_for(x, x->state());
879 LIR_Opr tmp1 = FrameMap::G1_oop_opr; 880 LIR_Opr tmp1 = FrameMap::G1_oop_opr;
880 LIR_Opr tmp2 = FrameMap::G3_oop_opr; 881 LIR_Opr tmp2 = FrameMap::G3_oop_opr;
881 LIR_Opr tmp3 = FrameMap::G4_oop_opr; 882 LIR_Opr tmp3 = FrameMap::G4_oop_opr;
882 LIR_Opr tmp4 = FrameMap::O1_oop_opr; 883 LIR_Opr tmp4 = FrameMap::O1_oop_opr;
1016 patching_info = state_for(x, x->state_before()); 1017 patching_info = state_for(x, x->state_before());
1017 } 1018 }
1018 obj.load_item(); 1019 obj.load_item();
1019 LIR_Opr out_reg = rlock_result(x); 1020 LIR_Opr out_reg = rlock_result(x);
1020 CodeStub* stub; 1021 CodeStub* stub;
1021 CodeEmitInfo* info_for_exception = state_for(x, x->state()->copy_locks()); 1022 CodeEmitInfo* info_for_exception = state_for(x);
1022 1023
1023 if (x->is_incompatible_class_change_check()) { 1024 if (x->is_incompatible_class_change_check()) {
1024 assert(patching_info == NULL, "can't patch this"); 1025 assert(patching_info == NULL, "can't patch this");
1025 stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); 1026 stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception);
1026 } else { 1027 } else {