comparison src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp @ 3888:4fe626cbf0bf

7066841: remove MacroAssembler::br_on_reg_cond() on sparc Summary: Remove the macro assembler routine br_on_reg_cond() and replace the remaining calls to that routine with an equivalent. Reviewed-by: kvn, iveresov
author johnc
date Wed, 31 Aug 2011 10:16:02 -0700
parents 3d42f82cd811
children cec1757a0134
comparison
equal deleted inserted replaced
3887:9447b2fb6fcf 3888:4fe626cbf0bf
419 if (do_load()) { 419 if (do_load()) {
420 ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/); 420 ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);
421 } 421 }
422 422
423 if (__ is_in_wdisp16_range(_continuation)) { 423 if (__ is_in_wdisp16_range(_continuation)) {
424 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, 424 __ br_null(pre_val_reg, /*annul*/false, Assembler::pt, _continuation);
425 pre_val_reg, _continuation);
426 } else { 425 } else {
427 __ cmp(pre_val_reg, G0); 426 __ cmp(pre_val_reg, G0);
428 __ brx(Assembler::equal, false, Assembler::pn, _continuation); 427 __ brx(Assembler::equal, false, Assembler::pn, _continuation);
429 } 428 }
430 __ delayed()->nop(); 429 __ delayed()->nop();
456 455
457 if (gen_src_check()) { 456 if (gen_src_check()) {
458 // The original src operand was not a constant. 457 // The original src operand was not a constant.
459 // Generate src == null? 458 // Generate src == null?
460 if (__ is_in_wdisp16_range(_continuation)) { 459 if (__ is_in_wdisp16_range(_continuation)) {
461 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, 460 __ br_null(src_reg, /*annul*/false, Assembler::pt, _continuation);
462 src_reg, _continuation);
463 } else { 461 } else {
464 __ cmp(src_reg, G0); 462 __ cmp(src_reg, G0);
465 __ brx(Assembler::equal, false, Assembler::pt, _continuation); 463 __ brx(Assembler::equal, false, Assembler::pt, _continuation);
466 } 464 }
467 __ delayed()->nop(); 465 __ delayed()->nop();
474 __ load_klass(src_reg, tmp_reg); 472 __ load_klass(src_reg, tmp_reg);
475 473
476 Address ref_type_adr(tmp_reg, instanceKlass::reference_type_offset_in_bytes() + sizeof(oopDesc)); 474 Address ref_type_adr(tmp_reg, instanceKlass::reference_type_offset_in_bytes() + sizeof(oopDesc));
477 __ ld(ref_type_adr, tmp_reg); 475 __ ld(ref_type_adr, tmp_reg);
478 476
479 if (__ is_in_wdisp16_range(_continuation)) { 477 // _reference_type field is of type ReferenceType (enum)
480 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, 478 assert(REF_NONE == 0, "check this code");
481 tmp_reg, _continuation); 479 __ cmp_zero_and_br(Assembler::equal, tmp_reg, _continuation, /*annul*/false, Assembler::pt);
482 } else {
483 __ cmp(tmp_reg, G0);
484 __ brx(Assembler::equal, false, Assembler::pt, _continuation);
485 }
486 __ delayed()->nop(); 480 __ delayed()->nop();
487 481
488 // Is marking active? 482 // Is marking active?
489 assert(thread()->is_register(), "precondition"); 483 assert(thread()->is_register(), "precondition");
490 Register thread_reg = thread()->as_pointer_register(); 484 Register thread_reg = thread()->as_pointer_register();
496 __ ld(in_progress, tmp_reg); 490 __ ld(in_progress, tmp_reg);
497 } else { 491 } else {
498 assert(in_bytes(PtrQueue::byte_width_of_active()) == 1, "Assumption"); 492 assert(in_bytes(PtrQueue::byte_width_of_active()) == 1, "Assumption");
499 __ ldsb(in_progress, tmp_reg); 493 __ ldsb(in_progress, tmp_reg);
500 } 494 }
501 if (__ is_in_wdisp16_range(_continuation)) { 495
502 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, 496 __ cmp_zero_and_br(Assembler::equal, tmp_reg, _continuation, /*annul*/false, Assembler::pt);
503 tmp_reg, _continuation);
504 } else {
505 __ cmp(tmp_reg, G0);
506 __ brx(Assembler::equal, false, Assembler::pt, _continuation);
507 }
508 __ delayed()->nop(); 497 __ delayed()->nop();
509 498
510 // val == null? 499 // val == null?
511 assert(val()->is_register(), "Precondition."); 500 assert(val()->is_register(), "Precondition.");
512 Register val_reg = val()->as_register(); 501 Register val_reg = val()->as_register();
513 502
514 if (__ is_in_wdisp16_range(_continuation)) { 503 if (__ is_in_wdisp16_range(_continuation)) {
515 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, 504 __ br_null(val_reg, /*annul*/false, Assembler::pt, _continuation);
516 val_reg, _continuation);
517 } else { 505 } else {
518 __ cmp(val_reg, G0); 506 __ cmp(val_reg, G0);
519 __ brx(Assembler::equal, false, Assembler::pt, _continuation); 507 __ brx(Assembler::equal, false, Assembler::pt, _continuation);
520 } 508 }
521 __ delayed()->nop(); 509 __ delayed()->nop();
540 528
541 assert(addr()->is_register(), "Precondition."); 529 assert(addr()->is_register(), "Precondition.");
542 assert(new_val()->is_register(), "Precondition."); 530 assert(new_val()->is_register(), "Precondition.");
543 Register addr_reg = addr()->as_pointer_register(); 531 Register addr_reg = addr()->as_pointer_register();
544 Register new_val_reg = new_val()->as_register(); 532 Register new_val_reg = new_val()->as_register();
533
545 if (__ is_in_wdisp16_range(_continuation)) { 534 if (__ is_in_wdisp16_range(_continuation)) {
546 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, 535 __ br_null(new_val_reg, /*annul*/false, Assembler::pt, _continuation);
547 new_val_reg, _continuation);
548 } else { 536 } else {
549 __ cmp(new_val_reg, G0); 537 __ cmp(new_val_reg, G0);
550 __ brx(Assembler::equal, false, Assembler::pn, _continuation); 538 __ brx(Assembler::equal, false, Assembler::pn, _continuation);
551 } 539 }
552 __ delayed()->nop(); 540 __ delayed()->nop();